diff options
author | Florian Westphal <fw@strlen.de> | 2018-11-02 12:06:30 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-11-03 20:35:22 +0100 |
commit | fb747f8ae01bdcbb197f5f9fc1085416ad636d38 (patch) | |
tree | 0f69061aa404139133f1a5913314f0049b8335a5 /iptables-test.py | |
parent | d4bc5a38598b479b124973a821324ce867e87760 (diff) |
tests: add basic ebtables test support
now that we have ebtables-save, lets add test cases for ebtables-nft
as well.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables-test.py')
-rwxr-xr-x | iptables-test.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/iptables-test.py b/iptables-test.py index 331fe59d..c199d509 100755 --- a/iptables-test.py +++ b/iptables-test.py @@ -17,11 +17,11 @@ import argparse IPTABLES = "iptables" IP6TABLES = "ip6tables" -#IPTABLES = "xtables -4" -#IP6TABLES = "xtables -6" +EBTABLES = "ebtables" IPTABLES_SAVE = "iptables-save" IP6TABLES_SAVE = "ip6tables-save" +EBTABLES_SAVE = "ebtables-save" #IPTABLES_SAVE = ['xtables-save','-4'] #IP6TABLES_SAVE = ['xtables-save','-6'] @@ -111,6 +111,8 @@ def run_test(iptables, rule, rule_save, res, filename, lineno, netns): command = IPTABLES_SAVE elif splitted[0] == IP6TABLES: command = IP6TABLES_SAVE + elif splitted[0] == EBTABLES: + command = EBTABLES_SAVE path = os.path.abspath(os.path.curdir) + "/iptables/" + EXECUTEABLE command = path + " " + command @@ -157,7 +159,7 @@ 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 '): + if cmd.startswith('iptables ') or cmd.startswith('ip6tables ') or cmd.startswith('ebtables '): cmd = os.path.abspath(os.path.curdir) + "/iptables/" + EXECUTEABLE + " " + cmd print >> log_file, "command: %s" % cmd @@ -190,6 +192,11 @@ def run_test_file(filename, netns): iptables = IP6TABLES elif "libxt_" in filename: iptables = IPTABLES + elif "libebt_" in filename: + # only supported with nf_tables backend + if EXECUTEABLE != "xtables-nft-multi": + return 0, 0 + iptables = EBTABLES else: # default to iptables if not known prefix iptables = IPTABLES |