Skip to content

Commit 9dc2244

Browse files
authored
[202411][dualtor-aa] Fix test_arp_dualtor on active-active dualtor (sonic-net#18073)
* [dualtor-aa] Skip `test_arp_update_for_failed_standby_neighbor` Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
1 parent cf12a33 commit 9dc2244

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

tests/arp/test_arp_dualtor.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,14 @@ def pause_arp_update(duthosts):
6363

6464

6565
@pytest.fixture(params=['IPv4', 'IPv6'])
66-
def neighbor_ip(request, mux_config): # noqa F811
67-
"""
68-
Provide the neighbor IP used for testing
69-
70-
Randomly select an IP from the server IPs configured in the config DB MUX_CABLE table
71-
"""
66+
def selected_mux_port(request, mux_config): # noqa F811
67+
"""Randomly select a mux port for testing."""
7268
ip_version = request.param
7369
selected_intf = random.choice(list(mux_config.values()))
7470
neigh_ip = ip_interface(selected_intf["SERVER"][ip_version]).ip
71+
cable_type = selected_intf["SERVER"].get("cable_type", "active-standby")
7572
logger.info("Using {} as neighbor IP".format(neigh_ip))
76-
return neigh_ip
73+
return selected_intf, neigh_ip, cable_type
7774

7875

7976
@pytest.fixture
@@ -135,7 +132,7 @@ def test_proxy_arp_for_standby_neighbor(proxy_arp_enabled, ip_and_intf_info, res
135132

136133

137134
def test_arp_update_for_failed_standby_neighbor(
138-
config_dualtor_arp_responder, neighbor_ip, clear_neighbor_table, # noqa F811
135+
config_dualtor_arp_responder, selected_mux_port, clear_neighbor_table, # noqa F811
139136
toggle_all_simulator_ports_to_rand_selected_tor, rand_selected_dut, rand_unselected_dut # noqa F811
140137
):
141138
"""
@@ -149,6 +146,11 @@ def test_arp_update_for_failed_standby_neighbor(
149146
4. Run `arp_update` on the active ToR
150147
5. Verify the incomplete entry is now reachable
151148
"""
149+
_, neighbor_ip, cable_type = selected_mux_port
150+
151+
if cable_type == "active-active":
152+
pytest.skip("Skip as the testcase is designed for active-standby mux port.")
153+
152154
if ip_address(neighbor_ip).version == 6 and rand_unselected_dut.facts["asic_type"] == "vs":
153155
pytest.skip("Temporarily skipped to let the sonic-swss submodule be updated.")
154156
# We only use ping to trigger an ARP request from the kernel, so exit early to save time
@@ -181,8 +183,9 @@ def test_arp_update_for_failed_standby_neighbor(
181183

182184

183185
def test_standby_unsolicited_neigh_learning(
184-
config_dualtor_arp_responder, neighbor_ip, clear_neighbor_table, # noqa F811
185-
toggle_all_simulator_ports_to_rand_selected_tor, rand_selected_dut, rand_unselected_dut # noqa F811
186+
config_dualtor_arp_responder, selected_mux_port, clear_neighbor_table, # noqa F811
187+
toggle_all_simulator_ports_to_rand_selected_tor, rand_selected_dut, rand_unselected_dut, # noqa F811
188+
setup_standby_ports_on_rand_unselected_tor # noqa F811
186189
):
187190
"""
188191
Test the standby ToR's ability to perform unsolicited neighbor learning (GARP and unsolicited NA)
@@ -192,6 +195,7 @@ def test_standby_unsolicited_neigh_learning(
192195
2. Run arp_update on the active ToR
193196
3. Confirm that the standby ToR learned the entry and it is REACHABLE
194197
"""
198+
neighbor_ip = selected_mux_port[1]
195199
if ip_address(neighbor_ip).version == 6 and rand_unselected_dut.facts["asic_type"] == "vs":
196200
pytest.skip("Temporarily skipped to let the sonic-swss submodule be updated.")
197201
ping_cmd = "timeout 0.2 ping -c1 -W1 -i0.2 -n -q {}".format(neighbor_ip)

0 commit comments

Comments
 (0)