From 021b7dcb0428b5d817150d687ed46e1962abc53d Mon Sep 17 00:00:00 2001 From: Praveen Chaudhary Date: Mon, 1 Nov 2021 08:26:27 -0700 Subject: [PATCH] [sonic-breakout_cfg.yang]: Remove pattern from sonic-breakout_cfg.yang. (#6801) 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 | 8 +-- 3 files changed, 3 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 a5d8c13841..db83d48f64 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 8b9b65835c..24351dfd59 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 ed3b93a175..b8ae8efdf3 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,14 +41,9 @@ module sonic-breakout_cfg { } leaf brkout_mode { + description "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\]'; } } }