ctdb-tests: Drop simple uses of "ctdb -n all ..." from simple tests
authorMartin Schwenke <martin@meltin.net>
Mon, 19 Oct 2015 05:05:44 +0000 (16:05 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 23 Oct 2015 01:43:26 +0000 (03:43 +0200)
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>
ctdb/tests/simple/06_ctdb_getpid.sh
ctdb/tests/simple/12_ctdb_getdebug.sh
ctdb/tests/simple/14_ctdb_statistics.sh
ctdb/tests/simple/23_ctdb_moveip.sh
ctdb/tests/simple/25_dumpmemory.sh
ctdb/tests/simple/35_set_recmaster.sh
ctdb/tests/simple/scripts/local_daemons.bash

index 7152ad41710497ba1a0fbc9400fc80fe5f70abf1..30137343140571d89095e613503ec44e806a960f 100755 (executable)
@@ -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."
index cdd9e342e72649c77b0ec36fdba3d4957d843732..39028ac8e3bbcf693e76cea4b0e0449bbad791a6 100755 (executable)
@@ -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"
index 9cc5ac15cc9b44899ffd87f4a95ddc949010cd53..3dd55e05cd3213445a06814fcd163c4c0876ad05 100755 (executable)
@@ -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"
index f6e90272b2a7201d688a03b795bdddcc4fc89ce5..f92d7f78ee63e3e02b0a82cf0e17a9c7df177a09 100755 (executable)
@@ -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
index 4082da1d130263f3cf9e30c154e0920e447f4589..4d6cc83d5ee3b49f4dbc37daa5b92a3f44d030e9 100755 (executable)
@@ -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    
index 7c745e4dcfdde2294657876465e705ec529789b7..fe788094d56afc1a1835f4fa34ff82ce237f0ea2 100755 (executable)
@@ -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"
index 5071b1e784cc2ae403d6715a56b205c174352026..92ec3910fdbcf69454215588648ecfdae4905723 100644 (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