tools: match_nomatch: fix spurious failure in nomatch test
Florian Westphal
maintainerPATCH 1/1 tools: match_nomatch: fix spurious failure in nomatch test
The list is constructed randonly, its possible that it is empty. When this happens, the test fails. Skip this instead if that happens.
Signed-off-by Florian Westphal <[email protected]>
--- tests/shell/helpers/set_match_nomatch_helpers | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
tests/shell/helpers/set_match_nomatch_helpers +1 -3
@@ -301,11 +301,9 @@ test_nomatch() wait - [ "$psent" -eq 0 ] && exit_fatal "empty nomatch list" - if ip netns exec "$R" $NFT list set ip test s | grep -q 'counter packets 1' ; then ip netns exec "$R" $NFT list set ip test s - exit_fatal "Unexpected entry listed as matching" + exit_fatal "Unexpected entry listed as matching, sent $psent packets." fi if ip netns exec "$R" $NFT list counter ip test nomatch | grep -q "packets $psent"; then
Signature · 1 line
2.53.0