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 it send an appropriate reset packet.
14 * An active CTDB cluster with at least 2 nodes with public addresses.
16 * Test must be run on a real or virtual cluster rather than against
19 * Test must not be run from a cluster node.
21 * Clustered Samba must be listening on TCP port 445.
25 1. Verify that the cluster is healthy.
26 2. Connect from the current host (test client) to TCP port 445 using
27 the public address of a cluster node.
28 3. Determine the source socket used for the connection.
29 4. Using the "ctdb gettickle" command, ensure that CTDB records the
31 5. Disable the node that the connection has been made to.
32 6. Verify that a TCP tickle (a reset packet) is sent to the test client.
36 * CTDB should correctly record the connection and should send a reset
37 packet when the node is disabled.
41 . ctdb_test_functions.bash
47 ctdb_test_check_real_cluster
52 ctdb_restart_when_done
54 # We need this for later, so we know how long to sleep.
55 try_command_on_node 0 $CTDB getvar MonitorInterval
56 monitor_interval="${out#*= }"
57 #echo "Monitor interval on node $test_node is $monitor_interval seconds."
59 select_test_node_and_ips
63 echo "Connecting to node ${test_node} on IP ${test_ip}:${test_port} with netcat..."
65 nc -d -w $(($monitor_interval * 4)) $test_ip $test_port &
67 ctdb_test_exit_hook_add "kill $nc_pid >/dev/null 2>&1"
69 wait_until_get_src_socket "tcp" "${test_ip}:${test_port}" $nc_pid "nc"
71 echo "Source socket is $src_socket"
73 # Right here we assume that Samba is able to register the tickle with
74 # CTDB faster than it takes us to wait for netstat to register the
75 # connection and then use onnode below to ask CTDB about it.
77 try_command_on_node -v 0 ctdb gettickles $test_ip -n $test_node
79 if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
80 echo "GOOD: CIFS connection tracked OK by CTDB."
82 echo "BAD: Socket not tracked by CTDB."
86 tcptickle_sniff_start $src_socket "${test_ip}:${test_port}"
88 echo "Disabling node $test_node"
89 try_command_on_node 1 $CTDB disable -n $test_node
90 onnode 0 $CTDB_TEST_WRAPPER wait_until_node_has_status $test_node disabled
92 tcptickle_sniff_wait_show