diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2025-07-29 00:52:55 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2025-07-29 03:53:17 +0200 |
commit | e1dc9918251a130b3124beb7e75bb347fe1d1fec (patch) | |
tree | 57ad214bdc9e5a7bc0782015c7b1f1c93b3e8dc6 | |
parent | 2c64881c824d478c11cd0b9dc9879c2aa74d2120 (diff) |
Amend "tests: shell: Fix ifname_based_hooks feature check"1.0.6.y
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 <pablo@netfilter.org>
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 <pablo@netfilter.org>
-rwxr-xr-x | tests/shell/features/ifname_based_hooks.sh | 2 | ||||
-rwxr-xr-x | 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 |