testprogs/blackbox: add test_trust_utils.sh
[Samba.git] / ctdb / tests / eventscripts / 10.interface.releaseip.010.sh
blobb6d9c7a8bd6f913431152b2d1ed21530e3cd0cda
1 #!/bin/sh
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
5 define_test "Release 1 IP, 10 connections killed OK"
7 setup_ctdb
9 ctdb_get_1_public_address |
10 while read dev ip bits ; do
11 ip addr add "${ip}/${bits}" dev "$dev"
13 # Setup 10 fake connections...
14 count=10
15 out=""
16 nl="
18 i=0
19 while [ $i -lt $count ] ; do
20 echo "${ip}:445 10.254.254.1:1230${i}"
21 # Expected output for killing this connection
22 out="${out}${out:+${nl}}Killing TCP connection 10.254.254.1:1230${i} ${ip}:445"
23 i=$(($i + 1))
24 done >"$FAKE_NETSTAT_TCP_ESTABLISHED_FILE"
26 ok <<EOF
27 $out
28 Killed $count TCP connections to released IP $ip
29 EOF
31 simple_test $dev $ip $bits
32 done