summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-04-19 11:31:02 +1000
committerMartin Schwenke <martin@meltin.net>2012-04-27 15:40:43 +1000
commit21b219075173e4e365d2fce271c1f4ea315455bf (patch)
tree0a27f6f71d675e46b4fe9711c43f3d8037295ece
parent43f1209dc4484f456ccd47254955c0eb4d484383 (diff)
downloadsamba-21b219075173e4e365d2fce271c1f4ea315455bf.tar.gz
samba-21b219075173e4e365d2fce271c1f4ea315455bf.tar.xz
samba-21b219075173e4e365d2fce271c1f4ea315455bf.zip
tests: Remove ctdb_test_env
Move the contents to integration.bash and run_tests as appropriate. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 6136ab02db261b26a2a58b526c913e37e8146841)
-rwxr-xr-xctdb/tests/scripts/ctdb_test_env28
-rw-r--r--ctdb/tests/scripts/integration.bash18
-rwxr-xr-xctdb/tests/scripts/run_tests7
3 files changed, 20 insertions, 33 deletions
diff --git a/ctdb/tests/scripts/ctdb_test_env b/ctdb/tests/scripts/ctdb_test_env
deleted file mode 100755
index 2614d36207..0000000000
--- a/ctdb/tests/scripts/ctdb_test_env
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-export TEST_SCRIPTS_DIR=$(cd $(dirname $0) ; pwd)
-export CTDB_DIR=$(dirname $(dirname $TEST_SCRIPTS_DIR))
-var_dir=$CTDB_DIR/tests/var
-
-######################################################################
-
-PATH="${TEST_SCRIPTS_DIR}:${PATH}"
-
-export CTDB_TIMEOUT=60
-
-######################################################################
-
-if [ -n "$CTDB_TEST_REMOTE_DIR" ] ; then
- CTDB_TEST_WRAPPER="${CTDB_TEST_REMOTE_DIR}/test_wrap"
-else
- CTDB_TEST_WRAPPER="${TEST_SCRIPTS_DIR}/test_wrap"
-fi
-export CTDB_TEST_WRAPPER
-
-# If $VALGRIND is set then use it whenever ctdb is called, but only if
-# $CTDB is not already set.
-[ -n "$CTDB" ] || export CTDB="${VALGRIND}${VALGRIND:+ }ctdb"
-
-######################################################################
-
-"$@"
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index ae32e0b0f5..ea4ef5cf7e 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -19,6 +19,24 @@ fi
######################################################################
+export CTDB_TIMEOUT=60
+
+if [ -n "$CTDB_TEST_REMOTE_DIR" ] ; then
+ CTDB_TEST_WRAPPER="${CTDB_TEST_REMOTE_DIR}/test_wrap"
+else
+ CTDB_TEST_WRAPPER="${TEST_SCRIPTS_DIR}/test_wrap"
+fi
+export CTDB_TEST_WRAPPER
+
+# If $VALGRIND is set then use it whenever ctdb is called, but only if
+# $CTDB is not already set.
+[ -n "$CTDB" ] || export CTDB="${VALGRIND}${VALGRIND:+ }ctdb"
+
+# why???
+PATH="${TEST_SCRIPTS_DIR}:${PATH}"
+
+######################################################################
+
ctdb_check_time_logs ()
{
local threshold=20
diff --git a/ctdb/tests/scripts/run_tests b/ctdb/tests/scripts/run_tests
index 2fc6979961..f901ef2a7a 100755
--- a/ctdb/tests/scripts/run_tests
+++ b/ctdb/tests/scripts/run_tests
@@ -1,10 +1,5 @@
#!/bin/bash
-# The ability of ctdb_test_env to take tests on the command-line is
-# nice, but here we need to hack around it with that colon to reset
-# the arguments that it sees.
-. $(dirname $0)/ctdb_test_env :
-
usage() {
cat <<EOF
Usage: run_tests [OPTIONS] [TESTS]
@@ -148,6 +143,8 @@ run_one_test ()
[ -x "$_f" ] || die "test \"$_f\" is not executable"
tests_total=$(($tests_total + 1))
+ export TEST_SCRIPTS_DIR=$(dirname "$0")
+
ctdb_test_run "$_f" | tee "$tf" | show_progress
status=$?
if $with_summary ; then