6 Verify that CIFS connections are monitored and that CIFS tickles are sent.
8 We create a connection to the CIFS server on a node and confirm that
9 this connection is registered by CTDB. Then disable the relevant CIFS
10 server node and ensure that the takeover node sends an appropriate
15 * An active CTDB cluster with at least 2 nodes with public addresses.
17 * Test must be run on a real or virtual cluster rather than against
20 * Test must not be run from a cluster node.
22 * Clustered Samba must be listening on TCP port 445.
26 * CTDB should correctly record the connection and the takeover node
27 should send a reset packet.
31 .
"${TEST_SCRIPTS_DIR}/integration.bash"
37 ctdb_test_check_real_cluster
42 ctdb_restart_when_done
44 # We need this for later, so we know how long to sleep.
45 try_command_on_node
0 $CTDB getvar MonitorInterval
46 monitor_interval
="${out#*= }"
47 #echo "Monitor interval on node $test_node is $monitor_interval seconds."
49 select_test_node_and_ips
53 echo "Connecting to node ${test_node} on IP ${test_ip}:${test_port} with netcat..."
55 nc
-d -w $
(($monitor_interval * 4)) $test_ip $test_port &
57 ctdb_test_exit_hook_add
"kill $nc_pid >/dev/null 2>&1"
59 wait_until_get_src_socket
"tcp" "${test_ip}:${test_port}" $nc_pid "nc"
61 echo "Source socket is $src_socket"
63 # This should happen as soon as connection is up... but unless we wait
64 # we sometimes beat the registration.
65 echo "Checking if CIFS connection is tracked by CTDB on test node..."
66 wait_until
10 check_tickles
$test_node $test_ip $test_port $src_socket
69 if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
70 echo "GOOD: CIFS connection tracked OK by CTDB."
72 echo "BAD: Socket not tracked by CTDB."
76 # This is almost immediate. However, it is sent between nodes
77 # asynchonously, so it is worth checking...
78 echo "Wait until CIFS connection is tracked by CTDB on all nodes..."
79 try_command_on_node
$test_node "$CTDB listnodes | wc -l"
82 check_tickles_all
$numnodes $test_ip $test_port $src_socket
83 tcptickle_sniff_start
$src_socket "${test_ip}:${test_port}"
85 echo "Disabling node $test_node"
86 try_command_on_node
1 $CTDB disable
-n $test_node
87 wait_until_node_has_status
$test_node disabled
89 tcptickle_sniff_wait_show