Skip to content

tests: xlate: generic.txlate to pass replay test

Phil Sutter netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ebtables: Implement --check commandiptables/xtables-eb.c+9 -35 replies
2/7tests: xlate: Use --check to verify replayxlate-test.py+18 -280 replies
3/7nft: Fix for comparing ifname matches against nft-generated onesiptables/nft-shared.c+1 -10 replies
4/7nft: Fix match generator for '! -i +'iptables/nft-shared.c+6 -04 replies
5/7nft: Recognize INVAL/D interface nameiptables/nft-shared.c+19 -00 replies
6/7xtables-translate: Fix for interfaces with asterisk mid-stringextensions/generic.txlate iptables/xtables-translate.c+10 -80 replies
7/7ebtables: Fix MAC address match translationextensions/generic.txlate iptables/nft-bridge.c+4 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [iptables PATCH 0/7] tests: xlate: generic.txlate to pass replay test

Instead of dumping the ruleset with xtables-save and creating yet another string comparison mess by searching the output, use --check command to leverage iptables' internal rule comparison functionality when checking that the nftables-created rule parses correctly as the source of the translation (patch 2).

There was a rub with the above, namely ebtables not supporting --check in the first place. Gladly the implementation is pretty simple (patch
1) with one caveat: '-C' itself is not available so add the long option only.

The remaining patches deal with translation details (mostly around wildcard interface names) until generic.txlate finally passes the replay test.

Phil Sutter (7):
ebtables: Implement --check command
tests: xlate: Use --check to verify replay
nft: Fix for comparing ifname matches against nft-generated ones
nft: Fix match generator for '! -i +'
nft: Recognize INVAL/D interface name
xtables-translate: Fix for interfaces with asterisk mid-string
ebtables: Fix MAC address match translation

 extensions/generic.txlate    | 16 ++++++-------
 iptables/nft-bridge.c        |  6 ++---
 iptables/nft-shared.c        | 27 ++++++++++++++++++++-
 iptables/xtables-eb.c        | 12 +++++++---
 iptables/xtables-translate.c |  4 +++-
 xlate-test.py                | 46 ++++++++++++++----------------------
 6 files changed, 67 insertions(+), 44 deletions(-)
Signature · 1 line
2.38.0