]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests: shell: add regression tests for set flush+add bugs
authorFlorian Westphal <fw@strlen.de>
Tue, 16 Sep 2025 16:52:53 +0000 (18:52 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 8 Oct 2025 09:14:34 +0000 (11:14 +0200)
commitb134dc218066911a9ddab8fd82957b2e48da48f3
tree8abeb09170ef21592494664c4402c52ad32a53b3
parent216262453fb88ea92718b611fdea674084c4da22
tests: shell: add regression tests for set flush+add bugs

Create a helper file to:
1. create client <-> router <-> server topology
2. floodping from client to server
3. add a chain + set that contains both client and server
   addresses
4. a control counter that should never match
5. then, flush the set (not the ruleset) and re-add the
   addresses in one transaction

Report failure when counter had a match.

The test cases for the set types are done in separate files to take
advantage of run-tests.sh parallelization.

The expected behavior is that every ping packet is matched by the set.
The packet path should either match the old state, right before flush,
or the new state, after re-add.

As the flushed addresses are re-added in the same transaction we must
not observe in-limbo state where existing elements are deactivated but
new elements are not found.

Signed-off-by: Florian Westphal <fw@strlen.de>
13 files changed:
tests/shell/helpers/set_flush_add_atomic_helpers [new file with mode: 0644]
tests/shell/testcases/packetpath/dumps/set_flush_add_atomic_bitmap.nodump [new file with mode: 0644]
tests/shell/testcases/packetpath/dumps/set_flush_add_atomic_hash.nodump [new file with mode: 0644]
tests/shell/testcases/packetpath/dumps/set_flush_add_atomic_hash_fast.nodump [new file with mode: 0644]
tests/shell/testcases/packetpath/dumps/set_flush_add_atomic_pipapo.nodump [new file with mode: 0644]
tests/shell/testcases/packetpath/dumps/set_flush_add_atomic_rbtree.nodump [new file with mode: 0644]
tests/shell/testcases/packetpath/dumps/set_flush_add_atomic_rhash.nodump [new file with mode: 0644]
tests/shell/testcases/packetpath/set_flush_add_atomic_bitmap [new file with mode: 0755]
tests/shell/testcases/packetpath/set_flush_add_atomic_hash [new file with mode: 0755]
tests/shell/testcases/packetpath/set_flush_add_atomic_hash_fast [new file with mode: 0755]
tests/shell/testcases/packetpath/set_flush_add_atomic_pipapo [new file with mode: 0755]
tests/shell/testcases/packetpath/set_flush_add_atomic_rbtree [new file with mode: 0755]
tests/shell/testcases/packetpath/set_flush_add_atomic_rhash [new file with mode: 0755]