tests: Update top-level wrapper scripts
authorMartin Schwenke <martin@meltin.net>
Fri, 20 Apr 2012 04:10:34 +0000 (14:10 +1000)
committerMartin Schwenke <martin@meltin.net>
Fri, 27 Apr 2012 05:40:43 +0000 (15:40 +1000)
* Add the unit tests to "make test"
* Make scripts run from anywhere

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 95947123eee687ed83eebc567397a5bc9d55a945)

ctdb/tests/run_cluster_tests.sh
ctdb/tests/run_tests.sh

index e6ee8d1f8035e16a2276bc33a868453b83539c8e..fa45534b0c371b4b49db3b141ac261b0ad8d4e01 100755 (executable)
@@ -1,9 +1,17 @@
 #!/bin/sh
 
-if [ -n "$*" ]; then
-    tests/scripts/run_tests -s $* || exit 1
+test_dir=$(dirname "$0")
+
+if [ -n "$1" ] ; then
+    "${test_dir}/scripts/run_tests" -l -s "$@" || exit 1
 else
-    tests/scripts/run_tests -s tests/simple/*.sh tests/complex/*.sh || exit 1
+    cd "$test_dir"
+
+    # By default, run all unit tests and the tests against local
+    # daemons
+    dirs="simple complex"
+
+    ./scripts/run_tests -s $dirs || exit 1
 fi
 
 echo "All OK"
index 56f020575f5ac6a4134ea565732c7c9f347dded3..f3cc840fb0da2f5fae876d8cecabb23fa5fb6fd8 100755 (executable)
@@ -1,6 +1,18 @@
 #!/bin/sh
 
-tests/scripts/run_tests -l -s ${*:-tests/simple/*.sh} || exit 1
+test_dir=$(dirname "$0")
+
+if [ -n "$1" ] ; then
+    "${test_dir}/scripts/run_tests" -l -s "$@" || exit 1
+else
+    cd "$test_dir"
+
+    # By default, run all unit tests and the tests against local
+    # daemons
+    dirs="onnode takeover tool eventscripts simple"
+
+    ./scripts/run_tests -l -s $dirs || exit 1
+fi
 
 echo "All OK"
 exit 0