[iptables PATCH 07/12] tests: xlate: Print failing command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 xlate-test.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xlate-test.py b/xlate-test.py
index ddd68b91d3a7e..b6a78bb250e27 100755
--- a/xlate-test.py
+++ b/xlate-test.py
@@ -41,9 +41,10 @@ xtables_nft_multi = 'xtables-nft-multi'
 
 
 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
 
-- 
2.41.0




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux