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

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-21 08:39:35 +08:00 committed by GitHub
parent df8eaa0544
commit 0526ff98f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 2 deletions

View File

@ -283,7 +283,8 @@
"hwsku": "Stone", "hwsku": "Stone",
"buffer_model": "dynamic", "buffer_model": "dynamic",
"cloudtype": "Public", "cloudtype": "Public",
"region": "usfoo" "region": "usfoo",
"dhcp_server": "disabled"
} }
}, },
"VLAN": { "VLAN": {

View File

@ -93,6 +93,13 @@
"DEVICE_METADATA_INVALID_STORAGE_DEVICE": { "DEVICE_METADATA_INVALID_STORAGE_DEVICE": {
"desc": "Verifying invalid storage device value", "desc": "Verifying invalid storage device value",
"eStrKey": "InvalidValue" "eStrKey": "InvalidValue"
},
"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

@ -251,5 +251,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

@ -148,6 +148,11 @@ module sonic-device_metadata {
leaf storage_device { leaf storage_device {
type boolean; type boolean;
} }
leaf dhcp_server {
type stypes:admin_mode;
description "Indicate whether enable the embedded DHCP server.";
}
} }
/* end of container localhost */ /* end of container localhost */
} }