[PATCH 5/6] selftests: forwarding: tc_flower_l2_miss: skip tests if tools or feats are missing

Aleksei Oladko posted 6 patches 2 weeks, 5 days ago
[PATCH 5/6] selftests: forwarding: tc_flower_l2_miss: skip tests if tools or feats are missing
Posted by Aleksei Oladko 2 weeks, 5 days ago
The tc_flower_l2_miss.sh selftest assume the presence of iproute2
support for the `l2_miss` keyword in `tc filter` commands. These
assumptions can cause test failures.

This patch improves test robustness by skipping the test if
tc filter help does not mention l2 miss

Signed-off-by: Aleksei Oladko <aleksey.oladko@virtuozzo.com>
---
 tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh b/tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh
index c2420bb72c12..c28569b8948f 100755
--- a/tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh
+++ b/tools/testing/selftests/net/forwarding/tc_flower_l2_miss.sh
@@ -347,6 +347,8 @@ cleanup()
 	vrf_cleanup
 }
 
+run_cmd_grep 'l2_miss' tc filter add dev lo ingress flower help || exit $ksft_skip
+
 trap cleanup EXIT
 
 setup_prepare
-- 
2.43.0