]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: fix name based checks with CONFIG_MODULES=n
authorFlorian Westphal <fw@strlen.de>
Tue, 7 Oct 2025 16:21:13 +0000 (18:21 +0200)
committerFlorian Westphal <fw@strlen.de>
Thu, 9 Oct 2025 15:46:30 +0000 (17:46 +0200)
Don't include a trailing space, its only there if nftables is a module:

  hook ingress device foo2 {
     0000000000 chain netdev t c [nf_tables]
  }

with CONFIG_NF_TABLES=y, this gets listed as:
'0000000000 chain netdev t c\n'.

Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/testcases/chains/netdev_chain_name_based_hook_0
tests/shell/testcases/flowtable/0016name_based_hook_0

index 8a8a601784084b15c57d3ddc9f1d4b4402f99b65..2e37b23a410aa07846a54898668a88d26a758071 100755 (executable)
@@ -2,7 +2,7 @@
 
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_ifname_based_hooks)
 
-cspec=' chain netdev t c '
+cspec=' chain netdev t c'
 $NFT add table netdev t
 $NFT add $cspec '{ type filter hook ingress priority 0; devices = { lo, foo* }; }'
 $NFT list hooks netdev device lo | grep -q "$cspec" || {
index 9a55596027158e9b0a196b3dbdc0b70be4066fd8..19135b7e33cf315c087502b6a7c6b148dfef7edb 100755 (executable)
@@ -3,7 +3,7 @@
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_ifname_based_hooks)
 # NFT_TEST_REQUIRES(NFT_TEST_HAVE_list_hooks_flowtable_info)
 
-ftspec=' flowtable ip t ft '
+ftspec=' flowtable ip t ft'
 $NFT add table t
 $NFT add $ftspec '{ hook ingress priority 0; devices = { lo, foo* }; }'
 $NFT list hooks netdev device lo | grep -q "$ftspec" || {