6 Verify that 'ctdb setdebug' works as expected.
8 This is a little superficial. It checks that CTDB thinks the debug
9 level has been changed but doesn't actually check that logging occurs
12 A test should also be added to see if setting the debug value via a
13 numerical value works too.
17 * An active CTDB cluster with at least 2 active nodes.
21 1. Verify that the status on all of the ctdb nodes is 'OK'.
22 2. Get the current debug level on a node, using 'ctdb getdebug'.
23 3. Change the debug level to some other value (e.g. EMERG) using
25 4. Verify that the new debug level is correctly set using 'ctdb getdebug'.
29 * 'ctdb setdebug' correctly sets the debug level on a node.
33 . ctdb_test_functions.bash
48 try_command_on_node -v $node "$CTDB getdebug"
49 check_debug=$(echo "$out" |
50 sed -r -e 's@Node [[:digit:]]+ is at debug level ([[:alpha:]]+) \(-?[[:digit:]]+\)$@\1@')
53 set_and_check_debug ()
58 echo "Setting debug level on node ${node} to ${level}."
59 try_command_on_node $node "$CTDB setdebug ${level}"
64 if [ "$level" = "$check_debug" ] ; then
65 echo "That seemed to work... cool!"
67 echo "BAD: Debug level should have changed to \"$level\" but it is \"$check_debug\"."
73 initial_debug="$check_debug"
76 [ "$initial_debug" = "$new_debug" ] && new_debug="ALERT"
78 set_and_check_debug 1 "$new_debug"
80 if [ "$testfailures" != 1 ] ; then
81 echo "Returning the debug level to its initial value..."
82 set_and_check_debug 1 "$initial_debug"