summaryrefslogtreecommitdiffstats
path: root/tests/conntrackd/tests.yaml
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo@netfilter.org>2021-01-22 20:31:09 +0100
committerArturo Borrero Gonzalez <arturo@netfilter.org>2021-02-01 11:39:19 +0100
commit5b47fe5c72e7cfe9a3cade82758144619d2da280 (patch)
tree09fed2f7a98ee8dc5d6ee2639565ff91a6d44045 /tests/conntrackd/tests.yaml
parent4c2a31a1fcfb2ddeb305930cbb1a2b71c60ff310 (diff)
tests: introduce replicating scenario and simple icmp test case
This patch introduces a new scenario with a virtual network layout that was previously designed by Pablo (see commit 7f1fb5dad90f04caa94f4fcefd1340aeb2c2f0e3). The scenario is called 'basic_2_peer_network_tcp_notrack' and can be used to test conntrack entry replication in TCP/NOTRACK mode with both caches disables. In this mode entry syncronization should happen basically in the same instant the event is produced. The testcase is very simple, but works really well: * send 1 ping to a network peer across the router * verify the conntrack entry has been replicated to the stand-by router === 8< === $ cd tests ; sudo ./conntrackd-tests.py --single tcp_notrack_replicate_icmp [conntrackd-tests.py] INFO: --- running test: tcp_notrack_replicate_icmp [conntrackd-tests.py] INFO: --- passed test: tcp_notrack_replicate_icmp [conntrackd-tests.py] INFO: --- [conntrackd-tests.py] INFO: --- finished [conntrackd-tests.py] INFO: --- passed tests: 1 [conntrackd-tests.py] INFO: --- failed tests: 0 [conntrackd-tests.py] INFO: --- scenario failure: 0 [conntrackd-tests.py] INFO: --- total tests: 1 === 8< === Signed-off-by: Arturo Borrero Gonzalez <arturo@netfilter.org>
Diffstat (limited to 'tests/conntrackd/tests.yaml')
-rw-r--r--tests/conntrackd/tests.yaml11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/conntrackd/tests.yaml b/tests/conntrackd/tests.yaml
index 8324dbe..872269d 100644
--- a/tests/conntrackd/tests.yaml
+++ b/tests/conntrackd/tests.yaml
@@ -39,3 +39,14 @@
# check that we can obtain stats via unix socket: expect (no output)
test:
- $CONNTRACKD -C /tmp/conntrackd_test_simple_stats -s expect
+
+- name: tcp_notrack_replicate_icmp
+ scenario: basic_2_peer_network_tcp_notrack
+ # check that we can replicate a ICMP conntrack entry in a 2 conntrackd TCP/NOTRACK setup
+ test:
+ # PING should inject an ICMP conntrack entry in nsr1
+ - ip netns exec ns1 ping -c1 10.0.1.2 >/dev/null
+ # verify conntrack entry is then replicated to nsr2, wait up to 5 seconds
+ - timeout 5 bash -c -- '
+ while ! ip netns exec nsr2 $CONNTRACK -L -p icmp 2>/dev/null | grep -q icmp
+ ; do sleep 0.5 ; done'