6 Verify that 'ctdb getdebug' works as expected.
10 * An active CTDB cluster with at least 2 active nodes.
14 1. Verify that the status on all of the ctdb nodes is 'OK'.
15 2. Get the current debug level on a node, using 'ctdb getdebug -n <node>'.
16 3. Verify that colon-separated output is generated with the -Y option.
17 4. Verify that the '-n all' option shows the debug level on all nodes.
21 * 'ctdb getdebug' shows the debug level on all the nodes.
25 . ctdb_test_functions.bash
33 try_command_on_node 0 "$CTDB listnodes | wc -l"
36 try_command_on_node -v 1 "onnode -q all $CTDB getdebug"
37 getdebug_onnode="$out"
41 '^Node [[:digit:]]+ is at debug level [[:alpha:]]+ \([[:digit:]]+\)$' \
44 try_command_on_node -v 1 "$CTDB getdebug -n all"
49 while [ $n -lt $num_nodes ] ; do
50 cmd="${cmd}${cmd:+; }$CTDB getdebug -n $n"
53 try_command_on_node -v 1 "$cmd"
56 if [ "$getdebug_onnode" = "$getdebug_all" -a \
57 "$getdebug_all" = "$getdebug_n" ] ; then
58 echo "They're the same... cool!"
60 echo "Error: they differ."
68 t=$(echo "$line" | sed -r -e 's@Node [[:digit:]]+ is at debug level ([[:alpha:]]+) \((-?[[:digit:]]+)\)$@:\1:\2:@')
69 colons="${colons}${colons:+${nl}}:Name:Level:${nl}${t}"
70 done <<<"$getdebug_onnode"
72 cmd="$CTDB -Y getdebug -n all"
73 echo "Checking that \"$cmd\" produces expected output..."
75 try_command_on_node 1 "$cmd"
76 if [ "$out" = "$colons" ] ; then
77 echo "Yep, looks good!"
79 echo "Nope, it looks like this:"