Skip to content

Commit 3326556

Browse files
ganglyumssonicbld
authored andcommitted
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.
1 parent 35cae4b commit 3326556

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/common/helpers/portchannel_to_vlan.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from tests.common.fixtures.duthost_utils import utils_vlan_intfs_dict_add
1414
from tests.common.helpers.backend_acl import apply_acl_rules, bind_acl_table
1515
from tests.common.checkpoint import create_checkpoint, rollback
16+
from tests.common.utilities import check_skip_release
1617

1718

1819
# TODO: Remove this once we no longer support Python 2
@@ -381,12 +382,28 @@ def setup_acl_table(duthost, tbinfo, acl_rule_cleanup):
381382

382383
@pytest.fixture(scope="module", autouse=True)
383384
def setup_po2vlan(duthosts, ptfhost, rand_one_dut_hostname, rand_selected_dut, ptfadapter,
384-
ports_list, tbinfo, vlan_intfs_dict, setup_acl_table): # noqa F811
385+
ports_list, tbinfo, vlan_intfs_dict, setup_acl_table, fanouthosts): # noqa F811
385386

386387
if "dualtor" in tbinfo["topo"]["name"]:
387388
yield
388389
return
389390

391+
"""
392+
The test set can't run on testbeds connected to sonic leaf-fanout,
393+
Tagged packet will be dropped by sonic leaf-fanout because dot1q-tunnel is not supported.
394+
Hence we skip the test on testbeds running sonic leaf-fanout
395+
"""
396+
for fanouthost in list(fanouthosts.values()):
397+
if fanouthost.get_fanout_os() == 'sonic':
398+
# Skips this test if the SONiC image installed on fanout is < 202205
399+
is_skip, _ = check_skip_release(fanouthost, ["201811", "201911", "202012", "202106", "202111"])
400+
if is_skip:
401+
pytest.skip("OS Version of fanout is older than 202205, unsupported")
402+
asic_type = fanouthost.facts['asic_type']
403+
platform = fanouthost.facts["platform"]
404+
if not (asic_type in ["broadcom"] or platform in ["armhf-nokia_ixs7215_52x-r0"]):
405+
pytest.skip("Not supporteds on SONiC leaf-fanout platform")
406+
390407
duthost = duthosts[rand_one_dut_hostname]
391408
cfg_facts = duthost.config_facts(host=duthost.hostname, source="running")['ansible_facts']
392409
# Skip l2 mode

0 commit comments

Comments
 (0)