OSDN Git Service

testing: selftests: nft_flowtable.sh: rework test to detect offload failure
authorFlorian Westphal <fw@strlen.de>
Tue, 16 Aug 2022 12:15:22 +0000 (14:15 +0200)
committerFlorian Westphal <fw@strlen.de>
Wed, 17 Aug 2022 13:12:01 +0000 (15:12 +0200)
commitc8550b9077d271b9b4fbe5a9a260eb021f371c4f
treee946c146563fd0981ae6ec018a11a6c50cccf7f8
parentb71b7bfeac38c7a21c423ddafb29aa6258949df8
testing: selftests: nft_flowtable.sh: rework test to detect offload failure

This test fails on current kernel releases because the flotwable path
now calls dst_check from packet path and will then remove the offload.

Test script has two purposes:
1. check that file (random content) can be sent to other netns (and vv)
2. check that the flow is offloaded (rather than handled by classic
   forwarding path).

Since dst_check is in place, 2) fails because the nftables ruleset in
router namespace 1 intentionally blocks traffic under the assumption
that packets are not passed via classic path at all.

Rework this: Instead of blocking traffic, create two named counters, one
for original and one for reverse direction.

The first three test cases are handled by classic forwarding path
(path mtu discovery is disabled and packets exceed MTU).

But all other tests enable PMTUD, so the originator and responder are
expected to lower packet size and flowtable is expected to do the packet
forwarding.

For those tests, check that the packet counters (which are only
incremented for packets that are passed up to classic forward path)
are significantly lower than the file size transferred.

I've tested that the counter-checks fail as expected when the 'flow add'
statement is removed from the ruleset.

Signed-off-by: Florian Westphal <fw@strlen.de>
tools/testing/selftests/netfilter/nft_flowtable.sh