summaryrefslogtreecommitdiffstats
path: root/tests/py
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2021-06-02 15:28:50 +0200
committerFlorian Westphal <fw@strlen.de>2021-06-02 15:29:16 +0200
commit4359cb82833a6907f9ee9803be270db89ceaf758 (patch)
treead6be47f5f323da2016dd864a4a7985f7db309cc /tests/py
parentc0b685951fabb2852d16cf62a1d1bf5b426e098c (diff)
tests/py: fix error message
This should say "should have failed" only if the set add operation was supposed to fail, not when its supposed to work. Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/py')
-rwxr-xr-xtests/py/nft-test.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 18e9c67f..15e74d8b 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -407,7 +407,11 @@ def set_add_elements(set_element, set_name, state, filename, lineno):
ret = execute_cmd(cmd, filename, lineno)
if (state == "fail" and ret == 0) or (state == "ok" and ret != 0):
- test_state = "This rule should have failed."
+ if state == "fail":
+ test_state = "This rule should have failed."
+ else:
+ test_state = "This rule should not have failed."
+
reason = cmd + ": " + test_state
print_error(reason, filename, lineno)
return -1