summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/INSTALL
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-05-14 11:57:20 +1000
committerMartin Schwenke <martin@meltin.net>2012-05-14 15:02:19 +1000
commit594601bdad81f0211e5c9f844e81262ede06c3b6 (patch)
tree76f77b7cde5d63138180768a352e689540fdbc13 /ctdb/tests/INSTALL
parentb8e9a3e54d5e524df6a1c08a2cbbe1ce894fbf58 (diff)
downloadsamba-594601bdad81f0211e5c9f844e81262ede06c3b6.tar.gz
samba-594601bdad81f0211e5c9f844e81262ede06c3b6.tar.xz
samba-594601bdad81f0211e5c9f844e81262ede06c3b6.zip
tests: Fix wrapper scripts to handle options and tests without breakage
If the -V option is given and no tests are supplied, the "cd" command in run_tests.sh cause scripts/run_tests to interpret the argument to -V incorrectly. Therefore, the wrapper scripts can't use "cd" because they don't know what the options are doing! Instead scripts/run_tests searches for each test relative to the current directory and, if not previously found, then searches relative to the top-level tests directory. This is a much better way of doing things. Given that run_tests.sh and run_cluster_tests.sh were starting to contain duplicate complex logic, remove run_cluster_tests.sh and replace it with a symlink to run_tests.sh. Run_tests.sh checks $0 to see what options/defaults to use. Update INSTALL to deal with this. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit ed2db1f4e8d2b222d7f912a4a007ce48a23e83b0)
Diffstat (limited to 'ctdb/tests/INSTALL')
-rwxr-xr-xctdb/tests/INSTALL10
1 files changed, 4 insertions, 6 deletions
diff --git a/ctdb/tests/INSTALL b/ctdb/tests/INSTALL
index 6f43650cce..c67d76dc7d 100755
--- a/ctdb/tests/INSTALL
+++ b/ctdb/tests/INSTALL
@@ -83,9 +83,7 @@ cp -pr "tests/bin/" "${ctdb_libdir}"
ctdb_bindir="${destdir}${bindir}"
echo "Installing wrapper scripts into ${ctdb_bindir}..."
mkdir -p "${ctdb_bindir}"
-for i in tests/run_tests.sh tests/run_cluster_tests.sh ; do
- b=$(basename "$i" ".sh")
- out="${ctdb_bindir}/ctdb_${b}"
- sed -e "s@^test_dir=.*@test_dir=${datarootdir}/ctdb-tests\nexport TEST_BIN_DIR=\"${libdir}/ctdb-tests\"@" "$i" >"${out}"
- chmod 755 "$out"
-done
+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"
+chmod 755 "$out"
+ln -s "ctdb_run_tests" "${ctdb_bindir}/ctdb_run_cluster_tests"