diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-11-07 10:39:33 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2023-11-11 10:05:23 +0100 |
commit | 02d041cbd1a0d0dd96d23dcc88cb0ba45e7ce0e9 (patch) | |
tree | 923c12621e95fb93bd2958df321076b84a53dd17 /tests | |
parent | 2545416782c89dd9080e6bdd4fadc2cb0333a9d2 (diff) |
tests: shell: skip multidevice chain tests if kernel lacks support
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/shell/features/netdev_chain_multidevice.sh | 17 | ||||
-rwxr-xr-x | tests/shell/testcases/chains/0042chain_variable_0 | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/shell/features/netdev_chain_multidevice.sh b/tests/shell/features/netdev_chain_multidevice.sh new file mode 100755 index 00000000..d2a56d6d --- /dev/null +++ b/tests/shell/features/netdev_chain_multidevice.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# d54725cd11a5 ("netfilter: nf_tables: support for multiple devices per netdev hook") +# v5.5-rc1~174^2~312^2~4 + +trap "ip link del d0; ip link del d1" EXIT + +ip link add d0 type dummy +ip link add d1 type dummy + +EXPECTED="table netdev filter2 { + chain Main_Ingress2 { + type filter hook ingress devices = { \"d0\", \"d1\" } priority -500; policy accept; + } +}" + +$NFT -f - <<< $EXPECTED diff --git a/tests/shell/testcases/chains/0042chain_variable_0 b/tests/shell/testcases/chains/0042chain_variable_0 index a4b929f7..c5de495e 100755 --- a/tests/shell/testcases/chains/0042chain_variable_0 +++ b/tests/shell/testcases/chains/0042chain_variable_0 @@ -1,5 +1,7 @@ #!/bin/bash +# NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_multidevice) + set -e ip link add name d23456789012345 type dummy |