diff --git a/tests/common/helpers/constants.py b/tests/common/helpers/constants.py index cc113abe0c8..6a0cbcb5467 100644 --- a/tests/common/helpers/constants.py +++ b/tests/common/helpers/constants.py @@ -19,7 +19,8 @@ "t2": "t3", "m0_vlan": "m1", "m0_l3": "m1", - "ft2": "lt2" + "ft2": "lt2", + "lt2": "ut2" } # Describe ALL upstream neighbor of dut in different topos @@ -57,4 +58,6 @@ "t2": ["t1"], "m0_vlan": ["mx", "server"], "m0_l3": ["mx", "server"], + "ft2": "lt2", + "lt2": "t1" } diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index 9cef4daef65..bd9b5c1c955 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -962,6 +962,7 @@ everflow/test_everflow_testbed.py::TestEverflowV4EgressAclEgressMirror::test_eve conditions: - "asic_subtype in ['broadcom-dnx']" - "asic_type in ['cisco-8000']" + - "topo_type in ['lt2', 'ft2']" everflow/test_everflow_testbed.py::TestEverflowV4EgressAclEgressMirror::test_everflow_frwd_with_bkg_trf: skip: @@ -976,6 +977,7 @@ everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_e conditions: - "asic_type in ['cisco-8000']" - "asic_subtype in ['broadcom-dnx']" + - "topo_type in ['lt2', 'ft2']" everflow/test_everflow_testbed.py::TestEverflowV4IngressAclIngressMirror::test_everflow_frwd_with_bkg_trf: skip: diff --git a/tests/everflow/everflow_test_utilities.py b/tests/everflow/everflow_test_utilities.py index e51eee82ea1..0e56a927c97 100644 --- a/tests/everflow/everflow_test_utilities.py +++ b/tests/everflow/everflow_test_utilities.py @@ -99,6 +99,10 @@ def gen_setup_information(dutHost, downStreamDutHost, upStreamDutHost, tbinfo, t downstream_ports_namespace_map[neigh['namespace']].append(dut_port) downstream_ports_namespace.add(neigh['namespace']) downstream_neigh_namespace_map[neigh['namespace']].add(neigh["name"]) + # For FT2, we just copy the upstream ports to downstream ports + if "ft2" in topo: + downstream_ports_namespace = upstream_ports_namespace.copy() + downstream_ports_namespace_map = upstream_ports_namespace_map.copy() for ns, neigh_set in list(upstream_neigh_namespace_map.items()): if len(neigh_set) < 2: @@ -368,7 +372,7 @@ def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request, 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 - if 't2' in topo: + if 't2' in topo and 'lt2' not in topo and 'ft2' not in topo: for dut_host in duthosts.frontend_nodes: dut_host.command("sudo config bgp shutdown all") dut_host.command("mkdir -p {}".format(DUT_RUN_DIR)) @@ -381,7 +385,7 @@ def setup_info(duthosts, rand_one_dut_hostname, tbinfo, request, topo_scenario): yield setup_information # Enable BGP again - if 't2' in topo: + if 't2' in topo and 'lt2' not in topo and 'ft2' not in topo: for dut_host in duthosts.frontend_nodes: dut_host.command("sudo config bgp startup all") dut_host.command("rm -rf {}".format(DUT_RUN_DIR)) @@ -796,7 +800,7 @@ def send_and_check_mirror_packets(self, src_port_set = set() src_port_metadata_map = {} - if 't2' in setup['topo']: + if 't2' in setup['topo'] and 'lt2' not in setup['topo'] and 'ft2' not in setup['topo']: if valid_across_namespace is True: src_port_set.add(src_port) src_port_metadata_map[src_port] = (None, 1) diff --git a/tests/everflow/test_everflow_ipv6.py b/tests/everflow/test_everflow_ipv6.py index e50a4d8e445..6754f17358a 100644 --- a/tests/everflow/test_everflow_ipv6.py +++ b/tests/everflow/test_everflow_ipv6.py @@ -14,7 +14,7 @@ from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor # noqa: F401 pytestmark = [ - pytest.mark.topology("t0", "t1", "t2", "m0", "m1", "m2", "m3") + pytest.mark.topology("t0", "t1", "t2", "lt2", "ft2", "m0", "m1", "m2", "m3") ] EVERFLOW_V6_RULES = "ipv6_test_rules.yaml" diff --git a/tests/everflow/test_everflow_testbed.py b/tests/everflow/test_everflow_testbed.py index 6c6ee502db4..07cb216eeff 100644 --- a/tests/everflow/test_everflow_testbed.py +++ b/tests/everflow/test_everflow_testbed.py @@ -20,7 +20,7 @@ from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_selected_tor # noqa: F401 pytestmark = [ - pytest.mark.topology("t0", "t1", "t2", "m0", "m1", "m2", "m3") + pytest.mark.topology("t0", "t1", "t2", "lt2", "ft2", "m0", "m1", "m2", "m3") ] logger = logging.getLogger(__name__) @@ -98,6 +98,11 @@ def dest_port_type(self, setup_info, setup_mirror_session, tbinfo, request, ersp remote_dut.shell(remote_dut.get_vtysh_cmd_for_namespace( f"vtysh -c \"config\" -c \"router bgp\" -c \"address-family {ip}\" -c \"redistribute static\"", setup_info[request.param]["remote_namespace"])) + # For FT2, we only cover UP_STREAM direction as traffic is always coming from LT2 + # and also going to LT2 + if tbinfo['topo']['type'] == "ft2" and request.param == DOWN_STREAM: + pytest.skip("Skipping DOWN_STREAM test on FT2 topology.") + yield request.param session_prefixes = setup_mirror_session["session_prefixes"] if erspan_ip_ver == 4 \