]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables-test.py: Fix --host mode
authorPhil Sutter <phil@nwl.cc>
Tue, 18 Feb 2020 15:43:16 +0000 (16:43 +0100)
committerPhil Sutter <phil@nwl.cc>
Mon, 24 Feb 2020 11:04:15 +0000 (12:04 +0100)
In some cases, the script still called repo binaries. Avoid this when in
--host mode to allow testing without the need to compile sources in
beforehand.

Fixes: 1b5d762c1865e ("iptables-test: Support testing host binaries")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables-test.py

index fdb4e6a3644e4743f22abbe6fc9f049c6493ece1..e986d7a318218de6217f77b1593ca0e14f50f063 100755 (executable)
@@ -119,8 +119,7 @@ def run_test(iptables, rule, rule_save, res, filename, lineno, netns):
         elif splitted[0] == EBTABLES:
             command = EBTABLES_SAVE
 
-    path = os.path.abspath(os.path.curdir) + "/iptables/" + EXECUTEABLE
-    command = path + " " + command
+    command = EXECUTEABLE + " " + command
 
     if netns:
             command = "ip netns exec ____iptables-container-test " + command
@@ -165,7 +164,7 @@ def execute_cmd(cmd, filename, lineno):
     '''
     global log_file
     if cmd.startswith('iptables ') or cmd.startswith('ip6tables ') or cmd.startswith('ebtables ') or cmd.startswith('arptables '):
-        cmd = os.path.abspath(os.path.curdir) + "/iptables/" + EXECUTEABLE + " " + cmd
+        cmd = EXECUTEABLE + " " + cmd
 
     print("command: {}".format(cmd), file=log_file)
     ret = subprocess.call(cmd, shell=True, universal_newlines=True,