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 # This should happen as soon as connection is up... but unless we wait
74 # we sometimes beat the registration.
77 try_command_on_node 0 ctdb gettickles $test_ip -n $test_node
78 # SRC: 10.0.2.45:49091 DST: 10.0.2.143:445
79 [ "${out/SRC: ${src_socket} /}" != "$out" ]
82 echo "Checking if CIFS connection is tracked by CTDB..."
83 wait_until 10 check_tickles
86 if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
87 echo "GOOD: CIFS connection tracked OK by CTDB."
89 echo "BAD: Socket not tracked by CTDB."
93 tcptickle_sniff_start $src_socket "${test_ip}:${test_port}"
95 echo "Disabling node $test_node"
96 try_command_on_node 1 $CTDB disable -n $test_node
97 wait_until_node_has_status $test_node disabled
99 tcptickle_sniff_wait_show