summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-11-13 12:25:31 +1100
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2009-11-13 12:25:31 +1100
commit2861bbdd5ad0535b13d6cfec7a73b2780dbef0df (patch)
tree45073d11abd581e49210d8df8ec356f56c1492be
parent2a66b7dae4582e2c9b87c93e7304828de4653aa6 (diff)
parent386d23757b23bd383c22e9356e4eebe709c71b1e (diff)
Merge commit 'martins/master'
(This used to be ctdb commit b6bde176af69354ccfb00e6a3169f6b355a59d15)
-rwxr-xr-xctdb/tests/complex/31_nfs_tickle.sh7
-rwxr-xr-xctdb/tests/complex/32_cifs_tickle.sh9
-rw-r--r--ctdb/tests/scripts/ctdb_test_functions.bash4
3 files changed, 11 insertions, 9 deletions
diff --git a/ctdb/tests/complex/31_nfs_tickle.sh b/ctdb/tests/complex/31_nfs_tickle.sh
index b2c3964fed..eb6644b63f 100755
--- a/ctdb/tests/complex/31_nfs_tickle.sh
+++ b/ctdb/tests/complex/31_nfs_tickle.sh
@@ -52,6 +52,10 @@ cluster_is_healthy
# Reset configuration
ctdb_restart_when_done
+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
monitor_interval="${out#*= }"
@@ -71,8 +75,7 @@ wait_until_get_src_socket "tcp" "${test_ip}:${test_port}" $nc_pid "nc"
src_socket="$out"
echo "Source socket is $src_socket"
-echo "Sleeping for MonitorInterval..."
-sleep_for $monitor_interval
+wait_for_monitor_event $test_node
echo "Trying to determine NFS_TICKLE_SHARED_DIRECTORY..."
f="/etc/sysconfig/nfs"
diff --git a/ctdb/tests/complex/32_cifs_tickle.sh b/ctdb/tests/complex/32_cifs_tickle.sh
index 2280e81510..6f7d95b757 100755
--- a/ctdb/tests/complex/32_cifs_tickle.sh
+++ b/ctdb/tests/complex/32_cifs_tickle.sh
@@ -70,11 +70,10 @@ wait_until_get_src_socket "tcp" "${test_ip}:${test_port}" $nc_pid "nc"
src_socket="$out"
echo "Source socket is $src_socket"
-# Right here we assume that Samba is able to register the tickle with
-# CTDB faster than it takes us to wait for netstat to register the
-# connection and then use onnode below to ask CTDB about it.
-
-try_command_on_node -v 0 ctdb gettickles $test_ip -n $test_node
+# This should happen as soon as connection is up... but unless we wait
+# we sometimes beat the registration.
+echo "Checking if CIFS connection is tracked by CTDB..."
+wait_until 10 try_command_on_node 0 ctdb gettickles $test_ip -n $test_node
if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
echo "GOOD: CIFS connection tracked OK by CTDB."
diff --git a/ctdb/tests/scripts/ctdb_test_functions.bash b/ctdb/tests/scripts/ctdb_test_functions.bash
index e554680f0a..832a42bf16 100644
--- a/ctdb/tests/scripts/ctdb_test_functions.bash
+++ b/ctdb/tests/scripts/ctdb_test_functions.bash
@@ -297,8 +297,8 @@ wait_until ()
echo -n "<${timeout}|"
local t=$timeout
while [ $t -gt 0 ] ; do
- ("$@")
- local rc=$?
+ local rc=0
+ "$@" || rc=$?
if { ! $negate && [ $rc -eq 0 ] ; } || \
{ $negate && [ $rc -ne 0 ] ; } ; then
echo "|$(($timeout - $t))|"