Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions tests/arp/test_arp_dualtor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,14 @@ def pause_arp_update(duthosts):


@pytest.fixture(params=['IPv4', 'IPv6'])
def neighbor_ip(request, mux_config): # noqa F811
"""
Provide the neighbor IP used for testing

Randomly select an IP from the server IPs configured in the config DB MUX_CABLE table
"""
def selected_mux_port(request, mux_config): # noqa F811
"""Randomly select a mux port for testing."""
ip_version = request.param
selected_intf = random.choice(list(mux_config.values()))
neigh_ip = ip_interface(selected_intf["SERVER"][ip_version]).ip
cable_type = selected_intf["SERVER"].get("cable_type", "active-standby")
logger.info("Using {} as neighbor IP".format(neigh_ip))
return neigh_ip
return selected_intf, neigh_ip, cable_type


@pytest.fixture
Expand Down Expand Up @@ -135,7 +132,7 @@ def test_proxy_arp_for_standby_neighbor(proxy_arp_enabled, ip_and_intf_info, res


def test_arp_update_for_failed_standby_neighbor(
config_dualtor_arp_responder, neighbor_ip, clear_neighbor_table, # noqa F811
config_dualtor_arp_responder, selected_mux_port, clear_neighbor_table, # noqa F811
toggle_all_simulator_ports_to_rand_selected_tor, rand_selected_dut, rand_unselected_dut # noqa F811
):
"""
Expand All @@ -149,6 +146,11 @@ def test_arp_update_for_failed_standby_neighbor(
4. Run `arp_update` on the active ToR
5. Verify the incomplete entry is now reachable
"""
_, neighbor_ip, cable_type = selected_mux_port

if cable_type == "active-active":
pytest.skip("Skip as the testcase is designed for active-standby mux port.")

if ip_address(neighbor_ip).version == 6 and rand_unselected_dut.facts["asic_type"] == "vs":
pytest.skip("Temporarily skipped to let the sonic-swss submodule be updated.")
# We only use ping to trigger an ARP request from the kernel, so exit early to save time
Expand Down Expand Up @@ -181,8 +183,9 @@ def test_arp_update_for_failed_standby_neighbor(


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