summaryrefslogtreecommitdiffstats
path: root/xlate-test.py
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2023-11-07 12:15:39 +0100
committerPhil Sutter <phil@nwl.cc>2023-11-07 23:40:14 +0100
commit50f40b2c05e11ab0276b2dd6d860855968358bb5 (patch)
tree29f98b7c1600958e9f8d7280dd83ecae0d33475e /xlate-test.py
parent5b7324e0675e332ae186e1bd6978aa320f628086 (diff)
arptables-txlate: add test cases
Add test cases for libarpt_mangle and extend the generic tests to cover basic arptables matches. Note that there are several historic artefacts that could be revised. For example, arptables-legacy and arptables-nft both ignore "-p" instead of returning an error about an unsupported option. The ptype could be hard-wired to 0x800 and set unconditionally. OTOH, this should always match for ethernet arp packets anyway. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'xlate-test.py')
-rwxr-xr-xxlate-test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlate-test.py b/xlate-test.py
index 6a116598..ddd68b91 100755
--- a/xlate-test.py
+++ b/xlate-test.py
@@ -14,7 +14,7 @@ def run_proc(args, shell = False, input = None):
output, error = process.communicate(input)
return (process.returncode, output, error)
-keywords = ("iptables-translate", "ip6tables-translate", "ebtables-translate")
+keywords = ("iptables-translate", "ip6tables-translate", "arptables-translate", "ebtables-translate")
xtables_nft_multi = 'xtables-nft-multi'
if sys.stdout.isatty():
@@ -95,6 +95,8 @@ def test_one_replay(name, sourceline, expected, result):
fam = ""
if srccmd.startswith("ip6"):
fam = "ip6 "
+ elif srccmd.startswith("arp"):
+ fam = "arp "
elif srccmd.startswith("ebt"):
fam = "bridge "