diff --git a/tests/bgp/conftest.py b/tests/bgp/conftest.py index 4472ed6e469..1825036b411 100644 --- a/tests/bgp/conftest.py +++ b/tests/bgp/conftest.py @@ -452,7 +452,7 @@ def _get_namespace(minigraph_config, intf): elif tbinfo["topo"]["type"] in set(["t1", "t2"]): setup_func = _setup_interfaces_t1_or_t2 elif tbinfo["topo"]["type"] == "m0": - if topo_scenario == "m0_t1_scenario": + if topo_scenario == "m0_l3_scenario": setup_func = _setup_interfaces_t1_or_t2 else: setup_func = _setup_interfaces_t0_or_mx diff --git a/tests/common/helpers/constants.py b/tests/common/helpers/constants.py index e46b8cfdc71..97b84773838 100644 --- a/tests/common/helpers/constants.py +++ b/tests/common/helpers/constants.py @@ -12,7 +12,9 @@ "t1": "t2", "m0": "m1", "mx": "m0", - "t2": "t3" + "t2": "t3", + "m0_vlan": "m1", + "m0_l3": "m1" } # Describe downstream neighbor of dut in different topos DOWNSTREAM_NEIGHBOR_MAP = { @@ -20,5 +22,7 @@ "t1": "t0", "m0": "mx", "mx": "server", - "t2": "t1" + "t2": "t1", + "m0_vlan": "server", + "m0_l3": "mx" } diff --git a/tests/conftest.py b/tests/conftest.py index de48c1ff895..3f80cdcdad6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1342,7 +1342,7 @@ def pytest_generate_tests(metafunc): if 'topo_scenario' in metafunc.fixturenames: if tbinfo['topo']['type'] == 'm0' and 'topo_scenario' in metafunc.fixturenames: - metafunc.parametrize('topo_scenario', ['m0_t0_scenario', 'm0_t1_scenario'], scope='module') + metafunc.parametrize('topo_scenario', ['m0_vlan_scenario', 'm0_l3_scenario'], scope='module') else: metafunc.parametrize('topo_scenario', ['default'], scope='module') diff --git a/tests/everflow/everflow_test_utilities.py b/tests/everflow/everflow_test_utilities.py index c91f53f585b..a83d34cc956 100644 --- a/tests/everflow/everflow_test_utilities.py +++ b/tests/everflow/everflow_test_utilities.py @@ -46,10 +46,10 @@ DOWN_STREAM = "downstream" UP_STREAM = "upstream" # Topo that downstream neighbor of DUT are servers -DOWNSTREAM_SERVER_TOPO = ["t0"] +DOWNSTREAM_SERVER_TOPO = ["t0", "m0_vlan"] -def gen_setup_information(downStreamDutHost, upStreamDutHost, tbinfo): +def gen_setup_information(downStreamDutHost, upStreamDutHost, tbinfo, topo_scenario): """ Generate setup information dictionary for T0 and T1/ T2 topologies. """ @@ -78,6 +78,8 @@ def gen_setup_information(downStreamDutHost, upStreamDutHost, tbinfo): upstream_acl_capability_facts = upStreamDutHost.acl_capabilities_facts()["ansible_facts"] topo_type = tbinfo["topo"]["type"] + if topo_type == "m0": + topo_type = "m0_vlan" if "m0_vlan_scenario" in topo_scenario else "m0_l3" # Get the list of T0/T2 ports for mg_facts in mg_facts_list: for dut_port, neigh in mg_facts["minigraph_neighbors"].items(): @@ -296,7 +298,7 @@ def get_t2_duthost(duthosts, tbinfo): @pytest.fixture(scope="module") -def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request): +def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request, topo_scenario): """ Gather all required test information. @@ -314,8 +316,8 @@ def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request): elif 't2' in topo: pytest_assert(len(duthosts) > 1, "Test must run on whole chassis") downstream_duthost, upstream_duthost = get_t2_duthost(duthosts, tbinfo) - - setup_information = gen_setup_information(downstream_duthost, upstream_duthost, tbinfo) + + setup_information = gen_setup_information(downstream_duthost, upstream_duthost, tbinfo, topo_scenario) # Disable BGP so that we don't keep on bouncing back mirror packets # If we send TTL=1 packet we don't need this but in multi-asic TTL > 1 @@ -374,7 +376,7 @@ def remove_route(duthost, prefix, nexthop, namespace): @pytest.fixture(scope='module', autouse=True) def setup_arp_responder(duthost, ptfhost, setup_info): - if setup_info['topo'] != 't0': + if setup_info['topo'] not in ['t0', 'm0_vlan']: yield return ip_list = [TARGET_SERVER_IP, DEFAULT_SERVER_IP] diff --git a/tests/everflow/test_everflow_ipv6.py b/tests/everflow/test_everflow_ipv6.py index a83da03d0db..63c1226151e 100644 --- a/tests/everflow/test_everflow_ipv6.py +++ b/tests/everflow/test_everflow_ipv6.py @@ -37,7 +37,7 @@ def setup_mirror_session_dest_ip_route(self, tbinfo, setup_info, setup_mirror_se Setup the route for mirror session destination ip and update monitor port list. Remove the route as part of cleanup. """ - if setup_info['topo'] == 't0': + if setup_info['topo'] in ['t0', 'm0_vlan']: # On T0 testbed, the collector IP is routed to T1 namespace = setup_info[UP_STREAM]['remote_namespace'] tx_port = setup_info[UP_STREAM]["dest_port"][0] @@ -64,7 +64,7 @@ def setup_mirror_session_dest_ip_route(self, tbinfo, setup_info, setup_mirror_se @pytest.fixture(scope='class') def everflow_dut(self, setup_info): - if setup_info['topo'] == 't0': + if setup_info['topo'] in ['t0', 'm0_vlan']: dut = setup_info[UP_STREAM]['everflow_dut'] else: dut = setup_info[DOWN_STREAM]['everflow_dut'] @@ -73,7 +73,7 @@ def everflow_dut(self, setup_info): @pytest.fixture(scope='class') def everflow_direction(self, setup_info): - if setup_info['topo'] == 't0': + if setup_info['topo'] in ['t0', 'm0_vlan']: direction = UP_STREAM else: direction = DOWN_STREAM @@ -553,7 +553,7 @@ def mirror_type(self): @pytest.fixture(scope='class', autouse=True) def setup_acl_table(self, setup_info, setup_mirror_session, config_method): - if setup_info['topo'] == 't0': + if setup_info['topo'] in ['t0', 'm0_vlan']: everflow_dut = setup_info[UP_STREAM]['everflow_dut'] remote_dut = setup_info[UP_STREAM]['remote_dut'] else: diff --git a/tests/everflow/test_everflow_testbed.py b/tests/everflow/test_everflow_testbed.py index 8acebcdac7a..aadfa3bb682 100644 --- a/tests/everflow/test_everflow_testbed.py +++ b/tests/everflow/test_everflow_testbed.py @@ -496,7 +496,7 @@ def test_everflow_dscp_with_policer( if vendorAsic in hostvars.keys() and everflow_dut.facts['hwsku'] in hostvars[vendorAsic]: pytest.skip("Skipping test since mirror policing is not supported on {0} {1} platforms".format(vendor, asic)) - if setup_info['topo'] == 't0': + if setup_info['topo'] in ['t0', 'm0_vlan']: default_tarffic_port_type = dest_port_type # Use the second portchannel as missor session nexthop tx_port = setup_info[dest_port_type]["dest_port"][1] @@ -520,7 +520,7 @@ def test_everflow_dscp_with_policer( bind_interface_namespace = setup_info[dest_port_type]["everflow_namespace"] rx_port_ptf_id = setup_info[dest_port_type]["src_port_ptf_id"] tx_port_ptf_id = setup_info[dest_port_type]["dest_port_ptf_id"][0] - if setup_info['topo'] == 't0' and self.acl_stage() == "egress": + if setup_info['topo'] in ['t0', 'm0_vlan'] and self.acl_stage() == "egress": # For T0 upstream, the EVERFLOW_DSCP table is binded to one of portchannels bind_interface = setup_info[dest_port_type]["dest_port_lag_name"][0] mirror_port_id = setup_info[dest_port_type]["dest_port_ptf_id"][1] @@ -574,7 +574,7 @@ def _run_everflow_test_scenarios(self, ptfadapter, setup, mirror_session, duthos tx_port_ids = self._get_tx_port_id_list(tx_ports) target_ip = "30.0.0.10" default_ip = self.DEFAULT_DST_IP - if 't0' == setup['topo'] and direction == DOWN_STREAM: + if setup['topo'] in ['t0', 'm0_vlan'] and direction == DOWN_STREAM: target_ip = TARGET_SERVER_IP default_ip = DEFAULT_SERVER_IP