Test suite: Make NFS tickle test more flexible.
authorMartin Schwenke <martin@meltin.net>
Fri, 27 Aug 2010 01:43:50 +0000 (11:43 +1000)
committerMartin Schwenke <martin@meltin.net>
Fri, 27 Aug 2010 01:43:50 +0000 (11:43 +1000)
Use onnode any where possible rather than a fixed node.

Signed-off-by: Martin Schwenke <martin@meltin.net>
tests/complex/31_nfs_tickle.sh

index e1b12267a23c1ea3de21a0ba54eeab461527f9c6..030e34fe0231ca132989279b653e20dcca18a2d9 100755 (executable)
@@ -57,7 +57,7 @@ ctdb_test_exit_hook_add ctdb_test_eventscript_uninstall
 ctdb_test_eventscript_install
 
 # We need this for later, so we know how long to sleep.
-try_command_on_node 0 $CTDB getvar MonitorInterval
+try_command_on_node any $CTDB getvar MonitorInterval
 monitor_interval="${out#*= }"
 #echo "Monitor interval on node $test_node is $monitor_interval seconds."
 
@@ -81,20 +81,20 @@ echo "Sleeping until tickles are synchronised across nodes..."
 try_command_on_node $test_node $CTDB getvar TickleUpdateInterval
 sleep_for "${out#*= }"
 
-if try_command_on_node 0 "test -r /etc/ctdb/events.d/61.nfstickle" ; then
+if try_command_on_node any "test -r /etc/ctdb/events.d/61.nfstickle" ; then
     echo "Trying to determine NFS_TICKLE_SHARED_DIRECTORY..."
     f="/etc/sysconfig/nfs"
-    try_command_on_node -v 0 "[ -r $f ] &&  sed -n -e s@^NFS_TICKLE_SHARED_DIRECTORY=@@p $f" || true
+    try_command_on_node -v any "[ -r $f ] &&  sed -n -e s@^NFS_TICKLE_SHARED_DIRECTORY=@@p $f" || true
 
     nfs_tickle_shared_directory="${out:-/gpfs/.ctdb/nfs-tickles}"
 
     try_command_on_node $test_node hostname
     test_hostname=$out
 
-    try_command_on_node -v 0 cat "${nfs_tickle_shared_directory}/$test_hostname/$test_ip"
+    try_command_on_node -v any cat "${nfs_tickle_shared_directory}/$test_hostname/$test_ip"
 else
     echo "That's OK, we'll use \"ctdb gettickles\", which is newer..."
-    try_command_on_node -v 0 "ctdb -Y gettickles $test_ip $test_port"
+    try_command_on_node -v any "ctdb -Y gettickles $test_ip $test_port"
 fi
 
 if [ "${out/${src_socket}/}" != "$out" ] ; then