summaryrefslogtreecommitdiffstats
path: root/tests/py/nft-test.py
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-10-02 19:55:49 +0200
committerPhil Sutter <phil@nwl.cc>2024-11-06 11:00:21 +0100
commitc1c0c54e237c880adaa8172b93d7450e6c617cfc (patch)
tree996e7b9fbb07091fd2d012f05be769fb0dbad850 /tests/py/nft-test.py
parentbb6312484af93a83a9ec8716f3887a43566a775a (diff)
tests: py: Fix for storing payload into missing file
When running a test for which no corresponding *.payload file exists, the *.payload.got file name was incorrectly constructed due to 'payload_path' variable not being set. Fixes: 2cfab7a3e10fc ("tests/py: Write dissenting payload into the right file") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'tests/py/nft-test.py')
-rwxr-xr-xtests/py/nft-test.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/py/nft-test.py b/tests/py/nft-test.py
index 00799e28..7acdb77f 100755
--- a/tests/py/nft-test.py
+++ b/tests/py/nft-test.py
@@ -769,10 +769,9 @@ def rule_add(rule, filename, lineno, force_all_family_option, filename_path):
if rule[1].strip() == "ok":
payload_expected = None
- payload_path = None
+ payload_path = "%s.payload" % filename_path
try:
- payload_log = open("%s.payload" % filename_path)
- payload_path = payload_log.name
+ payload_log = open(payload_path)
payload_expected = payload_find_expected(payload_log, rule[0])
except:
payload_log = None