[yang] Update device_metadata to add dhcp_server (#10382)

Why I did it
dhcp_server is introduced, and need to update yang model.

How I did it
Update yang models and add unit test.

How to verify it
Run unit test for sonic-yang-models.

Signed-off-by: Gang Lv ganglv@microsoft.com
This commit is contained in:
ganglv 2022-04-02 07:32:01 +08:00 committed by GitHub
parent 588ed0b760
commit a8f72e5d45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 1 deletions

View File

@ -304,7 +304,8 @@
"switch_id": "2",
"switch_type": "voq",
"max_cores": "8",
"sub_role": "FrondEnd"
"sub_role": "FrondEnd",
"dhcp_server": "disabled"
}
},
"VLAN": {

View File

@ -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"
}
}

View File

@ -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"
}
}
}
}
}

View File

@ -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 */
}