6 For external IP address management, verify that CIFS tickles are sent.
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 * Clustered Samba must be listening on TCP port 445.
21 .
"${TEST_SCRIPTS_DIR}/integration.bash"
27 ctdb_test_check_real_cluster
32 ctdb_restart_when_done
34 select_test_node_and_ips
36 # Select a different node to move the IP address to
38 while read x to_node
; do
39 if [ "$to_node" != "$test_node" ] ; then
43 if [ -z "$to_node" ] ; then
44 die
"BAD: Unable to find a target node different to ${to_node}"
47 echo "Get mask and interface for ${test_ip}"
48 get_test_ip_mask_and_iface
50 echo "Set DisableIPFailover=1 on all nodes"
51 try_command_on_node all
$CTDB setvar DisableIPFailover
1
53 echo "Give the recovery daemon some time to reload tunables"
58 onnode
-q all
$CTDB enablescript
"10.interface"
59 onnode
-q all
$CTDB disablescript
"10.external"
61 ctdb_test_exit_hook_add my_exit_hook
63 echo "Disable 10.interface on all nodes"
64 try_command_on_node all
$CTDB disablescript
10.interface
65 echo "Enable 10.external on all nodes"
66 try_command_on_node all
$CTDB enablescript
10.external
70 echo "Connecting to node ${test_node} on IP ${test_ip}:${test_port} with netcat..."
72 nc
-d -w 60 $test_ip $test_port &
74 ctdb_test_exit_hook_add
"kill $nc_pid >/dev/null 2>&1"
76 wait_until_get_src_socket
"tcp" "${test_ip}:${test_port}" $nc_pid "nc"
78 echo "Source socket is $src_socket"
80 # This should happen as soon as connection is up... but unless we wait
81 # we sometimes beat the registration.
82 echo "Checking if CIFS connection is tracked by CTDB..."
83 wait_until
10 check_tickles
$test_node $test_ip $test_port $src_socket
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 "Moving $test_ip from $test_node to $to_node"
96 try_command_on_node
$test_node ip addr del
"${test_ip}/${mask}" dev
"$iface"
97 try_command_on_node
$to_node ip addr add
"${test_ip}/${mask}" dev
"$iface"
98 try_command_on_node
$to_node ctdb moveip
"$test_ip" "$to_node"
100 wait_until_ips_are_on_node
"$to_node" "$test_ip"
102 tcptickle_sniff_wait_show