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 8147f8a3ea..16cab82bc7 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 @@ -33,6 +33,9 @@ "desc": "DEVICE_METADATA_TYPE_INCORRECT_PATTERN pattern failure.", "eStrKey" : "Pattern" }, + "DEVICE_METADATA_TYPE_CORRECT_PATTERN": { + "desc": "DEVICE_METADATA correct value for Type field" + }, "DEVICE_METADATA_CORRECT_BUFFER_MODEL_PATTERN": { "desc": "DEVICE_METADATA correct value for BUFFER_MODEL 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 501ad9bb2c..26a2c9377d 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 @@ -44,6 +44,16 @@ } } }, + "DEVICE_METADATA_TYPE_CORRECT_PATTERN": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "bgp_asn": "65002", + "type": "BackEndToRRouter" + } + } + } + }, "DEV_META_DEV_NEIGH_VERSION_TABLE": { "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 400cbf3bcd..fef47b5718 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -91,7 +91,7 @@ module sonic-device_metadata { leaf type { type string { length 1..255; - pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC"; + pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter"; } }