selftests: netfilter: add conntrack stress test
Subsystems (3)
Florian Westphal
maintainerPATCH 1/1 selftests: netfilter: add conntrack stress test
Add a new test case to check:
- conntrack_max limit is effective
- conntrack_max limit cannot be exceeded from within a netns
- resizing the hash table while packets are inflight works
- removal of all conntrack rules disables conntrack in netns
- conntrack tool dump (conntrack -L) returns expected number of (unique) entries
- procfs interface - if available - has same number of entries as conntrack -L dump
Expected output with selftest framework:
selftests: net/netfilter: conntrack_resize.sh
PASS: got 1 connections: netns conntrack_max is pernet bound
PASS: got 100 connections: netns conntrack_max is init_net bound
PASS: dump in netns had same entry count (-C 1778, -L 1778, -p 1778, /proc 0)
PASS: dump in netns had same entry count (-C 2000, -L 2000, -p 2000, /proc 0)
PASS: test parallel conntrack dumps
PASS: resize+flood
PASS: got 0 connections: conntrack disabled
PASS: got 1 connections: conntrack enabled
ok 1 selftests: net/netfilter: conntrack_resize.sh
--- .../testing/selftests/net/netfilter/Makefile | 1 + tools/testing/selftests/net/netfilter/config | 1 + .../net/netfilter/conntrack_resize.sh | 406 ++++++++++++++++++ 3 files changed, 408 insertions(+) create mode 100755 tools/testing/selftests/net/netfilter/conntrack_resize.sh
tools/testing/selftests/net/netfilter/Makefile +1 -0
@@ -12,6 +12,7 @@ TEST_PROGS += conntrack_dump_flush.sh TEST_PROGS += conntrack_icmp_related.sh TEST_PROGS += conntrack_ipip_mtu.sh TEST_PROGS += conntrack_tcp_unreplied.sh +TEST_PROGS += conntrack_resize.sh TEST_PROGS += conntrack_sctp_collision.sh TEST_PROGS += conntrack_vrf.sh TEST_PROGS += conntrack_reverse_clash.sh
tools/testing/selftests/net/netfilter/config +1 -0
@@ -46,6 +46,7 @@ CONFIG_NETFILTER_XT_MATCH_STATE=m CONFIG_NETFILTER_XT_MATCH_STRING=m CONFIG_NETFILTER_XT_TARGET_REDIRECT=m CONFIG_NF_CONNTRACK=m +CONFIG_NF_CONNTRACK_PROCFS=y CONFIG_NF_CONNTRACK_EVENTS=y CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_MARK=y
tools/testing/selftests/net/netfilter/conntrack_resize.sh new file +406 -0
406 lines not on this page · raw message
Signature · 1 line
2.49.0
Quoted 10 lines · Florian Westphal
Add a new test case to check:
-conntrack_maxlimit is effective
-conntrack_maxlimit cannot be exceeded from within a netns
- resizing the hash table while packets are inflight works
- removal of all conntrack rules disables conntrack in netns
- conntrack tool dump (conntrack -L) returns expected number of (unique) entries
- procfs interface - if available - has same number of entries as conntrack -L dump
Quoted 11 lines
Expected output with selftest framework:
selftests: net/netfilter:conntrack_resize.sh
PASS: got 1 connections: netnsconntrack_maxis pernet bound
PASS: got 100 connections: netnsconntrack_maxisinit_netbound
PASS: dump in netns had same entry count (-C 1778, -L 1778, -p 1778, /proc 0)
PASS: dump in netns had same entry count (-C 2000, -L 2000, -p 2000, /proc 0)
PASS: test parallel conntrack dumps
PASS: resize+flood
PASS: got 0 connections: conntrack disabled
PASS: got 1 connections: conntrack enabled
ok 1 selftests: net/netfilter:conntrack_resize.sh
Applied to nf-next, thanks.