From: Florian Westphal Date: Sun, 6 May 2018 22:05:11 +0000 (+0200) Subject: iptables-test: fix bug with rateest X-Git-Tag: v1.8.0~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a77a7d8e0ac98126f60f15ce59a0530c658e9ac6;p=thirdparty%2Fiptables.git 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 --- 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)