]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: netdevice removal for inet family
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 18 Jan 2024 21:30:12 +0000 (22:30 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 7 Feb 2024 12:37:00 +0000 (13:37 +0100)
cover netdevice removal when such netdevice belongs to basechain.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/chains/netdev_chain_dev_gone
tests/shell/testcases/chains/netdev_chain_multidev_gone

index 02dacffb7a038b863f9e0dec9371ca231ba92df6..77f828d50df03736195b5ba56434dc15e59c9b32 100755 (executable)
@@ -9,8 +9,11 @@ trap 'iface_cleanup' EXIT
 
 ip link add d0 type dummy
 
-# Test auto-removal of chain hook on device removal
-RULESET="table netdev x {
+load_ruleset() {
+       family=$1
+
+       # Test auto-removal of chain hook on device removal
+       RULESET="table $family x {
        chain x {}
        chain w {
                ip daddr 8.7.6.0/24 jump x
@@ -21,5 +24,9 @@ RULESET="table netdev x {
                ip daddr vmap { 5.4.3.0/24 : jump w, 8.9.0.0/24 : jump x }
        }
 }"
+       $NFT -c -f - <<< $RULESET
+       $NFT -f - <<< $RULESET
+}
 
-$NFT -f - <<< $RULESET
+load_ruleset "inet"
+load_ruleset "netdev"
index bc5ca7d04bbedd1a58055fe2da6753e957ffd5dd..e82698a714835cd35e17e8e39862f900818b82fa 100755 (executable)
@@ -16,8 +16,11 @@ ip link add d0 type dummy
 ip link add d1 type dummy
 ip link add d2 type dummy
 
-# Test auto-removal of chain hook on device removal
-RULESET="table netdev x {
+load_ruleset() {
+       family=$1
+
+       # Test auto-removal of chain hook on device removal
+       RULESET="table $family x {
        chain x {}
        chain w {
                ip daddr 8.7.6.0/24 jump {
@@ -30,5 +33,9 @@ RULESET="table netdev x {
                ip daddr vmap { 5.4.3.0/24 : jump w, 8.9.0.0/24 : jump x }
        }
 }"
+       $NFT -c -f - <<< $RULESET
+       $NFT -f - <<< $RULESET
+}
 
-$NFT -f - <<< $RULESET
+load_ruleset "inet"
+load_ruleset "netdev"