From a9f937785bf1cecfd9a2879bcc8ad3a91045b207 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 3 Nov 2018 14:40:26 +0100 Subject: iptables-tests: add % to run iptables commands Lines starting by % allows you to run iptables commands, use it for rateest test. Signed-off-by: Pablo Neira Ayuso --- iptables-test.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'iptables-test.py') diff --git a/iptables-test.py b/iptables-test.py index 7858f187..34a04042 100755 --- a/iptables-test.py +++ b/iptables-test.py @@ -227,6 +227,14 @@ def run_test_file(filename, netns): execute_cmd(external_cmd, filename, lineno) continue + # external iptables invocation, executed as is. + if line[0] == "%": + external_cmd = line.rstrip()[1:] + if netns: + external_cmd = "ip netns exec ____iptables-container-test " + EXECUTEABLE + " " + external_cmd + execute_cmd(external_cmd, filename, lineno) + continue + if line[0] == "*": table = line.rstrip()[1:] continue -- cgit v1.2.3