summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/chains/netdev_chain_0
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/testcases/chains/netdev_chain_0')
-rwxr-xr-xtests/shell/testcases/chains/netdev_chain_026
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/shell/testcases/chains/netdev_chain_0 b/tests/shell/testcases/chains/netdev_chain_0
index 67cd715f..a323e6ec 100755
--- a/tests/shell/testcases/chains/netdev_chain_0
+++ b/tests/shell/testcases/chains/netdev_chain_0
@@ -1,24 +1,20 @@
#!/bin/bash
-ip link add d0 type dummy || {
- echo "Skipping, no dummy interface available"
- exit 0
-}
-trap "ip link del d0" EXIT
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_netdev_chain_without_device)
-ip link add d1 type dummy || {
- echo "Skipping, no dummy interface available"
- exit 0
-}
-trap "ip link del d1" EXIT
+set -e
-ip link add d2 type dummy || {
- echo "Skipping, no dummy interface available"
- exit 0
+iface_cleanup() {
+ ip link del d0 &>/dev/null || :
+ ip link del d1 &>/dev/null || :
+ ip link del d2 &>/dev/null || :
}
-trap "ip link del d2" EXIT
+trap 'iface_cleanup' EXIT
+iface_cleanup
-set -e
+ip link add d0 type dummy
+ip link add d1 type dummy
+ip link add d2 type dummy
RULESET="table netdev x {
chain y {