Skip to contentSkip to conversation

tools: match_nomatch: fix spurious failure in nomatch test

PATCH New Florian Westphal 1 participant 1 message May 4 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 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.

---
 tests/shell/helpers/set_match_nomatch_helpers | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/shell/helpers/set_match_nomatch_helpers +1 -3
index 35114895c68c..04c3f8465bf0 100644
@@ -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