summaryrefslogtreecommitdiffstats
path: root/xlate-test.py
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-11-19 11:23:09 +0100
committerPhil Sutter <phil@nwl.cc>2023-11-23 17:59:42 +0100
commit6151cb5f74b9620274ef1374fb3c3c517a6d6a3b (patch)
tree2533c52291b2a35cca005339642dd07588912475 /xlate-test.py
parent267f83f5e1b3fb5b82973c154c8b445701be0a58 (diff)
tests: xlate: Print failing command line
If the command segfaults, 'error' variable is empty and the resulting error message is even misleading as the called program may not have been iptables-translate. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'xlate-test.py')
-rwxr-xr-xxlate-test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/xlate-test.py b/xlate-test.py
index ddd68b91..b6a78bb2 100755
--- a/xlate-test.py
+++ b/xlate-test.py
@@ -41,9 +41,10 @@ def green(string):
def test_one_xlate(name, sourceline, expected, result):
- rc, output, error = run_proc([xtables_nft_multi] + shlex.split(sourceline))
+ cmd = [xtables_nft_multi] + shlex.split(sourceline)
+ rc, output, error = run_proc(cmd)
if rc != 0:
- result.append(name + ": " + red("Error: ") + "iptables-translate failure")
+ result.append(name + ": " + red("Error: ") + "Call failed: " + " ".join(cmd))
result.append(error)
return False