summaryrefslogtreecommitdiffstats
path: root/qa/ct_echo_event.sh
diff options
context:
space:
mode:
authorKen-ichirou MATSUZAWA <chamaken@gmail.com>2014-10-07 13:40:08 +0900
committerFlorian Westphal <fw@strlen.de>2014-10-14 13:18:52 +0200
commit871cd53f8f9b8c36eacbdfd546a0a4acba29e53b (patch)
tree1b22ab1e86adf78bb62e6e4e69f0f49db06623af /qa/ct_echo_event.sh
parent8cf7c41709c949d1472f030e78ab50b5f9c6bcc6 (diff)
qa: build unshared nfct environment
nssocket forks and change netns pre-establishd by ip(8), serves its socket descriptor to parent via nssocket(). Since this socket is isolated, it can be used to create regression tests for conntrack. This also adds a conntrack event testcase as a first user. A ct_echo_event.sh script is provided to build and run this test automatically: # ./qa/ct_echo_event.sh make: Entering directory... ...debug output like: [NEW] tcp 6 2 SYN_SENT src=10.255.255.249 dst=10.255.255.250 sport... [UPDATE] tcp 6 2 SYN_RECV src=10.255.255.249 dst=10.255.255.250 sport... ... [DESTROY] icmp 1 src=10.255.255.249 dst=10.255.255.250 type=8 code=0... # echo $? 0 Signed-off-by: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'qa/ct_echo_event.sh')
-rwxr-xr-xqa/ct_echo_event.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/qa/ct_echo_event.sh b/qa/ct_echo_event.sh
new file mode 100755
index 0000000..b4d7409
--- /dev/null
+++ b/qa/ct_echo_event.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. `dirname $0`/nssocket_env.sh
+
+echo "---- TCP echo"
+pre_sync
+echo | nc -q 0 $VETH_CHILD_ADDR $DSTPORT
+post_sync
+
+echo "---- UDP echo"
+pre_sync
+echo | nc -q 0 -u $VETH_CHILD_ADDR $DSTPORT
+post_sync
+
+echo "---- ICMP echo"
+pre_sync
+ping -c 1 $VETH_CHILD_ADDR > /dev/null 2>&1
+post_sync
+
+fin