tests: add a wrapper for the filter test case
Florian Westphal
maintainerPATCH 1/1 tests: add a wrapper for the filter test case
The test requires traffic + active conntrack to pass. Add a wrapper script that creates a new netns, enables conntrack and then creates traffic (== ctnetlink events).
Signed-off-by Florian Westphal <[email protected]>
--- tests/test_filter.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tests/test_filter.sh
tests/test_filter.sh new file +27 -0
@@ -0,0 +1,27 @@ +#!/bin/bash + +exec unshare -n bash -c ' +ip link set lo up +nft -f -<<EOF +table t { + chain c { + ct state new accept + } +} +EOF + +timeout 20 ./test_filter | grep -q NEW & +rp=$! +sleep 1 + +for i in $(seq 1 127); do + timeout 1 ping -q -c 1 -I 127.0.0.$i 127.0.0.$i +done > /dev/null + +wait $rp +ret=$? + +echo "test_filter: return $ret" + +exit $ret +'
Signature · 1 line
2.52.0