6 Verify that the server end of an NFS connection is correctly reset
10 * An active CTDB cluster with at least 2 nodes with public addresses.
12 * Test must be run on a real or virtual cluster rather than against
15 * Test must not be run from a cluster node.
17 * Cluster nodes must be listening on the NFS TCP port (2049).
21 * CTDB should correctly record the connection and the releasing node
22 should reset the server end of the connection.
26 .
"${TEST_SCRIPTS_DIR}/integration.bash"
32 ctdb_test_check_real_cluster
37 ctdb_restart_when_done
39 # We need this for later, so we know how long to sleep.
40 try_command_on_node
0 $CTDB getvar MonitorInterval
41 monitor_interval
="${out#*= }"
43 select_test_node_and_ips
47 echo "Set NoIPTakeover=1 on all nodes"
48 try_command_on_node all
$CTDB setvar NoIPTakeover
1
50 echo "Give the recovery daemon some time to reload tunables"
53 echo "Connecting to node ${test_node} on IP ${test_ip}:${test_port} with nc..."
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 echo "Wait until NFS connection is tracked by CTDB on test node ..."
64 wait_until $
((monitor_interval
* 2)) \
65 check_tickles
$test_node $test_ip $test_port $src_socket
68 # It would be nice if ss consistently used local/peer instead of src/dst
69 ss_filter
="src ${test_ip}:${test_port} dst ${src_socket}"
71 try_command_on_node
$test_node \
72 "ss -tn state established '${ss_filter}' | tail -n +2"
73 if [ -z "$out" ] ; then
74 echo "BAD: ss did not list the socket"
77 echo "GOOD: ss lists the socket:"
80 echo "Disabling node $test_node"
81 try_command_on_node
1 $CTDB disable
-n $test_node
82 wait_until_node_has_status
$test_node disabled
84 try_command_on_node
$test_node \
85 "ss -tn state established '${ss_filter}' | tail -n +2"
86 if [ -n "$out" ] ; then
87 echo "BAD: ss listed the socket after failover"
90 echo "GOOD: ss no longer lists the socket"