Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 1 addition & 8 deletions tests/common/dualtor/dual_tor_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
ip_address, IPv4Address
from tests.common import config_reload
from tests.common.dualtor.dual_tor_utils import tor_mux_intfs
from tests.common.helpers.assertions import pytest_require, pytest_assert
from tests.common.helpers.assertions import pytest_assert
from tests.common.platform.processes_utils import wait_critical_processes

__all__ = [
'require_mocked_dualtor',
'apply_active_state_to_orchagent',
'apply_dual_tor_neigh_entries',
'apply_dual_tor_peer_switch_route',
Expand Down Expand Up @@ -139,12 +138,6 @@ def is_mocked_dualtor(tbinfo):
return 'dualtor' not in tbinfo['topo']['name']


@pytest.fixture
def require_mocked_dualtor(tbinfo):
pytest_require(is_t0_mocked_dualtor(tbinfo), "This testcase is designed for "
"single tor testbed with mock dualtor config. Skip this testcase on real dualtor testbed")


def set_mux_state(dut, tbinfo, state, itfs, toggle_all_simulator_ports):
if is_mocked_dualtor(tbinfo):
set_dual_tor_state_to_orchagent(dut, state, itfs)
Expand Down
58 changes: 58 additions & 0 deletions tests/common/plugins/conditional_mark/tests_mark_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,70 @@ drop_packets:
#######################################
##### dualtor #####
#######################################
dualtor/test_orch_stress.py:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_active_tor_downstream.py:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_mac_move.py:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_standby_tor_downstream.py::test_standby_tor_downstream:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_standby_tor_downstream.py::test_standby_tor_downstream_t1_link_recovered:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_standby_tor_downstream.py::test_standby_tor_downstream_bgp_recovered:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_standby_tor_downstream.py::test_standby_tor_downstream_loopback_route_readded:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config and dualtor."
conditions:
- "(topo_type not in ['t0'])"

dualtor/test_orchagent_standby_tor_downstream.py::test_standby_tor_remove_neighbor_downstream_standby:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

dualtor/test_orchagent_standby_tor_downstream.py::test_downstream_standby_mux_toggle_active:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"
xfail:
reason: "Image issue on Boradcom platforms, but not consistently failing"
conditions:
- "asic_type in ['broadcom']"

dualtor/test_standby_tor_upstream_mux_toggle.py:
skip:
reason: "This testcase is designed for single tor testbed with mock dualtor config."
conditions:
- "(topo_type not in ['t0']) or ('dualtor' in topo_name)"

#######################################
##### dut_console #####
#######################################
Expand Down
3 changes: 0 additions & 3 deletions tests/dualtor/test_orch_stress.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def config_crm_polling_interval(rand_selected_dut):


def test_change_mux_state(
require_mocked_dualtor,
apply_mock_dual_tor_tables,
apply_mock_dual_tor_kernel_configs,
rand_selected_dut,
Expand Down Expand Up @@ -215,7 +214,6 @@ def add_neighbors(dut, neighbors, interface):


def test_flap_neighbor_entry_active(
require_mocked_dualtor,
apply_mock_dual_tor_tables,
apply_mock_dual_tor_kernel_configs,
rand_selected_dut,
Expand Down Expand Up @@ -249,7 +247,6 @@ def test_flap_neighbor_entry_active(


def test_flap_neighbor_entry_standby(
require_mocked_dualtor,
apply_mock_dual_tor_tables,
apply_mock_dual_tor_kernel_configs,
rand_selected_dut,
Expand Down
6 changes: 2 additions & 4 deletions tests/dualtor/test_orchagent_active_tor_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ def neighbor_reachable(duthost, neighbor_ip):

def test_active_tor_remove_neighbor_downstream_active(
conn_graph_facts, ptfadapter, ptfhost, testbed_setup,
rand_selected_dut, tbinfo,
require_mocked_dualtor, set_crm_polling_interval,
rand_selected_dut, tbinfo, set_crm_polling_interval,
tunnel_traffic_monitor, vmhost
):
"""
Expand Down Expand Up @@ -139,8 +138,7 @@ def remove_neighbor(ptfhost, duthost, server_ip, ip_version, neighbor_details):

def test_downstream_ecmp_nexthops(
ptfadapter, rand_selected_dut, tbinfo,
require_mocked_dualtor, toggle_all_simulator_ports,
tor_mux_intfs, ip_version
toggle_all_simulator_ports, tor_mux_intfs, ip_version
):
nexthops_count = 4
set_mux_state(rand_selected_dut, tbinfo, 'active', tor_mux_intfs, toggle_all_simulator_ports)
Expand Down
1 change: 0 additions & 1 deletion tests/dualtor/test_orchagent_mac_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def enable_garp(duthost):


def test_mac_move(
require_mocked_dualtor,
announce_new_neighbor, apply_active_state_to_orchagent,
conn_graph_facts, ptfadapter, ptfhost,
rand_selected_dut, set_crm_polling_interval,
Expand Down
19 changes: 7 additions & 12 deletions tests/dualtor/test_orchagent_standby_tor_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa: F401
from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa: F401
from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa: F401 # lgtm[py/unused-import]
from tests.common.helpers.assertions import pytest_require as pt_require
from tests.common.helpers.assertions import pytest_assert as pt_assert
from tests.common.dualtor.tunnel_traffic_utils import tunnel_traffic_monitor # noqa: F401
from tests.common.dualtor.server_traffic_utils import ServerTrafficMonitor
Expand Down Expand Up @@ -128,7 +127,7 @@ def shutdown_one_bgp_session(rand_selected_dut):
startup_bgp_session(rand_selected_dut, bgp_shutdown)


def test_standby_tor_downstream(rand_selected_dut, require_mocked_dualtor, get_testbed_params):
def test_standby_tor_downstream(rand_selected_dut, get_testbed_params):
"""
Verify tunnel traffic to active ToR is distributed equally across nexthops, and
no traffic is forwarded to server from standby ToR
Expand All @@ -138,8 +137,7 @@ def test_standby_tor_downstream(rand_selected_dut, require_mocked_dualtor, get_t


def test_standby_tor_downstream_t1_link_recovered(
rand_selected_dut, require_mocked_dualtor,
verify_crm_nexthop_counter_not_increased, tbinfo, get_testbed_params
rand_selected_dut, verify_crm_nexthop_counter_not_increased, tbinfo, get_testbed_params
):
"""
Verify traffic is distributed evenly after t1 link is recovered;
Expand Down Expand Up @@ -167,16 +165,14 @@ def test_standby_tor_downstream_t1_link_recovered(


def test_standby_tor_downstream_bgp_recovered(
rand_selected_dut, require_mocked_dualtor, verify_crm_nexthop_counter_not_increased,
rand_selected_dut, verify_crm_nexthop_counter_not_increased,
get_testbed_params, tbinfo
):
"""
Verify traffic is shifted to the active links and no traffic drop observed;
Verify traffic is distributed evenly after BGP session is recovered;
Verify CRM that no new nexthop created
"""
# require real dualtor, because for mocked testbed, the route to standby is mocked.
pt_require('dualtor' in tbinfo['topo']['name'], "Only run on dualtor testbed")
PAUSE_TIME = 30

down_bgp = shutdown_random_one_bgp_session(rand_selected_dut)
Expand Down Expand Up @@ -225,7 +221,6 @@ def test_standby_tor_downstream_loopback_route_readded(
"""
Verify traffic is equally distributed via loopback route
"""
pt_require('dualtor' in tbinfo['topo']['name'], "Only run on dualtor testbed")
params = get_testbed_params()
active_tor_loopback0 = params['active_tor_ip']

Expand Down Expand Up @@ -253,8 +248,8 @@ def test_standby_tor_downstream_loopback_route_readded(
def test_standby_tor_remove_neighbor_downstream_standby(
conn_graph_facts, ptfadapter, ptfhost,
rand_selected_dut, rand_unselected_dut, tbinfo,
require_mocked_dualtor, set_crm_polling_interval,
tunnel_traffic_monitor, vmhost, get_testbed_params, # noqa: F811
set_crm_polling_interval, tunnel_traffic_monitor, # noqa: F811
vmhost, get_testbed_params,
ip_version
):
"""
Expand Down Expand Up @@ -310,8 +305,8 @@ def stop_neighbor_advertiser(ptfhost, ip_version):
def test_downstream_standby_mux_toggle_active(
conn_graph_facts, ptfadapter, ptfhost,
rand_selected_dut, rand_unselected_dut, tbinfo,
require_mocked_dualtor, tunnel_traffic_monitor, # noqa: F811
vmhost, toggle_all_simulator_ports, tor_mux_intfs, # noqa: F811
tunnel_traffic_monitor, vmhost, # noqa: F811
toggle_all_simulator_ports, tor_mux_intfs, # noqa: F811
ip_version, get_testbed_params
):
# set rand_selected_dut as standby and rand_unselected_dut to active tor
Expand Down
4 changes: 1 addition & 3 deletions tests/dualtor/test_standby_tor_upstream_mux_toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_cleanup(rand_selected_dut):

def test_standby_tor_upstream_mux_toggle(
rand_selected_dut, tbinfo, ptfadapter, rand_selected_interface,
require_mocked_dualtor, toggle_all_simulator_ports, set_crm_polling_interval):
toggle_all_simulator_ports, set_crm_polling_interval):
itfs, ip = rand_selected_interface
PKT_NUM = 100
# Step 1. Set mux state to standby and verify traffic is dropped by ACL rule and drop counters incremented
Expand Down Expand Up @@ -77,5 +77,3 @@ def test_standby_tor_upstream_mux_toggle(
crm_facts1 = rand_selected_dut.get_crm_facts()
unmatched_crm_facts = compare_crm_facts(crm_facts0, crm_facts1)
pt_assert(len(unmatched_crm_facts)==0, 'Unmatched CRM facts: {}'.format(json.dumps(unmatched_crm_facts, indent=4)))