2. Run 'ctdb getpid -n <number>' on the nodes to check the PID of the
ctdbd process.
3. Verify that the output is valid.
-4. Verify that with the '-n all' option the command shows the PIDs on
- all the nodes
Expected results:
cluster_is_healthy
-# This is an attempt at being independent of the number of nodes
-# reported by "ctdb getpid -n all".
try_command_on_node 0 "$CTDB listnodes | wc -l"
num_nodes="$out"
echo "There are $num_nodes nodes..."
try_command_on_node -v 0 "onnode -q all $CTDB getpid"
pids_onnode="$out"
-try_command_on_node -v 0 "$CTDB getpid -n all"
-pids_getpid_all="$out"
-
cmd=""
n=0
while [ $n -lt $num_nodes ] ; do
try_command_on_node -v 0 "( $cmd )"
pids_getpid_n="$out"
-if [ "$pids_onnode" = "$pids_getpid_all" -a \
- "$pids_getpid_all" = "$pids_getpid_n" ] ; then
+if [ "$pids_onnode" = "$pids_getpid_n" ] ; then
echo "They're the same... cool!"
else
echo "Error: they differ."
1. Verify that the status on all of the ctdb nodes is 'OK'.
2. Get the current debug level on a node, using 'ctdb getdebug -n <node>'.
-3. Verify that pipe-separated output is generated with the -X option.
-4. Verify that the '-n all' option shows the debug level on all nodes.
Expected results:
'^Node [[:digit:]]+ is at debug level [[:alpha:]]+ \([[:digit:]]+\)$' \
"$out"
-try_command_on_node -v 1 "$CTDB getdebug -n all"
-getdebug_all="$out"
-
cmd=""
n=0
while [ $n -lt $num_nodes ] ; do
try_command_on_node -v 1 "$cmd"
getdebug_n="$out"
-if [ "$getdebug_onnode" = "$getdebug_all" -a \
- "$getdebug_all" = "$getdebug_n" ] ; then
+if [ "$getdebug_onnode" = "$getdebug_n" ] ; then
echo "They're the same... cool!"
else
echo "Error: they differ."
seps="${seps}${seps:+${nl}}|Name|Level|${nl}${t}"
done <<<"$getdebug_onnode"
-cmd="$CTDB -X getdebug -n all"
+cmd="onnode -q all $CTDB -X getdebug"
echo "Checking that \"$cmd\" produces expected output..."
try_command_on_node 1 "$cmd"
+
#!/bin/bash
test_info()
1. Verify that the status on all of the ctdb nodes is 'OK'.
2. Run 'ctdb statistics' on a node, and verify that the output is
valid.
-3. Repeat the command with the '-n all' option and verify that the
- output is valid.
Expected results:
try_command_on_node -v 1 "$CTDB statistics"
sanity_check_output 40 "$pattern" "$out"
-
-try_command_on_node -v 1 "$CTDB statistics -n all"
-
-sanity_check_output 40 "$pattern" "$out"
echo "Target node is ${to_node}"
echo "Turning off DeterministicIPs..."
-try_command_on_node 0 $CTDB setvar DeterministicIPs 0 -n all
+try_command_on_node -q all $CTDB setvar DeterministicIPs 0
echo "Turning on NoIPFailback..."
-try_command_on_node 0 $CTDB setvar NoIPFailback 1 -n all
+try_command_on_node -q all $CTDB setvar NoIPFailback 1
echo "Attempting to move ${test_ip} from node ${test_node} to node ${to_node}"
try_command_on_node $test_node $CTDB moveip $test_ip $to_node
1. Verify that the status on all of the ctdb nodes is 'OK'.
2. Run 'ctdb dumpmemory' and verify that it shows expected output
-3. Verify that the command takes the '-n all' option and that it
- causes output for all nodes to be displayed.
Expected results:
pat='^([[:space:]].+[[:space:]]+contains[[:space:]]+[[:digit:]]+ bytes in[[:space:]]+[[:digit:]]+ blocks \(ref [[:digit:]]+\)[[:space:]]+0x[[:xdigit:]]+|[[:space:]]+reference to: .+|full talloc report on .+ \(total[[:space:]]+[[:digit:]]+ bytes in [[:digit:]]+ blocks\))$'
sanity_check_output 10 "$pat" "$out"
-
-echo "Checking output using '-n all'..."
-
-try_command_on_node 0 "$CTDB listnodes"
-num_nodes=$(echo "$out" | wc -l)
-
-try_command_on_node 0 "$CTDB dumpmemory" -n all
-sanity_check_output 10 "$pat" "$out"
-
-if [ $(fgrep -c 'full talloc report on' <<<"$out") -eq $num_nodes ] ; then
- echo "OK: there looks to be output for all $num_nodes nodes"
-else
- echo "BAD: there not look to be output for all $num_nodes nodes"
- exit 1
-fi
}
echo "Check that recovery lock is set the same on all nodes..."
-try_command_on_node -v any $CTDB -n all getreclock
+try_command_on_node -v -q all $CTDB getreclock
n=$(echo "$out" | sort -u | wc -l)
if [ "$n" = 1 ] ; then
echo "GOOD: All nodes have the same recovery lock setting"
echo
echo "Unset and test the recovery lock on all nodes..."
-try_command_on_node any $CTDB -n all setreclock
-try_command_on_node -v any $CTDB -n all getreclock
+try_command_on_node -q all $CTDB setreclock
+try_command_on_node -v -q all $CTDB getreclock
t=$(sort -u <<<"$out")
if [ "$t" = "No reclock file used." ] ; then
echo "GOOD: Recovery lock unset on all nodes"
alt="${orig_reclock}.test"
echo
echo "Set alternative recovery lock (${alt}) and test on all nodes..."
-try_command_on_node any $CTDB -n all setreclock "$alt"
-try_command_on_node -v any $CTDB -n all getreclock
+try_command_on_node -q all $CTDB setreclock "$alt"
+try_command_on_node -v -q all $CTDB getreclock
t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
if [ "$t" = "$alt" ] ; then
echo "GOOD: Recovery lock set on all nodes"
else
echo "BAD: Recovery lock not set on all nodes"
- try_command_on_node -v any rm -v "$alt" || true
+ try_command_on_node -vf all rm -v "$alt" || true
exit 1
fi
echo
echo "Restore and test the recovery lock on all nodes..."
-try_command_on_node any $CTDB -n all setreclock "$orig_reclock"
-try_command_on_node -v any rm -v "$alt"
-try_command_on_node -v any $CTDB -n all getreclock
+try_command_on_node -q all $CTDB setreclock "$orig_reclock"
+try_command_on_node -v all rm -vf "$alt"
+try_command_on_node -v -q all $CTDB getreclock
t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
if [ "$t" = "$orig_reclock" ] ; then
echo "GOOD: Recovery lock restored on all nodes"
daemons_stop ()
{
echo "Attempting to politely shutdown daemons..."
- onnode 1 $CTDB shutdown -n all || true
+ onnode -q all $CTDB shutdown || true
echo "Sleeping for a while..."
sleep_for 1