From de70f687e5d0f7ddc0ac5395432f31fc1e20279a Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Thu, 11 Jan 2024 09:42:10 +0800 Subject: [PATCH] Skip po2vlan test for sonic fanout (#11225) ## Description of PR Summary: Fixes # (issue) Microsoft ADO: 26298422 ### Type of change - [x] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] Test case(new/improvement) ## Approach #### What is the motivation for this PR? Some po2vlan tests failed on new testbed, and this new testbed is using SONiC leaf fanout. This leaf fanout does not support trunk mode, and tagged packets are discarded. #### How did you do it? Skip po2vlan test for testbed with SONiC leaf fanout. #### How did you verify/test it? Run related po2vlan test. --- tests/common/helpers/portchannel_to_vlan.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/common/helpers/portchannel_to_vlan.py b/tests/common/helpers/portchannel_to_vlan.py index fde1693ae0d..b135aaa26dc 100644 --- a/tests/common/helpers/portchannel_to_vlan.py +++ b/tests/common/helpers/portchannel_to_vlan.py @@ -13,6 +13,7 @@ from tests.common.fixtures.duthost_utils import utils_vlan_intfs_dict_add from tests.common.helpers.backend_acl import apply_acl_rules, bind_acl_table from tests.common.checkpoint import create_checkpoint, rollback +from tests.common.utilities import check_skip_release # TODO: Remove this once we no longer support Python 2 @@ -381,12 +382,28 @@ def setup_acl_table(duthost, tbinfo, acl_rule_cleanup): @pytest.fixture(scope="module", autouse=True) def setup_po2vlan(duthosts, ptfhost, rand_one_dut_hostname, rand_selected_dut, ptfadapter, - ports_list, tbinfo, vlan_intfs_dict, setup_acl_table): # noqa F811 + ports_list, tbinfo, vlan_intfs_dict, setup_acl_table, fanouthosts): # noqa F811 if "dualtor" in tbinfo["topo"]["name"]: yield return + """ + The test set can't run on testbeds connected to sonic leaf-fanout, + Tagged packet will be dropped by sonic leaf-fanout because dot1q-tunnel is not supported. + Hence we skip the test on testbeds running sonic leaf-fanout + """ + for fanouthost in list(fanouthosts.values()): + if fanouthost.get_fanout_os() == 'sonic': + # Skips this test if the SONiC image installed on fanout is < 202205 + is_skip, _ = check_skip_release(fanouthost, ["201811", "201911", "202012", "202106", "202111"]) + if is_skip: + pytest.skip("OS Version of fanout is older than 202205, unsupported") + asic_type = fanouthost.facts['asic_type'] + platform = fanouthost.facts["platform"] + if not (asic_type in ["broadcom"] or platform in ["armhf-nokia_ixs7215_52x-r0"]): + pytest.skip("Not supporteds on SONiC leaf-fanout platform") + duthost = duthosts[rand_one_dut_hostname] cfg_facts = duthost.config_facts(host=duthost.hostname, source="running")['ansible_facts'] # Skip l2 mode