summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/run_tests.sh
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-12-02 15:37:18 +1100
committerMichael Adam <obnox@samba.org>2013-12-05 00:46:04 +0100
commit318f2cf9123875acdef39d170cdbc6683a79e896 (patch)
tree7fa3c5e97cc98bcd6f05f76b463c76f871e873cb /ctdb/tests/run_tests.sh
parentbbd46e8634f5db7631ce80a4b81781adf507a383 (diff)
downloadsamba-318f2cf9123875acdef39d170cdbc6683a79e896.tar.gz
samba-318f2cf9123875acdef39d170cdbc6683a79e896.tar.xz
samba-318f2cf9123875acdef39d170cdbc6683a79e896.zip
ctdb/tests/scripts: Simplify the top-level test scripts
At the moment run_tests.sh has quite fragile argument processing. It needs that annoying "--" between options and tests. The random default (mktemp -d) for TEST_VAR_DIR is wrong and is worked around in various places. Instead: * Change the default behaviour to print a summary, add new option -N to turn off summary, and remove old -s option. * Change the default behaviour to run integration tests with local daemons, add new options -c to run on a cluster, remove old -l option. * Make $testdir/var the default if the tests are not installed, and $(mktemp -d ) the default if tests are installed. * Move the default tests for local/cluster into scripts/run_tests. run_tests.sh (and the run_cluster_tests.sh symlink) should behave as before but with slightly more reasonable defaults. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'ctdb/tests/run_tests.sh')
-rwxr-xr-xctdb/tests/run_tests.sh39
1 files changed, 3 insertions, 36 deletions
diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh
index 5fcd89d5de..ef1d8f64e4 100755
--- a/ctdb/tests/run_tests.sh
+++ b/ctdb/tests/run_tests.sh
@@ -4,43 +4,10 @@ test_dir=$(dirname "$0")
case $(basename "$0") in
*run_cluster_tests*)
- # Running on a cluster:
- # * print summary, run any integration tests against cluster
- # * default to running: all integration tests, no unit tests
- opts="-s"
- tests="simple complex"
+ opts="-c"
;;
*)
- # Running on local machine:
- # * print summary, run any integration tests against local daemons
- # * default to running: all unit tests, simple integration tests
- opts="-s -l"
- tests="onnode takeover tool eventscripts simple"
- # If running in the source tree then use a fixed TEST_VAR_DIR.
- # If this script is installed using the INSTALL script then
- # TEST_BIN_DIR will be set, so use this as the test.
- if [ -z "$TEST_BIN_DIR" ] ; then
- opts="${opts} -V ${test_dir}/var"
- fi
+ opts=""
esac
-# Allow options to be passed to this script. However, if any options
-# are passed there must be a "--" between the options and the tests.
-# This makes it easy to handle options that take arguments.
-case "$1" in
- -*)
- while [ -n "$1" ] ; do
- case "$1" in
- --) shift ; break ;;
- *) opts="$opts $1" ; shift ;;
- esac
- done
-esac
-
-# If no tests are specified, then run the defaults.
-[ -n "$1" ] || set -- $tests
-
-"${test_dir}/scripts/run_tests" $opts "$@" || exit 1
-
-echo "All OK"
-exit 0
+exec "${test_dir}/scripts/run_tests" $opts "$@"