From: Sebastian Harl Date: Thu, 1 May 2014 19:57:55 +0000 (+0200) Subject: integration tests: Use LD_PRELOAD instead of chrpath. X-Git-Tag: sysdb-0.1.0~49 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=cedd242274a762dfb8d8efa530a0bbb3d16446a5;ds=sidebyside integration tests: Use LD_PRELOAD instead of chrpath. chrpath requires that the new path be shorter or the same length as the previous path. --- diff --git a/.travis.yml b/.travis.yml index f91c75f..1ee48b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_install: install: - sudo apt-get install -qq check flex bison libtool libltdl-dev - sudo apt-get install -qq libdbi-dev libedit-dev libreadline-dev - - sudo apt-get install -qq valgrind chrpath + - sudo apt-get install -qq valgrind - sudo pip install cpp-coveralls - pip show cpp-coveralls script: ./t/cibuild.sh diff --git a/README b/README index a737ebc..d3d4d62 100644 --- a/README +++ b/README @@ -68,8 +68,8 @@ Testing library. It used used to mock I/O related functions. In case this function is not available, the respective tests will be disabled automatically. - The integration tests require valgrind and chrpath. If any of these are not - available, integration tests will be disabled automatically. + The integration tests require valgrind. If it is not available, integration + tests will be disabled automatically. For the latest build status, see: diff --git a/configure.ac b/configure.ac index 7b8d801..2e55bc7 100644 --- a/configure.ac +++ b/configure.ac @@ -398,9 +398,8 @@ AC_SUBST([A2X]) integration_tests="yes" AC_PATH_PROG([VALGRIND], [valgrind]) -AC_PATH_PROG([CHRPATH], [chrpath]) -if test "x$VALGRIND" = "x" || test "x$CHRPATH" = "x"; then - integration_tests="no (missing valgrind and/or chrpath)" +if test "x$VALGRIND" = "x"; then + integration_tests="no (missing valgrind)" fi AM_CONDITIONAL([INTEGRATION_TESTING], test "x$integration_tests" = "xyes") diff --git a/t/integration/test_lib.sh b/t/integration/test_lib.sh index a5dece6..b7f7c97 100644 --- a/t/integration/test_lib.sh +++ b/t/integration/test_lib.sh @@ -38,8 +38,6 @@ cp "$TOP_SRCDIR/t/integration/.libs/mock_plugin.so" "$TESTDIR/backend" cp "$TOP_SRCDIR"/src/.libs/sysdb "$TESTDIR" cp "$TOP_SRCDIR"/src/.libs/sysdbd "$TESTDIR" cp "$TOP_SRCDIR"/src/.libs/libsysdb*.so* "$TESTDIR" -chrpath -r "$TESTDIR" "$TESTDIR/sysdb" > /dev/null -chrpath -r "$TESTDIR" "$TESTDIR/sysdbd" > /dev/null MEMCHECK="valgrind --quiet --tool=memcheck --error-exitcode=1" MEMCHECK="$MEMCHECK --trace-children=yes" @@ -54,6 +52,8 @@ PLUGIN_DIR="$TESTDIR" SYSDB="$MEMCHECK $TESTDIR/sysdb" SYSDBD="$MEMCHECK $TESTDIR/sysdbd" +export LD_PRELOAD=$TESTDIR/libsysdbclient.so:$TESTDIR/libsysdb.so + function wait_for_sysdbd() { local i for (( i=0; i<10; i++ )); do