From e1dc9918251a130b3124beb7e75bb347fe1d1fec Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 29 Jul 2025 00:52:55 +0200 Subject: Amend "tests: shell: Fix ifname_based_hooks feature check" commit 646acfaceb1f550c982c31ba6e60996b0bb012d7 upstream. The following syntax: type filter hook ingress priority 0; devices = { d0 }; is not parsed in 1.0.6.y. And remove device deletion, this is only available since 1.0.8 in: commit a66b5ad9540dd64c7c67006201b8b3ccf8e4316b Author: Pablo Neira Ayuso Date: Wed Apr 19 11:50:01 2023 +0200 src: allow for updating devices on existing netdev chain skip netdev_chain_dormant_autoremove for new kernels. Signed-off-by: Pablo Neira Ayuso --- tests/shell/features/ifname_based_hooks.sh | 2 +- tests/shell/testcases/chains/netdev_chain_dormant_autoremove | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/shell/features/ifname_based_hooks.sh b/tests/shell/features/ifname_based_hooks.sh index cada6956..e1fd6f03 100755 --- a/tests/shell/features/ifname_based_hooks.sh +++ b/tests/shell/features/ifname_based_hooks.sh @@ -5,7 +5,7 @@ unshare -n bash -c "ip link add d0 type dummy; \ $NFT \"table netdev t { \ chain c { \ - type filter hook ingress priority 0; devices = { d0 }; \ + type filter hook ingress devices = { d0 } priority 0;\ }; \ }\"; \ ip link del d0; \ diff --git a/tests/shell/testcases/chains/netdev_chain_dormant_autoremove b/tests/shell/testcases/chains/netdev_chain_dormant_autoremove index 8455f310..72a90cf8 100755 --- a/tests/shell/testcases/chains/netdev_chain_dormant_autoremove +++ b/tests/shell/testcases/chains/netdev_chain_dormant_autoremove @@ -2,6 +2,11 @@ # NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_multidevice) +if [ "$NFT_TEST_HAVE_ifname_based_hooks" = y ]; then + echo "Test skipped due to NFT_TEST_HAVE_ifname_based_hooks=y" + exit 77 +fi + set -e ip link add dummy0 type dummy @@ -9,6 +14,3 @@ ip link add dummy1 type dummy $NFT add table netdev test { flags dormant\; } $NFT add chain netdev test ingress { type filter hook ingress devices = { "dummy0", "dummy1" } priority 0\; policy drop\; } ip link del dummy0 -if [ "$NFT_TEST_HAVE_ifname_based_hooks" = y ]; then - $NFT 'delete chain netdev test ingress { devices = { "dummy0" }; }' -fi -- cgit v1.2.3