The major problem here was that existence of network interfaces 'eth0' and 'wlan0' was assumed. Overcome this by just using 'lo' instead, which exists even in newly created netns by default. Another minor issue was false naming of 0004delete_after_add0 - the expected return code is supposed to be separated by '_' from the remaining filename. Signed-off-by: Phil Sutter <phil@xxxxxx> --- tests/shell/testcases/flowtable/0001flowtable_0 | 2 +- tests/shell/testcases/flowtable/0002create_flowtable_0 | 6 +++--- tests/shell/testcases/flowtable/0003add_after_flush_0 | 4 ++-- tests/shell/testcases/flowtable/0004delete_after_add0 | 6 ------ tests/shell/testcases/flowtable/0004delete_after_add_0 | 6 ++++++ tests/shell/testcases/flowtable/0005delete_in_use_1 | 2 +- tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) delete mode 100755 tests/shell/testcases/flowtable/0004delete_after_add0 create mode 100755 tests/shell/testcases/flowtable/0004delete_after_add_0 diff --git a/tests/shell/testcases/flowtable/0001flowtable_0 b/tests/shell/testcases/flowtable/0001flowtable_0 index 95b193dc90603..90b23dc38d6fe 100755 --- a/tests/shell/testcases/flowtable/0001flowtable_0 +++ b/tests/shell/testcases/flowtable/0001flowtable_0 @@ -3,7 +3,7 @@ EXPECTED='table inet t { flowtable f { hook ingress priority 10 - devices = { eth0, wlan0 } + devices = { lo } } chain c { diff --git a/tests/shell/testcases/flowtable/0002create_flowtable_0 b/tests/shell/testcases/flowtable/0002create_flowtable_0 index b6941c58eea98..4c85c3f8cfc0e 100755 --- a/tests/shell/testcases/flowtable/0002create_flowtable_0 +++ b/tests/shell/testcases/flowtable/0002create_flowtable_0 @@ -2,11 +2,11 @@ set -e $NFT add table t -$NFT add flowtable t f { hook ingress priority 10 \; devices = { eth0, wlan0 }\; } -if $NFT create flowtable t f { hook ingress priority 10 \; devices = { eth0, wlan0 }\; } 2>/dev/null ; then +$NFT add flowtable t f { hook ingress priority 10 \; devices = { lo }\; } +if $NFT create flowtable t f { hook ingress priority 10 \; devices = { lo }\; } 2>/dev/null ; then echo "E: flowtable creation not failing on existing set" >&2 exit 1 fi -$NFT add flowtable t f { hook ingress priority 10 \; devices = { eth0, wlan0 }\; } +$NFT add flowtable t f { hook ingress priority 10 \; devices = { lo }\; } exit 0 diff --git a/tests/shell/testcases/flowtable/0003add_after_flush_0 b/tests/shell/testcases/flowtable/0003add_after_flush_0 index 1f3cb18a46d9b..481c7edd32858 100755 --- a/tests/shell/testcases/flowtable/0003add_after_flush_0 +++ b/tests/shell/testcases/flowtable/0003add_after_flush_0 @@ -2,7 +2,7 @@ set -e $NFT add table x -$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} +$NFT add flowtable x y { hook ingress priority 0\; devices = { lo }\;} $NFT flush ruleset $NFT add table x -$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} +$NFT add flowtable x y { hook ingress priority 0\; devices = { lo }\;} diff --git a/tests/shell/testcases/flowtable/0004delete_after_add0 b/tests/shell/testcases/flowtable/0004delete_after_add0 deleted file mode 100755 index b72977b37ce6c..0000000000000 --- a/tests/shell/testcases/flowtable/0004delete_after_add0 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -e -$NFT add table x -$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} -$NFT delete flowtable x y diff --git a/tests/shell/testcases/flowtable/0004delete_after_add_0 b/tests/shell/testcases/flowtable/0004delete_after_add_0 new file mode 100755 index 0000000000000..8d9a842d67f75 --- /dev/null +++ b/tests/shell/testcases/flowtable/0004delete_after_add_0 @@ -0,0 +1,6 @@ +#!/bin/bash + +set -e +$NFT add table x +$NFT add flowtable x y { hook ingress priority 0\; devices = { lo }\;} +$NFT delete flowtable x y diff --git a/tests/shell/testcases/flowtable/0005delete_in_use_1 b/tests/shell/testcases/flowtable/0005delete_in_use_1 index ce39e24e601d2..1b239f411f2ae 100755 --- a/tests/shell/testcases/flowtable/0005delete_in_use_1 +++ b/tests/shell/testcases/flowtable/0005delete_in_use_1 @@ -3,7 +3,7 @@ set -e $NFT add table x $NFT add chain x x -$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} +$NFT add flowtable x y { hook ingress priority 0\; devices = { lo }\;} $NFT add rule x x flow offload @y $NFT delete flowtable x y echo "E: delete flowtable in use" diff --git a/tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft b/tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft index 5188b207f47aa..32250699425b4 100755 --- a/tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft +++ b/tests/shell/testcases/flowtable/dumps/0001flowtable_0.nft @@ -1,7 +1,7 @@ table inet t { flowtable f { hook ingress priority 10 - devices = { eth0, wlan0 } + devices = { lo } } chain c { -- 2.16.1 -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html