summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2015-07-06 18:15:31 +1000
committerMartin Schwenke <martins@samba.org>2015-07-09 06:23:21 +0200
commit17b77a99aea17e324337a2e92ffd3980888861c8 (patch)
treecbe90a438b20e121c1598928eaf1f5318b0b5147 /ctdb
parentaa9ca809bebb17136e05817bc4c89c208424f52f (diff)
downloadsamba-17b77a99aea17e324337a2e92ffd3980888861c8.tar.gz
ctdb-tests: Refactor code using simple test harness functions
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh20
-rw-r--r--ctdb/tests/takeover/scripts/local.sh4
-rw-r--r--ctdb/tests/tool/scripts/local.sh4
3 files changed, 4 insertions, 24 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index 3b16fb94b19..ae313a75607 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -1119,15 +1119,7 @@ ip command is "$(which ip)"
EOF
}
- _shell=""
- if $TEST_COMMAND_TRACE ; then
- _shell="sh -x"
- else
- _shell="sh"
- fi
- _out=$($_shell "${script_dir}/${script}" "$event" "$@" 2>&1)
-
- result_check
+ script_test "${script_dir}/${script}" "$event" "$@"
reset_test_header
reset_extra_header
@@ -1146,15 +1138,7 @@ simple_test_event ()
simple_test_command ()
{
- # If something has previously failed then don't continue.
- : ${_passed:=true}
- $_passed || return 1
-
- echo "=================================================="
- echo "Running command \"$*\""
- _out=$("$@" 2>&1)
-
- result_check
+ unit_test "$@"
}
# Run an eventscript iteratively.
diff --git a/ctdb/tests/takeover/scripts/local.sh b/ctdb/tests/takeover/scripts/local.sh
index c5f3f4d5baf..a84f58bcbf1 100644
--- a/ctdb/tests/takeover/scripts/local.sh
+++ b/ctdb/tests/takeover/scripts/local.sh
@@ -26,7 +26,5 @@ EOF
simple_test ()
{
- _out=$($VALGRIND $test_prog "$@" 2>&1)
-
- result_check
+ unit_test $test_prog "$@"
}
diff --git a/ctdb/tests/tool/scripts/local.sh b/ctdb/tests/tool/scripts/local.sh
index 6cdf4c5089f..737cb716278 100644
--- a/ctdb/tests/tool/scripts/local.sh
+++ b/ctdb/tests/tool/scripts/local.sh
@@ -71,7 +71,5 @@ simple_test ()
: ${CTDB_DEBUGLEVEL:=3}
export CTDB_DEBUGLEVEL
- _out=$($VALGRIND $test_prog "$@" 2>&1)
-
- result_check
+ unit_test $test_prog "$@"
}