Skip to content

Commit 80a1bfb

Browse files
committed
tests: turn off replay-window setting for most tests
- This is causing some of the hand crafted UT to fail. Signed-off-by: Christian Hopps <[email protected]>
1 parent ffcfaeb commit 80a1bfb

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

tests/common/config.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ def setup_tunnel_routes(r1con, r2con, tun_ipv6, network3):
490490
return r1ipnh, r1ip6nh, r2ipnh, r2ip6nh
491491

492492

493+
def esp_args_filter_dir(direction, esp_args):
494+
"""Filter out esp args inappropriate for the direction."""
495+
if direction != "in":
496+
esp_args = re.sub(r"replay-window \d+", "", esp_args)
497+
return esp_args
498+
499+
493500
def esp_flags_filter_dir(direction, esp_flags):
494501
"""Filter out esp flags inappropriate for the direction."""
495502
if direction == "in":
@@ -523,6 +530,7 @@ async def setup_policy_tun(
523530
trex=False,
524531
r1only=False,
525532
ipsec_intf="eth2",
533+
esp_args="",
526534
esp_flags="",
527535
iptfs_opts="",
528536
ipv4=True,
@@ -594,25 +602,25 @@ async def setup_policy_tun(
594602
#
595603
direction = "out" if r == r1 else "in"
596604
eflags = esp_flags_filter_dir(direction, esp_flags)
597-
esp_args = "replay-window 128" if direction == "in" else ""
605+
eargs = esp_args_filter_dir(direction, esp_args)
598606
repl.cmd_raises(
599607
(
600608
f"ip xfrm state add src {r1ip} dst {r2ip} proto esp "
601609
f"spi {spi_1to2} mode {mode} {sa_auth} {sa_enc} "
602-
f"{esp_args} {eflags} reqid {reqid_1to2} dir {direction} "
610+
f"{eargs} {eflags} reqid {reqid_1to2} dir {direction} "
603611
# f"reqid {reqid_1to2} "
604612
)
605613
+ iptfs_opts_filter_dir(direction, iptfs_opts)
606614
)
607615

608616
direction = "in" if r == r1 else "out"
609617
eflags = esp_flags_filter_dir(direction, esp_flags)
610-
esp_args = "replay-window 128" if direction == "in" else ""
618+
eargs = esp_args_filter_dir(direction, esp_args)
611619
repl.cmd_raises(
612620
(
613621
f"ip xfrm state add src {r2ip} dst {r1ip} proto esp "
614622
f"spi {spi_2to1} mode {mode} {sa_auth} {sa_enc} "
615-
f"{esp_args} {eflags} reqid {reqid_2to1} dir {direction} "
623+
f"{eargs} {eflags} reqid {reqid_2to1} dir {direction} "
616624
# f"reqid {reqid_2to1} "
617625
)
618626
+ iptfs_opts_filter_dir(direction, iptfs_opts)
@@ -757,6 +765,7 @@ async def setup_routed_tun(
757765
r1only=False,
758766
ipsec_intf="eth2",
759767
iptfs_opts="",
768+
esp_args="",
760769
esp_flags="",
761770
ipv4=True,
762771
ipv6=False,
@@ -835,23 +844,23 @@ async def setup_routed_tun(
835844

836845
direction = "out" if r == r1 else "in"
837846
eflags = esp_flags_filter_dir(direction, esp_flags)
838-
esp_args = "replay-window 128" if direction == "in" else ""
847+
eargs = esp_args_filter_dir(direction, esp_args)
839848
repl.cmd_raises(
840849
(
841850
f"ip xfrm state add src {r1ip} dst {r2ip} proto esp "
842851
f"spi {spi_1to2} mode {mode} {sa_auth} {sa_enc} "
843-
f"{esp_args} {eflags} if_id 55 reqid {reqid_1to2} dir {direction} "
852+
f"{eargs} {eflags} if_id 55 reqid {reqid_1to2} dir {direction} "
844853
)
845854
+ iptfs_opts_filter_dir(direction, iptfs_opts)
846855
)
847856
direction = "in" if r == r1 else "out"
848857
eflags = esp_flags_filter_dir(direction, esp_flags)
849-
esp_args = "replay-window 128" if direction == "in" else ""
858+
eargs = esp_args_filter_dir(direction, esp_args)
850859
repl.cmd_raises(
851860
(
852861
f"ip xfrm state add src {r2ip} dst {r1ip} proto esp "
853862
f"spi {spi_2to1} mode {mode} {sa_auth} {sa_enc} "
854-
f"{esp_args} {eflags} if_id 55 reqid {reqid_2to1} dir {direction} "
863+
f"{eargs} {eflags} if_id 55 reqid {reqid_2to1} dir {direction} "
855864
)
856865
+ iptfs_opts_filter_dir(direction, iptfs_opts)
857866
)

tests/flood/test_flood.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ async def test_policy_tun_agg(unet, astepf, tun_ipv6):
7878
await setup_policy_tun(
7979
unet,
8080
mode="iptfs",
81+
esp_args="replay-window 128",
8182
iptfs_opts=f"init-delay {INIT_DELAY}",
8283
ipv6=True,
8384
tun_ipv6=tun_ipv6,
@@ -95,6 +96,7 @@ async def test_routed_tun_agg(unet, astepf, tun_ipv6):
9596
await setup_routed_tun(
9697
unet,
9798
mode="iptfs",
99+
esp_args="replay-window 128",
98100
esp_flags="esn",
99101
iptfs_opts=f"init-delay {INIT_DELAY}",
100102
ipv6=True,

0 commit comments

Comments
 (0)