diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index eccf550ece..551eba5fb1 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -925,7 +925,8 @@ instance is supported in SONiC. "type": "ToRRouter", "bgp_adv_lo_prefix_as_128" : "true", "buffer_model": "traditional", - "yang_config_validation": "disable" + "yang_config_validation": "disable", + "rack_mgmt_map": "dummy_value" } } } diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index c9d3cfec61..6dc354666a 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -359,7 +359,8 @@ "sub_role": "FrontEnd", "dhcp_server": "disabled", "bgp_adv_lo_prefix_as_128": "true", - "yang_config_validation": "disable" + "yang_config_validation": "disable", + "rack_mgmt_map": "dummy_value" } }, "VLAN": { 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 bdcea63ebb..c10101e1f6 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 @@ -135,5 +135,12 @@ "DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": { "desc": "Enable bgp-suppress-fib-pending when synchronous mode is disabled", "eStr": ["ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"] + }, + "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { + "desc": "Verifying rack_mgmt_map configuration." + }, + "DEVICE_METADATA_INVALID_RACK_MGMT_MAP": { + "desc": "Verifying invalid rack_mgmt_map configuration.", + "eStr": "Invalid length for the rack mgmt map." } } 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 800a6972a4..1d0d2e6165 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 @@ -362,5 +362,23 @@ } } } + }, + "DEVICE_METADATA_VALID_RACK_MGMT_MAP": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "rack_mgmt_map": "dummy_value" + } + } + } + }, + "DEVICE_METADATA_INVALID_RACK_MGMT_MAP": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "rack_mgmt_map": "dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value-dummy_value" + } + } + } } } 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 f333320aff..39df414660 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -217,6 +217,14 @@ module sonic-device_metadata { error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"; } } + leaf rack_mgmt_map { + type string { + length 0..128 { + error-message "Invalid length for the rack mgmt map."; + } + } + description "Information of rack mgmt map."; + } } /* end of container localhost */ }