linux/tools
Florian Westphal febe7eda74 selftests: netfilter: nft_concat_range.sh: prefer per element counters for testing
The selftest uses following rule:
  ... @test counter name "test"

Then sends a packet, then checks if the named counter did increment or
not.

This is fine for the 'no-match' test case: If anything matches the
counter increments and the test fails as expected.

But for the 'should match' test cases this isn't optimal.
Consider buggy matching, where the packet matches entry x, but it
should have matched entry y.

In that case the test would erronously pass.

Rework the selftest to use per-element counters to avoid this.

After sending packet that should have matched entry x, query the
relevant element via 'nft reset element' and check that its counter
had incremented.

The 'nomatch' case isn't altered, no entry should match so the named
counter must be 0, changing it to the per-element counter would then
pass if another entry matches.

The downside of this change is a slight increase in test run-time by
a few seconds.

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2025-06-05 10:50:04 +02:00
..
accounting
arch Merge branch 'x86/cpu' into x86/core, to resolve conflicts 2025-05-13 10:37:01 +02:00
bootconfig
bpf bpftool: Add support for custom BTF path in prog load/loadall 2025-05-27 10:31:20 -07:00
build perf tools changes for v6.15 2025-03-31 08:52:33 -07:00
certs
cgroup
counter
crypto
debugging taint: Add TAINT_FWCTL 2025-03-06 15:13:13 -04:00
firewire
firmware
gpio
hv tools/hv: update route parsing in kvp daemon 2025-04-25 06:07:09 +00:00
iio
include bpf: Fix L4 csum update on IPv6 in CHECKSUM_COMPLETE 2025-05-30 19:53:51 -07:00
kvm/kvm_stat
laptop
leds
lib bpf-next-6.16 2025-05-28 15:52:42 -07:00
memory-model tools/memory-model/Documentation: Fix SRCU section in explanation.txt 2025-04-23 12:17:04 -07:00
mm
net Networking changes for 6.16. 2025-05-28 15:24:36 -07:00
objtool Core x86 updates for v6.16: 2025-05-26 16:04:17 -07:00
pcmcia
perf Core x86 updates for v6.16: 2025-05-26 16:04:17 -07:00
power Power management updates for 6.16-rc1 2025-05-27 16:48:47 -07:00
rcu
sched_ext sched_ext: change the variable name for slice refill event 2025-04-18 17:25:39 -10:00
scripts tools headers: Update the syscall table with the kernel sources 2025-04-10 09:28:24 -07:00
sound ASoC: dapm-graph: set fill colour of turned on nodes 2025-02-24 18:35:54 +00:00
spi
testing selftests: netfilter: nft_concat_range.sh: prefer per element counters for testing 2025-06-05 10:50:04 +02:00
thermal
time
tracing Documentation/rtla: Include BPF sample collection 2025-04-14 10:42:55 -06:00
usb
verification tracing tooling updates for 6.15: 2025-03-27 17:03:01 -07:00
virtio tools: virtio/linux/module.h add MODULE_DESCRIPTION() define. 2025-02-25 07:10:45 -05:00
wmi
workqueue
writeback
Makefile tools/Makefile: Add ynl target 2025-04-28 17:18:48 -07:00