Test suite: Make the CIFS tickle test wait until it sees the required tickle.
authorMartin Schwenke <martin@meltin.net>
Thu, 19 Nov 2009 03:54:05 +0000 (14:54 +1100)
committerMartin Schwenke <martin@meltin.net>
Thu, 19 Nov 2009 03:54:05 +0000 (14:54 +1100)
The test depended on the exit code of "ctdb gettickles", which always
succeeds.  This change wraps the command in a function that checks
whether the tickle we're interested in is registered.

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

index 6f7d95b7572569f87f7ce64f1cc292154ba751d2..3a7738196074e93eb655d86b409aaf166cd712a8 100755 (executable)
@@ -72,8 +72,16 @@ echo "Source socket is $src_socket"
 
 # This should happen as soon as connection is up... but unless we wait
 # we sometimes beat the registration.
+check_tickles ()
+{
+    try_command_on_node 0 ctdb gettickles $test_ip -n $test_node
+    # SRC: 10.0.2.45:49091   DST: 10.0.2.143:445
+    [ "${out/SRC: ${src_socket} /}" != "$out" ]
+}
+
 echo "Checking if CIFS connection is tracked by CTDB..."
-wait_until 10 try_command_on_node 0 ctdb gettickles $test_ip -n $test_node
+wait_until 10 check_tickles
+echo "$out"
 
 if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
     echo "GOOD: CIFS connection tracked OK by CTDB."