]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Fix CIFS tickle test
authorMartin Schwenke <martin@meltin.net>
Mon, 7 Mar 2016 22:59:33 +0000 (09:59 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 10 Mar 2016 02:34:18 +0000 (03:34 +0100)
There's a tiny chance that the connection information may not be
transferred to other nodes quickly enough, so add an explicit wait.
Also clean up the description and recognise that it is the takeover
node that does the tickling.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/complex/32_cifs_tickle.sh

index 70ce93ff4b91e8351cd2bf8b5f1e56dc4a050f0d..da369b9f5f72704501fdb92e4c1d22c2d07a6234 100755 (executable)
@@ -7,7 +7,8 @@ Verify that CIFS connections are monitored and that CIFS tickles are sent.
 
 We create a connection to the CIFS server on a node and confirm that
 this connection is registered by CTDB.  Then disable the relevant CIFS
-server node and ensure that it send an appropriate reset packet.
+server node and ensure that the takeover node sends an appropriate
+reset packet.
 
 Prerequisites:
 
@@ -20,21 +21,10 @@ Prerequisites:
 
 * Clustered Samba must be listening on TCP port 445.
 
-Steps:
-
-1. Verify that the cluster is healthy.
-2. Connect from the current host (test client) to TCP port 445 using
-   the public address of a cluster node.
-3. Determine the source socket used for the connection.
-4. Using the "ctdb gettickle" command, ensure that CTDB records the
-   connection details.
-5. Disable the node that the connection has been made to.
-6. Verify that a TCP tickle (a reset packet) is sent to the test client.
-
 Expected results:
 
-* CTDB should correctly record the connection and should send a reset
-  packet when the node is disabled.
+* CTDB should correctly record the connection and the takeover node
+  should send a reset packet.
 EOF
 }
 
@@ -72,7 +62,7 @@ echo "Source socket is $src_socket"
 
 # 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..."
+echo "Checking if CIFS connection is tracked by CTDB on test node..."
 wait_until 10 check_tickles $test_node $test_ip $test_port $src_socket
 echo "$out"
 
@@ -83,11 +73,15 @@ else
     testfailures=1
 fi
 
+# This is almost immediate.  However, it is sent between nodes
+# asynchonously, so it is worth checking...
+echo "Wait until CIFS connection is tracked by CTDB on all nodes..."
+try_command_on_node $test_node "$CTDB listnodes | wc -l"
+numnodes="$out"
+wait_until 5 \
+    check_tickles_all $numnodes  $test_ip $test_port $src_socket
 tcptickle_sniff_start $src_socket "${test_ip}:${test_port}"
 
-# The test node is only being disabled so the tickling is done from
-# the test node.  We don't need to wait until the tickles are
-# transferred to another node.
 echo "Disabling node $test_node"
 try_command_on_node 1 $CTDB disable -n $test_node
 wait_until_node_has_status $test_node disabled