path: root/tests/shell/testcases/flowtable
diff options
authorFlorian Westphal <>2019-01-04 15:57:00 +0100
committerFlorian Westphal <>2019-01-04 16:00:31 +0100
commit4d26b6dd3c4c8354a88c4a1aef8ea33229f0a4cc (patch)
tree1e82c9b480038033c65cd7d17b08f24e149bcd82 /tests/shell/testcases/flowtable
parenteb49882deb3e9ec5eccd6e6106b454e3a6394408 (diff)
tests: shell: change all test scripts to return 0
The shell-based tests currently encode a return value in the file name, i.e. foo_1 expects that the script should return '1' for the test case to pass. This is very error prone, and one test case is even broken (i.e., it returns 1, but because of a different, earlier error). do_something || exit 1 or 'set -e' are both pretty common patterns, in both cases tests should fail. In those test-cases that deliberately test for an error, nft something_should_fail || exit 0 nft something_should_fail && exit 1 or a similar constructs should be used. This initial commit modififies all '_1' scripts to return 0 on success, usually via 'nft wrong || exit 0'. All tests pass, except the one broken test case that hasn't worked before either, but where 'set -e' use made it pass (the failing command is supposed to work, and the command that is supposed to fail is never run). Signed-off-by: Florian Westphal <>
Diffstat (limited to 'tests/shell/testcases/flowtable')
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/shell/testcases/flowtable/0005delete_in_use_1 b/tests/shell/testcases/flowtable/0005delete_in_use_1
index 1b239f41..149d6444 100755
--- a/tests/shell/testcases/flowtable/0005delete_in_use_1
+++ b/tests/shell/testcases/flowtable/0005delete_in_use_1
@@ -5,5 +5,7 @@ $NFT add table x
$NFT add chain x x
$NFT add flowtable x y { hook ingress priority 0\; devices = { lo }\;}
$NFT add rule x x flow offload @y
-$NFT delete flowtable x y
+$NFT delete flowtable x y || exit 0
echo "E: delete flowtable in use"
+exit 1
diff --git a/tests/shell/testcases/flowtable/0008prio_1 b/tests/shell/testcases/flowtable/0008prio_1
index 87084b93..48953d79 100755
--- a/tests/shell/testcases/flowtable/0008prio_1
+++ b/tests/shell/testcases/flowtable/0008prio_1
@@ -7,8 +7,8 @@ do
if (($? == 0))
echo "E: $prioname should not be a valid priority name for flowtables" >&2
- exit 0
+ exit 1
-exit 1
+exit 0