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 d33cf20e20..e40d75e8f2 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -304,7 +304,8 @@ "switch_id": "2", "switch_type": "voq", "max_cores": "8", - "sub_role": "FrondEnd" + "sub_role": "FrondEnd", + "dhcp_server": "disabled" } }, "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 ecfff6f69a..7f0ddd3849 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 @@ -103,6 +103,13 @@ }, "DEVICE_METADATA_VALID_SUB_ROLE_CONFIG": { "desc": "Verifying valid sub_role configuration." + }, + "DEVICE_METADATA_VALID_DHCP_SERVER": { + "desc": "Verifying dhcp_server configuration." + }, + "DEVICE_METADATA_INVALID_DHCP_SERVER": { + "desc": "Verifying invalid dhcp_server configuration.", + "eStrKey": "InvalidValue" } } 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 de0d4e15dc..a921e9ef41 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 @@ -283,5 +283,23 @@ } } } + }, + "DEVICE_METADATA_VALID_DHCP_SERVER": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "dhcp_server": "enabled" + } + } + } + }, + "DEVICE_METADATA_INVALID_DHCP_SERVER": { + "sonic-device_metadata:sonic-device_metadata": { + "sonic-device_metadata:DEVICE_METADATA": { + "sonic-device_metadata:localhost": { + "dhcp_server": "invalid" + } + } + } } } 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 87170850d8..618ed19cd8 100644 --- a/src/sonic-yang-models/yang-models/sonic-device_metadata.yang +++ b/src/sonic-yang-models/yang-models/sonic-device_metadata.yang @@ -183,6 +183,11 @@ module sonic-device_metadata { type uint8; description "Maximum number of cores in a VoQ Switch (chassis)."; } + + leaf dhcp_server { + type stypes:admin_mode; + description "Indicate whether enable the embedded DHCP server."; + } } /* end of container localhost */ }