summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/onnode
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-04-20 16:43:17 +1000
committerMartin Schwenke <martin@meltin.net>2012-04-27 15:40:43 +1000
commit6757ad62f4cda14066789989fb002cee7c009cde (patch)
tree2ff3b399f75896761dfb5f4b8be7f0d03dfc6fb8 /ctdb/tests/onnode
parent6764b7b33e0a8f61b51bb4c666205147744917c7 (diff)
downloadsamba-6757ad62f4cda14066789989fb002cee7c009cde.tar.gz
samba-6757ad62f4cda14066789989fb002cee7c009cde.tar.xz
samba-6757ad62f4cda14066789989fb002cee7c009cde.zip
tests: Make run_tests -X more flexible - it now works with onnode
Hardcoding "sh -x" is suboptimal because some scripts, like onnode, require bash. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 246809af64c03d26288abff5907ed46614e72b15)
Diffstat (limited to 'ctdb/tests/onnode')
-rw-r--r--ctdb/tests/onnode/README14
-rw-r--r--ctdb/tests/onnode/scripts/local.sh7
2 files changed, 12 insertions, 9 deletions
diff --git a/ctdb/tests/onnode/README b/ctdb/tests/onnode/README
index 162faae021..5bb69524df 100644
--- a/ctdb/tests/onnode/README
+++ b/ctdb/tests/onnode/README
@@ -26,13 +26,11 @@ Examples:
Run only the specified tests.
-* ONNODE="bash -x stubs/onnode-buggy-001" ../run_tests.sh ./0090.sh
- ONNODE="bash -x ../../tools/onnode" ../run_tests.sh ./0090.sh
+* ONNODE="stubs/onnode-buggy-001" ../run_tests.sh -X ./0090.sh
+ ../run_tests.sh -X ./0090.sh
- Debug the specified test or test failure. The test will fail
- because the bash trace output will be included in the test output.
- However, this at least makes it easy to trace onnode while running
- the test...
+ Debug the specified test or test failure by tracing onnode with
+ "bash -x". The test will fail because the bash trace output will be
+ included in the test output.
- To see if the test pases, the -x can be dropped... so command-line
- editing can be kept to a minimum.
+ To see if the test pases, the -X can be dropped...
diff --git a/ctdb/tests/onnode/scripts/local.sh b/ctdb/tests/onnode/scripts/local.sh
index d6dd41c293..35fd013540 100644
--- a/ctdb/tests/onnode/scripts/local.sh
+++ b/ctdb/tests/onnode/scripts/local.sh
@@ -67,7 +67,12 @@ simple_test ()
_sort="sort"
fi
- _out=$("$@" 2>&1)
+ if $TEST_COMMAND_TRACE ; then
+ _onnode=$(which "$1") ; shift
+ _out=$(bash -x "$_onnode" "$@" 2>&1)
+ else
+ _out=$("$@" 2>&1)
+ fi
_rc=$?
_out=$(echo "$_out" | $_sort )