diff options
author | Florian Westphal <fw@strlen.de> | 2023-08-17 18:57:54 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-08-17 18:57:54 +0200 |
commit | 22a8e9d6471641086d7e0f9c5f782fbe30f76f21 (patch) | |
tree | f12478999b8d9470b72ab0ad91630e9ecdbfcc70 /tests | |
parent | 02d660b060abccaec665b0bd8a835037a5704f1a (diff) |
tests: add table validation check
Pablo noticed problems with commit validation, investigation
shows nfnetlink can retry forever in infinite -EAGAIN cycle,
test for this.
The process is killable, this only hogs cpu. Add a test for this.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/shell/testcases/transactions/bad_expression | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/shell/testcases/transactions/bad_expression b/tests/shell/testcases/transactions/bad_expression new file mode 100755 index 00000000..df46ceb0 --- /dev/null +++ b/tests/shell/testcases/transactions/bad_expression @@ -0,0 +1,29 @@ +#!/bin/sh + +# table with invalid expression (masquerade called from filter table). +# nft must return an error. Also catch nfnetlink retry loops that +# cause nft or kernel to spin. +timeout 3 $NFT -f - <<EOF +table ip t1 { + chain a { + masquerade + } + chain input { + type filter hook input priority 1; + jump a + } +} +EOF + +rc=$? +if [ $rc -eq 0 ]; then + exit 111 +fi + +# 124 means 'command timed out', fail if this +# happens. Else, pass, failure is wanted here. +if [ $rc -ne 124 ]; then + exit 0 +fi + +exit $rc |