Skip to content

Commit 5a62f2c

Browse files
authored
fix the everflow testbed failure on dualtor A-A (#12022)
1 parent 66751e5 commit 5a62f2c

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

tests/everflow/test_everflow_testbed.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
from tests.ptf_runner import ptf_runner
1010
from .everflow_test_utilities import TARGET_SERVER_IP, BaseEverflowTest, DOWN_STREAM, UP_STREAM, DEFAULT_SERVER_IP
11+
12+
from tests.common.dualtor.dual_tor_utils import config_active_active_dualtor_active_standby # noqa F401
13+
from tests.common.dualtor.dual_tor_utils import validate_active_active_dualtor_setup # noqa F401
14+
from tests.common.dualtor.dual_tor_common import active_active_ports # noqa F401
15+
1116
# Module-level fixtures
1217
from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa: F401
1318
from tests.common.fixtures.ptfhost_utils import copy_acstests_directory # noqa: F401
@@ -19,6 +24,7 @@
1924
pytest.mark.topology("t0", "t1", "t2", "m0")
2025
]
2126

27+
logger = logging.getLogger(__name__)
2228

2329
MEGABYTE = 1024 * 1024
2430
DEFAULT_PTF_SOCKET_RCV_SIZE = 1 * MEGABYTE
@@ -79,6 +85,20 @@ class EverflowIPv4Tests(BaseEverflowTest):
7985
DEFAULT_DST_IP = "30.0.0.1"
8086
MIRROR_POLICER_UNSUPPORTED_ASIC_LIST = ["th3", "j2c+", "jr2"]
8187

88+
@pytest.fixture
89+
def setup_active_active_ports(self, active_active_ports, rand_selected_dut, rand_unselected_dut, # noqa F811
90+
config_active_active_dualtor_active_standby, # noqa F811
91+
validate_active_active_dualtor_setup): # noqa F811
92+
if active_active_ports:
93+
# for active-active dualtor, the upstream traffic is ECMPed to both ToRs, so let's
94+
# config the unselected ToR as standby to ensure all ethernet type packets are
95+
# forwarded to the selected ToR.
96+
logger.info("Configuring {} as active".format(rand_selected_dut.hostname))
97+
logger.info("Configuring {} as standby".format(rand_unselected_dut.hostname))
98+
config_active_active_dualtor_active_standby(rand_selected_dut, rand_unselected_dut, active_active_ports)
99+
100+
return
101+
82102
@pytest.fixture(params=[DOWN_STREAM, UP_STREAM])
83103
def dest_port_type(self, setup_info, setup_mirror_session, tbinfo, request): # noqa F811
84104
"""
@@ -128,7 +148,8 @@ def add_dest_routes(self, setup_info, tbinfo, dest_port_type): # noqa F811
128148

129149
def test_everflow_basic_forwarding(self, setup_info, setup_mirror_session, # noqa F811
130150
dest_port_type, ptfadapter, tbinfo,
131-
toggle_all_simulator_ports_to_rand_selected_tor): # noqa F811
151+
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
152+
setup_active_active_ports):
132153
"""
133154
Verify basic forwarding scenarios for the Everflow feature.
134155
@@ -228,7 +249,8 @@ def test_everflow_basic_forwarding(self, setup_info, setup_mirror_session,
228249

229250
def test_everflow_neighbor_mac_change(self, setup_info, setup_mirror_session, # noqa F811
230251
dest_port_type, ptfadapter, tbinfo,
231-
toggle_all_simulator_ports_to_rand_selected_tor): # noqa F811
252+
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
253+
setup_active_active_ports):
232254
"""Verify that session destination MAC address is changed after neighbor MAC address update."""
233255

234256
everflow_dut = setup_info[dest_port_type]['everflow_dut']
@@ -275,6 +297,7 @@ def test_everflow_neighbor_mac_change(self, setup_info, setup_mirror_session,
275297
)
276298

277299
finally:
300+
278301
# Clean up the test
279302
remote_dut.shell(
280303
remote_dut.get_linux_ip_cmd_for_namespace("ip neigh del {} dev {}".format(peer_ip, tx_port),
@@ -296,7 +319,8 @@ def test_everflow_neighbor_mac_change(self, setup_info, setup_mirror_session,
296319

297320
def test_everflow_remove_unused_ecmp_next_hop(self, setup_info, setup_mirror_session, # noqa F811
298321
dest_port_type, ptfadapter, tbinfo,
299-
toggle_all_simulator_ports_to_rand_selected_tor): # noqa F811
322+
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
323+
setup_active_active_ports):
300324
"""Verify that session is still active after removal of next hop from ECMP route that was not in use."""
301325

302326
everflow_dut = setup_info[dest_port_type]['everflow_dut']
@@ -387,7 +411,8 @@ def test_everflow_remove_unused_ecmp_next_hop(self, setup_info, setup_mirror_ses
387411

388412
def test_everflow_remove_used_ecmp_next_hop(self, setup_info, setup_mirror_session, # noqa F811
389413
dest_port_type, ptfadapter, tbinfo,
390-
toggle_all_simulator_ports_to_rand_selected_tor): # noqa F811
414+
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
415+
setup_active_active_ports):
391416
"""Verify that session is still active after removal of next hop from ECMP route that was in use."""
392417

393418
everflow_dut = setup_info[dest_port_type]['everflow_dut']
@@ -498,7 +523,8 @@ def test_everflow_dscp_with_policer(
498523
partial_ptf_runner,
499524
config_method,
500525
tbinfo,
501-
toggle_all_simulator_ports_to_rand_selected_tor # noqa F811
526+
toggle_all_simulator_ports_to_rand_selected_tor, # noqa F811
527+
setup_active_active_ports
502528
):
503529
"""Verify that we can rate-limit mirrored traffic from the MIRROR_DSCP table.
504530
This tests single rate three color policer mode and specifically checks CIR value

0 commit comments

Comments
 (0)