Commit 5b1a995b authored by Fabian Frederick's avatar Fabian Frederick Committed by Pablo Neira Ayuso

selftests: netfilter: fix nft_meta.sh error reporting

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: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent f02ced62
...@@ -90,7 +90,7 @@ check_one_counter() ...@@ -90,7 +90,7 @@ check_one_counter()
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
echo "FAIL: $cname, want \"$want\", got" echo "FAIL: $cname, want \"$want\", got"
ret=1 ret=1
ip netns exec "$ns0" nft list counter inet filter $counter ip netns exec "$ns0" nft list counter inet filter $cname
fi fi
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment