Merge remote branch 'martins/tests'
[sahlberg/ctdb.git] / tests / takeover / run_tests.sh
diff --git a/tests/takeover/run_tests.sh b/tests/takeover/run_tests.sh
new file mode 100755 (executable)
index 0000000..f019e8f
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Run some IP allocation unit tests.
+
+cd $(dirname "$0")
+export TAKEOVER_TESTS_DIR=$(pwd)
+
+test_dir=$(dirname "$TAKEOVER_TESTS_DIR")
+
+opts="-d"
+
+for i ; do
+    case "$i" in
+       -*)
+           opts="$opts $i"
+           shift
+           ;;
+       *)
+           break
+    esac
+done
+
+tests=""
+if [ -z "$*" ] ; then
+    tests=$(ls testcases/*.[0-9][0-9][0-9].sh 2>/dev/null)
+fi
+
+"$test_dir/scripts/run_tests" $opts "$@" $tests || exit 1
+
+echo "All OK"
+exit 0