selftests: mirror_gre_changes: Tighten up the TTL test match
authorPetr Machata <petrm@nvidia.com>
Fri, 11 Aug 2023 15:59:27 +0000 (17:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Aug 2023 10:14:24 +0000 (11:14 +0100)
commit855067defa36b1f9effad8c219d9a85b655cf500
treedfaeeed7e1ae441d81a8313622e3532fabf6e62b
parentace0ab3a4b54205a01d3f4a0fd9bdb4616cfb60b
selftests: mirror_gre_changes: Tighten up the TTL test match

This test verifies whether the encapsulated packets have the correct
configured TTL. It does so by sending ICMP packets through the test
topology and mirroring them to a gretap netdevice. On a busy host
however, more than just the test ICMP packets may end up flowing
through the topology, get mirrored, and counted. This leads to
potential spurious failures as the test observes much more mirrored
packets than the sent test packets, and assumes a bug.

Fix this by tightening up the mirror action match. Change it from
matchall to a flower classifier matching on ICMP packets specifically.

Fixes: 45315673e0c5 ("selftests: forwarding: Test changes in mirror-to-gretap")
Signed-off-by: Petr Machata <petrm@nvidia.com>
Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/mirror_gre_changes.sh