diff options
| author | Martin Schwenke <martin@meltin.net> | 2009-11-13 09:44:34 +1100 |
|---|---|---|
| committer | Martin Schwenke <martin@meltin.net> | 2009-11-13 09:44:34 +1100 |
| commit | 386d23757b23bd383c22e9356e4eebe709c71b1e (patch) | |
| tree | 5ba7625c7b03926777782c2a9103b05b89aa6868 /ctdb/tests/complex | |
| parent | 9dabb86f3f5270a17882fa72be7d79cd23032d5e (diff) | |
| download | samba-386d23757b23bd383c22e9356e4eebe709c71b1e.tar.gz samba-386d23757b23bd383c22e9356e4eebe709c71b1e.tar.xz samba-386d23757b23bd383c22e9356e4eebe709c71b1e.zip | |
Test suite: Fix the NFS and CIFS tickle tests.
The NFS test sleeps for MonitorInterval to give CTDB time to record an
NFS tickle. However, this isn't always long enough. This changes the
test to wait until a monitor event has actually occurred.
The CIFS test assumes that Samba is able to register a tickle with
CTDB before it notices that netstat has registered the tickle and can
use onnode to ask CTDB about it. That is an incorrect assumption -
sometimes we can get to the point of asking CTDB about the tickle
before Samba and CTDB have processed it. This adds a timeout loop
that makes the CIFS test wait until the tickle has been registered or
fail after 10 seconds.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 20a9d35933d89dc7eb710075f360686a49d78609)
Diffstat (limited to 'ctdb/tests/complex')
| -rwxr-xr-x | ctdb/tests/complex/31_nfs_tickle.sh | 7 | ||||
| -rwxr-xr-x | ctdb/tests/complex/32_cifs_tickle.sh | 9 |
2 files changed, 9 insertions, 7 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." |
