From: Pablo Neira Ayuso Date: Mon, 28 Jul 2025 22:52:55 +0000 (+0200) Subject: Amend "tests: shell: Fix ifname_based_hooks feature check" X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2757cb6596a0089b699f34ad1155e797c1206bf;p=thirdparty%2Fnftables.git 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 --- 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