From: Martin Schwenke Date: Mon, 17 Feb 2014 00:32:15 +0000 (+1100) Subject: ctdb-tests: Improvements to tests INSTALL script X-Git-Tag: tdb-1.2.13~331 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4298e9e9dd4cc2a9a79f895e00477e802b2e052;p=thirdparty%2Fsamba.git ctdb-tests: Improvements to tests INSTALL script * Should stop on 1st error * Fix up value of CTDB_TESTS_ARE_INSTALLED * Improve fixing of broken symlinks in INSTALL This is all of the links in tests/eventscript/etc-ctdb/ so no need to list them. Just find and fix them. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/INSTALL b/ctdb/tests/INSTALL index 5581989619b..23dcdaf2e6a 100755 --- a/ctdb/tests/INSTALL +++ b/ctdb/tests/INSTALL @@ -1,5 +1,8 @@ #!/bin/sh +# Stop on 1st error +set -e + # Script to install the CTDB testsuite on a machine. usage () @@ -71,7 +74,9 @@ for d in $data_subdirs ; do done # Some of the unit tests have relative symlinks back to in-tree bits # and pieces. These links will be broken! -for i in "events.d" "functions" "nfs-rpc-checks.d" ; do +link_dir="${ctdb_datadir}/eventscripts/etc-ctdb/" +broken_links=$(find "$link_dir" -type l | sed -e "s@^${link_dir}@@") +for i in $broken_links ; do ln -sf "${etcdir}/ctdb/${i}" "${ctdb_datadir}/eventscripts/etc-ctdb/${i}" done # test_wrap needs to set TEST_BIN_DIR @@ -86,6 +91,6 @@ ctdb_bindir="${destdir}${bindir}" echo "Installing wrapper scripts into ${ctdb_bindir}..." mkdir -p "${ctdb_bindir}" out="${ctdb_bindir}/ctdb_run_tests" -sed -e "s@^test_dir=.*@test_dir=${datarootdir}/ctdb-tests\nexport TEST_BIN_DIR=\"${libdir}/ctdb-tests\"@" "tests/run_tests.sh" >"$out" +sed -e "s@^test_dir=.*@test_dir=${datarootdir}/ctdb-tests\nexport TEST_BIN_DIR=\"${libdir}/ctdb-tests\"@" -e 's@^\(export CTDB_TESTS_ARE_INSTALLED\)=false@\1=true@' "tests/run_tests.sh" >"$out" chmod 755 "$out" ln -s "ctdb_run_tests" "${ctdb_bindir}/ctdb_run_cluster_tests"