From: Florian Westphal Date: Sat, 7 Dec 2024 11:17:02 +0000 (+0100) Subject: tests: shell: add a test case for netdev ruleset flush + parallel link down X-Git-Tag: v1.1.2~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02dbf86f39410900d8f2e3e9cbac0b5f14dbd871;p=thirdparty%2Fnftables.git tests: shell: add a test case for netdev ruleset flush + parallel link down Test for bug added with kernel commit c03d278fdf35 ("netfilter: nf_tables: wait for rcu grace period on net_device removal") Signed-off-by: Florian Westphal --- diff --git a/tests/shell/testcases/chains/dumps/netdev_chain_dev_addremove.nodump b/tests/shell/testcases/chains/dumps/netdev_chain_dev_addremove.nodump new file mode 100644 index 00000000..e69de29b diff --git a/tests/shell/testcases/chains/netdev_chain_dev_addremove b/tests/shell/testcases/chains/netdev_chain_dev_addremove new file mode 100755 index 00000000..14260d54 --- /dev/null +++ b/tests/shell/testcases/chains/netdev_chain_dev_addremove @@ -0,0 +1,48 @@ +#!/bin/bash + +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_inet_ingress) + +set -e + +iface_cleanup() { + ip link del d0 &>/dev/null || : +} +trap 'iface_cleanup' EXIT + +load_rules() +{ +$NFT -f - <