netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/3 nf] selftests: netfilter: fix nft_meta.sh error reporting
@ 2020-09-09 18:26 Fabian Frederick
  0 siblings, 0 replies; only message in thread
From: Fabian Frederick @ 2020-09-09 18:26 UTC (permalink / raw)
  To: pablo, kadlec, fw; +Cc: netfilter-devel, coreteam, netdev, Fabian Frederick

When some test directly done with check_one_counter() fails,
counter variable is undefined. This patch calls ip with cname
which avoids errors like:
FAIL: oskuidcounter, want "packets 2", got
Error: syntax error, unexpected newline, expecting string
list counter inet filter
                        ^
Error is now correctly rendered:
FAIL: oskuidcounter, want "packets 2", got
table inet filter {
	counter oskuidcounter {
		packets 1 bytes 84
	}
}

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 tools/testing/selftests/netfilter/nft_meta.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/netfilter/nft_meta.sh b/tools/testing/selftests/netfilter/nft_meta.sh
index 17b2d6eaa2044..1f5b46542c14c 100755
--- a/tools/testing/selftests/netfilter/nft_meta.sh
+++ b/tools/testing/selftests/netfilter/nft_meta.sh
@@ -90,7 +90,7 @@ check_one_counter()
 	if [ $? -ne 0 ];then
 		echo "FAIL: $cname, want \"$want\", got"
 		ret=1
-		ip netns exec "$ns0" nft list counter inet filter $counter
+		ip netns exec "$ns0" nft list counter inet filter $cname
 	fi
 }
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-09 18:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 18:26 [PATCH 2/3 nf] selftests: netfilter: fix nft_meta.sh error reporting Fabian Frederick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).