summaryrefslogtreecommitdiffstats
path: root/ctdb/tests/eventscripts/scripts
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-07-25 13:40:43 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-07-29 15:53:06 +1000
commita8dd716146dd305a8749ece01f7bd96c3a35947a (patch)
treebdac59aa4619d9e067436398613b5e52f40f1221 /ctdb/tests/eventscripts/scripts
parent200c28fbb21a5f851d07adea8be16eb280addfd2 (diff)
eventscripts: kill_tcp_connections() should send connections to stdin
This avoids issuing multiple "ctdb killtcp" commands to terminate tcp connections, one per connection. This will considerably reduce the time when there is a large number of tcp connections. This also makes it possible to avoid calling "ctdb killtcp" when there are no connections. Add a couple of unit tests for killtcp and update eventscript unit test infrastructure to support. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit a20d94717d2e4ab866d8a002cdf39c0669b74c6a)
Diffstat (limited to 'ctdb/tests/eventscripts/scripts')
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index e7892a0a71..9da17b10fb 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -123,6 +123,9 @@ setup_generic ()
export FAKE_TDBTOOL_SUPPORTS_CHECK="yes"
export FAKE_TDB_IS_OK
export FAKE_DATE_OUTPUT
+
+ export FAKE_NETSTAT_TCP_ESTABLISHED FAKE_TCP_LISTEN FAKE_NETSTAT_UNIX_LISTEN
+ export FAKE_NETSTAT_TCP_ESTABLISHED_FILE=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR")
}
tcp_port_down ()