From 5985ba25c8729e5176a9182e4a0f4b1e74366713 Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Mon, 14 Sep 2026 22:53:34 +0000 Subject: [PATCH] copp: fix UDLD skip check to cover all Nokia H5/H6 fanout variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description of PR Summary: Fixes the UDLD COPP policer test (`test_copp.py::TestCOPP::test_policer[UDLD]`) incorrectly running (and failing) on Nokia H6-128 fanout, and potentially other untested Nokia H5/H6 port-count variants. ### Type of change - [x] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [x] 202512 - [x] 202605 ### Approach #### What is the motivation for this PR? PR #1233 (commit 4d8c48367e) added a skip for the UDLD policer test on Nokia H5/H6 SONiC fanouts, since these platforms' Broadcom SAI only supports `trap`/`drop` packet actions for the UDLD hostif trap type, not `forward` — so UDLD frames never reach the DUT and the policer-rate assertion (expects a nonzero forwarded PPS) always fails. However, the skip only matched two exact platform strings: ```python ['arista_7060x6_64pe', 'x86_64-nokia_ixr7220_h5_64o-r0', 'x86_64-nokia_ixr7220_h6_64-r0'] ``` Other Nokia H5/H6 port-count variants — e.g. `x86_64-nokia_ixr7220_h6_128-r0` (used by `str4-Nokia-7220-Th6p-leaf-1`), `x86_64-nokia_ixr7220_h5_64d-r0`, `x86_64-nokia_ixr7220_h5_32d-r0` — were not covered, even though they use the same ASIC/SAI family and have the identical limitation. As a result the test ran (rather than skipped) on those platforms and failed: ``` AssertionError: Copp policer constraint check failed, Actual PPS: 0 Expected PPS range: 90.0 - 130.0 ``` #### How did you do it? Verified directly on `str4-Nokia-7220-Th6p-leaf-1` (platform `x86_64-nokia_ixr7220_h6_128-r0`) that the Broadcom SAI driver (`_brcm_sai_create_hostif_trap_validate` in `brcm_sai_host_intf.c`) rejects `SAI_PACKET_ACTION_FORWARD`/`COPY`/`TRANSIT` for `SAI_HOSTIF_TRAP_TYPE_UDLD` with `SAI_STATUS_NOT_SUPPORTED`/`SAI_STATUS_INVALID_PARAMETER` — only `trap` and `drop` are valid actions for this trap type on this ASIC family, confirming the same root cause as the original Arista/H5/H6-64 skip. Replaced the exact-match list with a regex match (`x86_64-nokia_ixr7220_h[56]_.*`) so any current or future Nokia H5/H6 port-count variant is covered, instead of enumerating every SKU string individually. #### How did you verify/test it? - Confirmed the exact failure reproduces on `str4-Nokia-7220-Th6p-leaf-1` (h6_128 platform) prior to the fix. - Verified the new regex matches all currently known Nokia H5/H6 platform folder names in `sonic-buildimage/device/nokia/`: `h5_32d`, `h5_64d`, `h5_64o`, `h6_64`, `h6_128`, while leaving the Arista match untouched. - `flake8`/pre-commit checks pass on the modified file. #### Any platform specific information? Nokia IXR-7220 H5/H6 family fanouts running SONiC (Broadcom TH5/TH6 based). #### Supported testbed topology if it's a new test case? N/A (existing test, fixing a platform-detection gap) ### Documentation N/A Signed-off-by: Sonic Build Admin --- tests/copp/test_copp.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/copp/test_copp.py b/tests/copp/test_copp.py index 13ad7816a6..59b2af9af9 100644 --- a/tests/copp/test_copp.py +++ b/tests/copp/test_copp.py @@ -24,6 +24,7 @@ import pytest import json import random +import re import time from collections import namedtuple @@ -114,11 +115,19 @@ def test_policer(self, protocol, duthosts, enum_rand_one_per_hwsku_frontend_host """ # If fanout is running 7060x6 and running SONiC, the only supported action for UDLD is trap, which means # UDLD packet will not be forwarded to DUT + # Nokia H5/H6 fanouts (all port-count variants, e.g. h5_32d, h5_64d, h5_64o, h6_64, h6_128) and + # Nexthop 4210 fanouts share the same Broadcom SAI/ASIC limitation and also only support trap + # (not forward) for UDLD. if 'UDLD' == protocol: for fanouthost in list(fanouthosts.values()): - if (fanouthost.get_fanout_os() == 'sonic' and fanouthost.facts["platform"] - in ['arista_7060x6_64pe', 'x86_64-nokia_ixr7220_h5_64o-r0', 'x86_64-nokia_ixr7220_h6_64-r0']): - pytest.skip("Skip UDLD test for Arista-7060x6 and Nokia-H5/H6 fanout without UDLD forward support") + fanout_platform = fanouthost.facts["platform"] + if fanouthost.get_fanout_os() == 'sonic' and ( + fanout_platform == 'arista_7060x6_64pe' + or re.match(r'x86_64-nokia_ixr7220_h[56]_', fanout_platform) + or re.match(r'x86_64-nexthop_4210-', fanout_platform) + ): + pytest.skip("Skip UDLD test for Arista-7060x6, Nokia-H5/H6 and Nexthop-4210 " + "fanout without UDLD forward support") duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname] namespace = DEFAULT_NAMESPACE