From 53a281008a96edcc22d0536ca4357a18f071c04e Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Wed, 17 Aug 2022 08:58:35 +0800 Subject: [PATCH] Update Yang for pfc_enable field (#11747) Why I did it This PR is to update Yang model for pfc_enable and pfcwd_sw_enable fields to support more than 2 queues, like 2,3,4,6. Before this change, the regex "[0-7](,[0-7])?" accepts only no more than 2 queues. How I did it Update the regex pattern for pfc_enable and pfcwd_sw_enable, from "[0-7](,[0-7])?" to "[0-7](,[0-7])* How to verify it The change is verified by UT. The test input is updated to cover the change. collected 3 items tests/test_sonic_yang_models.py .. [ 66%] tests/yang_model_tests/test_yang_model.py . --- .../tests/yang_model_tests/tests_config/qosmaps.json | 4 ++-- src/sonic-yang-models/yang-models/sonic-port-qos-map.yang | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json index a05d80631f..0992f8776d 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json @@ -669,8 +669,8 @@ "pfc_to_pg_map": "map1", "dscp_to_tc_map": "map1", "dot1p_to_tc_map": "map1", - "pfc_enable": "3,4", - "pfcwd_sw_enable" : "3,4" + "pfc_enable": "2,3,4,6", + "pfcwd_sw_enable" : "2,3,4,6" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang index 53ef7f48f5..09dcb7ce9c 100644 --- a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang @@ -82,13 +82,13 @@ module sonic-port-qos-map { leaf pfc_enable { type string { - pattern "[0-7](,[0-7])?"; + pattern "[0-7](,[0-7])*"; } } leaf pfcwd_sw_enable { type string { - pattern "[0-7](,[0-7])?"; + pattern "[0-7](,[0-7])*"; } description "Specify the queue(s) on which software pfc watchdog are enabled.";