1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00
samba-mirror/ctdb/tests/eventscripts/10.interface.releaseip.010.sh
Martin Schwenke dac075129b ctdb-scripts: Compact server-end TCP connection killing output
When thousands of connections are being killed the logs are flooded
with information about connections that should be killed.  When some
connections are not killed then the number not killed is printed.
This is the wrong way around!  When debugging "fail-back" problems, it
is important to know details of connections that were *not* killed.
It is almost never important to know the full list of all connections
that were *supposed* to be killed.

Instead, print a summary showing how many connections of the total
were killed.  If any were not killed then print a list of remaining
connections.

Update unit tests: infrastructure for fake TCP connections, existing,
test cases, add new test cases.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-06-13 09:12:19 +02:00

23 lines
396 B
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "Release 1 IP, 10 connections killed OK"
setup_ctdb
ctdb_get_1_public_address |
while read dev ip bits ; do
ip addr add "${ip}/${bits}" dev "$dev"
count=10
setup_tcp_connections $count \
"$ip" 445 10.254.254.0 12300
ok <<EOF
Killed ${count}/${count} TCP connections to released IP $ip
EOF
simple_test $dev $ip $bits
done