From 39e1e92c08ea43c374040bba8b83b7292101ba7e Mon Sep 17 00:00:00 2001 From: ganglv <88995770+ganglyu@users.noreply.github.com> Date: Fri, 8 Apr 2022 07:48:01 +0800 Subject: [PATCH] [yang]: Add support for BmcMgmtToRRouter (#10488) Why I did it minigraph parser has introduced new type. How I did it Update yang models to support BmcMgmtToRRouter. How to verify it Run unit test for sonic-yang-models Signed-off-by: Gang Lv ganglv@microsoft.com --- .../tests/yang_model_tests/tests/device_metadata.json | 3 +++ .../yang_model_tests/tests_config/device_metadata.json | 10 ++++++++++ .../yang-models/sonic-device_metadata.yang | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json index 7f0ddd3849..1c39661d05 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/device_metadata.json @@ -36,6 +36,9 @@ "DEVICE_METADATA_TYPE_CORRECT_PATTERN": { "desc": "DEVICE_METADATA correct value for Type field" }, + "DEVICE_METADATA_TYPE_BMC_MGMT_TOR_PATTERN": { + "desc": "DEVICE_METADATA value as BmcMgmtToRRouter for Type field" + }, "DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { "desc": "DEVICE_METADATA value as not-provisioned for Type field" }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json index a921e9ef41..687a745a24 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/device_metadata.json @@ -54,6 +54,16 @@ } } }, + "DEVICE_METADATA_TYPE_BMC_MGMT_TOR_PATTERN": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_asn": "65002", + "type": "BmcMgmtToRRouter" + } + } + } + }, "DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": { "sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:DEVICE_METADATA": { diff --git a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang index a349a3eb93..1724100586 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -88,7 +88,7 @@ module sonic-device_metadata { leaf type { type string { length 1..255; - pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|not-provisioned"; + pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|BmcMgmtToRRouter|not-provisioned"; } }