summaryrefslogtreecommitdiffstats
path: root/iptables-test.py
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-11-03 14:40:26 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-11-03 22:11:21 +0100
commita9f937785bf1cecfd9a2879bcc8ad3a91045b207 (patch)
tree06c0414bd80f4efc38a53b5b04640d12b2d30311 /iptables-test.py
parentb81c8da23720b7e8a55869d677c3cdcbb36b6ddf (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'iptables-test.py')
-rwxr-xr-xiptables-test.py8
1 files changed, 8 insertions, 0 deletions
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