Bug fixes for tests: simple/12_ctdb_getdebug.sh and scripts/test_wrap.
authorMartin Schwenke <martin@meltin.net>
Fri, 1 May 2009 07:40:45 +0000 (17:40 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 12 May 2009 04:44:30 +0000 (14:44 +1000)
simple/12_ctdb_getdebug.sh now recognises output with multi-digit node
numbers.

Sharing the ctdb directory via NFS and testing on a real cluster by
setting CTDB_TEST_REAL_CLUSTER didn't work by default.  The fix is to
hack scripts/test_wrap so that it tries to find a valid bin directory
next to the directory containing it is in.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/scripts/test_wrap
tests/simple/12_ctdb_getdebug.sh

index 35ad41830f319fdcfa49e8993df4244e2260bd46..6c730ef7686ded4b6fcc2691023e2155d1b6e249 100755 (executable)
@@ -5,6 +5,12 @@
 
 PATH="$(dirname $0):${PATH}"
 
+f="ctdb_bench"
+if [ ! $(which $f >/dev/null 2>&1) ] ; then
+    d=$(dirname $(dirname $0))/bin
+    [ -x "$d/$f" ] && PATH="$d:$PATH"
+fi
+
 . ctdb_test_functions.bash
 
 "$@"
index 2f4eefdff67050572104e10db16dd2e0be388a3f..5c74bc82af0c1e6fdd11f539646054be48d54993 100755 (executable)
@@ -38,7 +38,7 @@ getdebug_onnode="$out"
 
 sanity_check_output \
     $num_nodes \
-    '^Node [[:digit:]] is at debug level [[:alpha:]]+ \([[:digit:]]\)$' \
+    '^Node [[:digit:]]+ is at debug level [[:alpha:]]+ \([[:digit:]]\)$' \
     "$out"
 
 try_command_on_node -v 1 "$CTDB getdebug -n all"
@@ -65,7 +65,7 @@ colons=""
 nl="
 "
 while read line ; do
-    t=$(echo "$line" | sed -r -e 's@Node [[:digit:]] is at debug level ([[:alpha:]]+) \((-?[[:digit:]])\)$@:\1:\2:@')
+    t=$(echo "$line" | sed -r -e 's@Node [[:digit:]]+ is at debug level ([[:alpha:]]+) \((-?[[:digit:]])\)$@:\1:\2:@')
     colons="${colons}${colons:+${nl}}:Name:Level:${nl}${t}"
 done <<<"$getdebug_onnode"