From da7db2d7292566d206db56158c529c95bd5d2dca Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Tue, 22 Jun 2021 18:06:49 -0700 Subject: [PATCH 1/2] [sonic-breakout_cfg.yang]: Remove pattern from sonic-breakout_cfg.yang. Changes: -- Remove pattern from sonic-breakout_cfg.yang, it is redundant. -- test changes. Signed-off-by: Praveen Chaudhary --- .../yang_model_tests/tests/breakout.json | 9 +-- .../tests_config/breakout.json | 56 ------------------- .../yang-models/sonic-breakout_cfg.yang | 7 +-- 3 files changed, 2 insertions(+), 70 deletions(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/breakout.json b/src/sonic-yang-models/tests/yang_model_tests/tests/breakout.json index a5d8c1384148..db83d48f6472 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/breakout.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/breakout.json @@ -1,12 +1,5 @@ { - "BREAKOUT_CFG_CORRECT_MODES": { - "desc": "BREAKOUT_CFG correct breakout modes" - }, - "BREAKOUT_CFG_INCORRECT_MODES": { - "desc": "BREAKOUT_CFG wrong breakout modes", - "eStr": ["pattern", "does not satisfy"] - }, "CRM_BRK_CFG_FLEX_TABLE": { - "desc": "CRM BREAKOUT CFG FLEX COUNTER TABLE." + "desc": "CRM BREAKOUT CFG FLEX COUNTER TABLE." } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/breakout.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/breakout.json index 8b9b65835cc9..24351dfd59ab 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/breakout.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/breakout.json @@ -1,60 +1,4 @@ { - "BREAKOUT_CFG_CORRECT_MODES": { - "sonic-breakout_cfg:sonic-breakout_cfg": { - "sonic-breakout_cfg:BREAKOUT_CFG": { - "BREAKOUT_CFG_LIST": [ - { - "brkout_mode": "1x200G[100G,50G,40G,25G,10G,1G]", - "port": "Ethernet0" - }, - { - "brkout_mode": "2x100G[50G,40G,25G,10G,1G]", - "port": "Ethernet8" - }, - { - "brkout_mode": "4x50G[40G,25G,10G,1G]", - "port": "Ethernet4" - }, - { - "brkout_mode": "1x25G[10G]", - "port": "Ethernet12" - }, - { - "brkout_mode": "1x100G[50G,40G,25G,10G]", - "port": "Ethernet16" - }, - { - "brkout_mode": "2x50G[40G,25G,10G]", - "port": "Ethernet20" - }, - { - "brkout_mode": "1x400G[200G,100G,50G,40G,25G,10G,1G]", - "port": "Ethernet24" - } - ] - } - } - }, - "BREAKOUT_CFG_INCORRECT_MODES": { - "sonic-breakout_cfg:sonic-breakout_cfg": { - "sonic-breakout_cfg:BREAKOUT_CFG": { - "BREAKOUT_CFG_LIST": [ - { - "brkout_mode": "1x500G[100G,50G,40G,25G,10G,1G]", - "port": "Ethernet0" - }, - { - "brkout_mode": "2x300G[50G,40G,25G,1G]", - "port": "Ethernet8" - }, - { - "brkout_mode": "5x50G[40G,25G]", - "port": "Ethernet4" - } - ] - } - } - }, "CRM_BRK_CFG_FLEX_TABLE": { "sonic-breakout_cfg:sonic-breakout_cfg": { "sonic-breakout_cfg:BREAKOUT_CFG": { diff --git a/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang b/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang index ed3b93a1753a..875bf505c002 100644 --- a/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang +++ b/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang @@ -40,14 +40,9 @@ module sonic-breakout_cfg { } leaf brkout_mode { + descrption "break_mode for port, it is verifed using platform.json"; type string { length 1..64; - /* - * Below allowed patterns are based on most used Platforms, - * Add any other breakout-mode to allow Dynamic Port - * Breakout to that breakout-mode. - */ - pattern '1x100G\[40G\]|2x50G|4x25G\[10G\]|2x25G\(2\)\+1x50G\(2\)|1x50G\(2\)\+2x25G\(2\)|1x400G|2x200G|4x100G|8x50G|1x200G\[100G,50G,40G,25G,10G,1G\]|2x100G\[50G,40G,25G,10G,1G\]|4x50G\[40G,25G,10G,1G\]|1x25G\[10G\]|1x100G\[50G,40G,25G,10G\]|2x50G\[40G,25G,10G\]|4x25G\[10G\]|1x25G\[10G,1G\]|1x100G\[50G,40G,25G,10G,1G\]|2x50G\[40G,25G,10G,1G\]|4x25G\[10G,1G\]|1x400G\[200G,100G,50G,40G,25G,10G,1G\]|2x200G\[100G,50G,40G,25G,10G,1G\]|4x100G\[50G,40G,25G,10G,1G\]'; } } } From b3b1ac134c47eac9b986b9f84b9a5dd9e17a3e4a Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Wed, 28 Jul 2021 17:59:15 -0700 Subject: [PATCH 2/2] [sonic-breakout_cfg.yang]: description spelling. Signed-off-by: Praveen Chaudhary --- src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang b/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang index 875bf505c002..b8ae8efdf318 100644 --- a/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang +++ b/src/sonic-yang-models/yang-models/sonic-breakout_cfg.yang @@ -26,6 +26,7 @@ module sonic-breakout_cfg { key "port"; + /* * This is leaf instead of a leafref towards port, because this * table will contains Parent ports and their current breakout-mode, @@ -40,7 +41,7 @@ module sonic-breakout_cfg { } leaf brkout_mode { - descrption "break_mode for port, it is verifed using platform.json"; + description "break_mode for port, it is verifed using platform.json"; type string { length 1..64; }