summaryrefslogtreecommitdiffstats
path: root/iptables-test.py
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2018-05-07 00:05:11 +0200
committerFlorian Westphal <fw@strlen.de>2018-05-07 00:08:09 +0200
commita77a7d8e0ac98126f60f15ce59a0530c658e9ac6 (patch)
tree9a686d1645b5bc8ae99d7ad10e7e843f96436bed /iptables-test.py
parentde874054ec26a78ce83ccf13c449a4d3c4a5778e (diff)
iptables-test: fix bug with rateest
rateest test needs to insert rateest targets with @progname syntax. However, this used the system-installed binary rather than the one from git. Morever, it did not respect --nftables switch, i.e. add occurs with iptables so iptables-compat won't find it. Fixes: d7ac61b58e78 ("add nft switch and test binaries from git") Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables-test.py')
-rwxr-xr-xiptables-test.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/iptables-test.py b/iptables-test.py
index f3ec1b5c..75095d2d 100755
--- a/iptables-test.py
+++ b/iptables-test.py
@@ -51,7 +51,7 @@ def delete_rule(iptables, rule, filename, lineno):
'''
Removes an iptables rule
'''
- cmd = EXECUTEABLE + " " + iptables + " -D " + rule
+ cmd = iptables + " -D " + rule
ret = execute_cmd(cmd, filename, lineno)
if ret == 1:
reason = "cannot delete: " + iptables + " -I " + rule
@@ -75,7 +75,7 @@ def run_test(iptables, rule, rule_save, res, filename, lineno):
'''
ret = 0
- cmd = EXECUTEABLE + " " + iptables + " -A " + rule
+ cmd = iptables + " -A " + rule
ret = execute_cmd(cmd, filename, lineno)
#
@@ -144,6 +144,9 @@ def execute_cmd(cmd, filename, lineno):
:param lineno: line number being tested (used for print_error purposes)
'''
global log_file
+ if cmd.startswith('iptables ') or cmd.startswith('ip6tables '):
+ cmd = os.path.abspath(os.path.curdir) + "/iptables/" + EXECUTEABLE + " " + cmd
+
print >> log_file, "command: %s" % cmd
ret = subprocess.call(cmd, shell=True, universal_newlines=True,
stderr=subprocess.STDOUT, stdout=log_file)