1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

ctdb-tests: Drop simple uses of "ctdb -n all ..." from simple tests

None of these uses of -n are particularly useful.  "-n all" will be
deprecated.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2015-10-19 16:05:44 +11:00 committed by Amitay Isaacs
parent c466ad47d5
commit c607989d91
7 changed files with 16 additions and 52 deletions

View File

@ -15,8 +15,6 @@ Steps:
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:
@ -32,8 +30,6 @@ set -e
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..."
@ -43,9 +39,6 @@ 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
@ -55,8 +48,7 @@ done
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."

View File

@ -13,8 +13,6 @@ Steps:
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:
@ -41,9 +39,6 @@ sanity_check_output \
'^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
@ -53,8 +48,7 @@ done
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."
@ -69,7 +63,7 @@ while read line ; do
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"

View File

@ -1,3 +1,4 @@
#!/bin/bash
test_info()
@ -16,8 +17,6 @@ Steps:
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:
@ -38,7 +37,3 @@ pattern='^(CTDB version 1|Current time of statistics[[:space:]]*:.*|Statistics c
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"

View File

@ -50,10 +50,10 @@ fi
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

View File

@ -13,8 +13,6 @@ Steps:
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:
@ -35,18 +33,3 @@ try_command_on_node -v 0 "$CTDB dumpmemory"
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

View File

@ -43,7 +43,7 @@ wait_until_generation_has_changed ()
}
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"
@ -68,8 +68,8 @@ echo "Remember original recovery lock file: \"${orig_reclock}\""
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"
@ -85,14 +85,14 @@ echo "Current generation is ${generation}"
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
@ -102,9 +102,9 @@ echo "Current generation is ${generation}"
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"

View File

@ -22,7 +22,7 @@ export CTDB_NODES="${TEST_VAR_DIR}/nodes.txt"
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