From 3f8ec2b8dbc7900f0d91adfafb0591602476d1b1 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 7 Oct 2025 18:21:13 +0200 Subject: [PATCH] tests: shell: fix name based checks with CONFIG_MODULES=n 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 --- tests/shell/testcases/chains/netdev_chain_name_based_hook_0 | 2 +- tests/shell/testcases/flowtable/0016name_based_hook_0 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/shell/testcases/chains/netdev_chain_name_based_hook_0 b/tests/shell/testcases/chains/netdev_chain_name_based_hook_0 index 8a8a6017..2e37b23a 100755 --- a/tests/shell/testcases/chains/netdev_chain_name_based_hook_0 +++ b/tests/shell/testcases/chains/netdev_chain_name_based_hook_0 @@ -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" || { diff --git a/tests/shell/testcases/flowtable/0016name_based_hook_0 b/tests/shell/testcases/flowtable/0016name_based_hook_0 index 9a555960..19135b7e 100755 --- a/tests/shell/testcases/flowtable/0016name_based_hook_0 +++ b/tests/shell/testcases/flowtable/0016name_based_hook_0 @@ -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" || { -- 2.47.3