From a77a7d8e0ac98126f60f15ce59a0530c658e9ac6 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Mon, 7 May 2018 00:05:11 +0200 Subject: 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 --- iptables-test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'iptables-test.py') 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) -- cgit v1.2.3