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:
parent
c466ad47d5
commit
c607989d91
@ -15,8 +15,6 @@ Steps:
|
|||||||
2. Run 'ctdb getpid -n <number>' on the nodes to check the PID of the
|
2. Run 'ctdb getpid -n <number>' on the nodes to check the PID of the
|
||||||
ctdbd process.
|
ctdbd process.
|
||||||
3. Verify that the output is valid.
|
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:
|
Expected results:
|
||||||
|
|
||||||
@ -32,8 +30,6 @@ set -e
|
|||||||
|
|
||||||
cluster_is_healthy
|
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"
|
try_command_on_node 0 "$CTDB listnodes | wc -l"
|
||||||
num_nodes="$out"
|
num_nodes="$out"
|
||||||
echo "There are $num_nodes nodes..."
|
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"
|
try_command_on_node -v 0 "onnode -q all $CTDB getpid"
|
||||||
pids_onnode="$out"
|
pids_onnode="$out"
|
||||||
|
|
||||||
try_command_on_node -v 0 "$CTDB getpid -n all"
|
|
||||||
pids_getpid_all="$out"
|
|
||||||
|
|
||||||
cmd=""
|
cmd=""
|
||||||
n=0
|
n=0
|
||||||
while [ $n -lt $num_nodes ] ; do
|
while [ $n -lt $num_nodes ] ; do
|
||||||
@ -55,8 +48,7 @@ done
|
|||||||
try_command_on_node -v 0 "( $cmd )"
|
try_command_on_node -v 0 "( $cmd )"
|
||||||
pids_getpid_n="$out"
|
pids_getpid_n="$out"
|
||||||
|
|
||||||
if [ "$pids_onnode" = "$pids_getpid_all" -a \
|
if [ "$pids_onnode" = "$pids_getpid_n" ] ; then
|
||||||
"$pids_getpid_all" = "$pids_getpid_n" ] ; then
|
|
||||||
echo "They're the same... cool!"
|
echo "They're the same... cool!"
|
||||||
else
|
else
|
||||||
echo "Error: they differ."
|
echo "Error: they differ."
|
||||||
|
@ -13,8 +13,6 @@ Steps:
|
|||||||
|
|
||||||
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
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>'.
|
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:
|
Expected results:
|
||||||
|
|
||||||
@ -41,9 +39,6 @@ sanity_check_output \
|
|||||||
'^Node [[:digit:]]+ is at debug level [[:alpha:]]+ \([[:digit:]]+\)$' \
|
'^Node [[:digit:]]+ is at debug level [[:alpha:]]+ \([[:digit:]]+\)$' \
|
||||||
"$out"
|
"$out"
|
||||||
|
|
||||||
try_command_on_node -v 1 "$CTDB getdebug -n all"
|
|
||||||
getdebug_all="$out"
|
|
||||||
|
|
||||||
cmd=""
|
cmd=""
|
||||||
n=0
|
n=0
|
||||||
while [ $n -lt $num_nodes ] ; do
|
while [ $n -lt $num_nodes ] ; do
|
||||||
@ -53,8 +48,7 @@ done
|
|||||||
try_command_on_node -v 1 "$cmd"
|
try_command_on_node -v 1 "$cmd"
|
||||||
getdebug_n="$out"
|
getdebug_n="$out"
|
||||||
|
|
||||||
if [ "$getdebug_onnode" = "$getdebug_all" -a \
|
if [ "$getdebug_onnode" = "$getdebug_n" ] ; then
|
||||||
"$getdebug_all" = "$getdebug_n" ] ; then
|
|
||||||
echo "They're the same... cool!"
|
echo "They're the same... cool!"
|
||||||
else
|
else
|
||||||
echo "Error: they differ."
|
echo "Error: they differ."
|
||||||
@ -69,7 +63,7 @@ while read line ; do
|
|||||||
seps="${seps}${seps:+${nl}}|Name|Level|${nl}${t}"
|
seps="${seps}${seps:+${nl}}|Name|Level|${nl}${t}"
|
||||||
done <<<"$getdebug_onnode"
|
done <<<"$getdebug_onnode"
|
||||||
|
|
||||||
cmd="$CTDB -X getdebug -n all"
|
cmd="onnode -q all $CTDB -X getdebug"
|
||||||
echo "Checking that \"$cmd\" produces expected output..."
|
echo "Checking that \"$cmd\" produces expected output..."
|
||||||
|
|
||||||
try_command_on_node 1 "$cmd"
|
try_command_on_node 1 "$cmd"
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
test_info()
|
test_info()
|
||||||
@ -16,8 +17,6 @@ Steps:
|
|||||||
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
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
|
2. Run 'ctdb statistics' on a node, and verify that the output is
|
||||||
valid.
|
valid.
|
||||||
3. Repeat the command with the '-n all' option and verify that the
|
|
||||||
output is valid.
|
|
||||||
|
|
||||||
Expected results:
|
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"
|
try_command_on_node -v 1 "$CTDB statistics"
|
||||||
|
|
||||||
sanity_check_output 40 "$pattern" "$out"
|
sanity_check_output 40 "$pattern" "$out"
|
||||||
|
|
||||||
try_command_on_node -v 1 "$CTDB statistics -n all"
|
|
||||||
|
|
||||||
sanity_check_output 40 "$pattern" "$out"
|
|
||||||
|
@ -50,10 +50,10 @@ fi
|
|||||||
echo "Target node is ${to_node}"
|
echo "Target node is ${to_node}"
|
||||||
|
|
||||||
echo "Turning off DeterministicIPs..."
|
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..."
|
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}"
|
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
|
try_command_on_node $test_node $CTDB moveip $test_ip $to_node
|
||||||
|
@ -13,8 +13,6 @@ Steps:
|
|||||||
|
|
||||||
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
1. Verify that the status on all of the ctdb nodes is 'OK'.
|
||||||
2. Run 'ctdb dumpmemory' and verify that it shows expected output
|
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:
|
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\))$'
|
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"
|
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
|
|
||||||
|
@ -43,7 +43,7 @@ wait_until_generation_has_changed ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Check that recovery lock is set the same on all nodes..."
|
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)
|
n=$(echo "$out" | sort -u | wc -l)
|
||||||
if [ "$n" = 1 ] ; then
|
if [ "$n" = 1 ] ; then
|
||||||
echo "GOOD: All nodes have the same recovery lock setting"
|
echo "GOOD: All nodes have the same recovery lock setting"
|
||||||
@ -68,8 +68,8 @@ echo "Remember original recovery lock file: \"${orig_reclock}\""
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Unset and test the recovery lock on all nodes..."
|
echo "Unset and test the recovery lock on all nodes..."
|
||||||
try_command_on_node any $CTDB -n all setreclock
|
try_command_on_node -q all $CTDB setreclock
|
||||||
try_command_on_node -v any $CTDB -n all getreclock
|
try_command_on_node -v -q all $CTDB getreclock
|
||||||
t=$(sort -u <<<"$out")
|
t=$(sort -u <<<"$out")
|
||||||
if [ "$t" = "No reclock file used." ] ; then
|
if [ "$t" = "No reclock file used." ] ; then
|
||||||
echo "GOOD: Recovery lock unset on all nodes"
|
echo "GOOD: Recovery lock unset on all nodes"
|
||||||
@ -85,14 +85,14 @@ echo "Current generation is ${generation}"
|
|||||||
alt="${orig_reclock}.test"
|
alt="${orig_reclock}.test"
|
||||||
echo
|
echo
|
||||||
echo "Set alternative recovery lock (${alt}) and test on all nodes..."
|
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 -q all $CTDB setreclock "$alt"
|
||||||
try_command_on_node -v any $CTDB -n all getreclock
|
try_command_on_node -v -q all $CTDB getreclock
|
||||||
t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
|
t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
|
||||||
if [ "$t" = "$alt" ] ; then
|
if [ "$t" = "$alt" ] ; then
|
||||||
echo "GOOD: Recovery lock set on all nodes"
|
echo "GOOD: Recovery lock set on all nodes"
|
||||||
else
|
else
|
||||||
echo "BAD: Recovery lock not set on all nodes"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -102,9 +102,9 @@ echo "Current generation is ${generation}"
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Restore and test the recovery lock on all nodes..."
|
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 -q all $CTDB setreclock "$orig_reclock"
|
||||||
try_command_on_node -v any rm -v "$alt"
|
try_command_on_node -v all rm -vf "$alt"
|
||||||
try_command_on_node -v any $CTDB -n all getreclock
|
try_command_on_node -v -q all $CTDB getreclock
|
||||||
t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
|
t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
|
||||||
if [ "$t" = "$orig_reclock" ] ; then
|
if [ "$t" = "$orig_reclock" ] ; then
|
||||||
echo "GOOD: Recovery lock restored on all nodes"
|
echo "GOOD: Recovery lock restored on all nodes"
|
||||||
|
@ -22,7 +22,7 @@ export CTDB_NODES="${TEST_VAR_DIR}/nodes.txt"
|
|||||||
daemons_stop ()
|
daemons_stop ()
|
||||||
{
|
{
|
||||||
echo "Attempting to politely shutdown daemons..."
|
echo "Attempting to politely shutdown daemons..."
|
||||||
onnode 1 $CTDB shutdown -n all || true
|
onnode -q all $CTDB shutdown || true
|
||||||
|
|
||||||
echo "Sleeping for a while..."
|
echo "Sleeping for a while..."
|
||||||
sleep_for 1
|
sleep_for 1
|
||||||
|
Loading…
Reference in New Issue
Block a user