forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yang][dhcp_server] Add dhcp_server_ipv4 yang model (sonic-net#16327)
Why I did it sonic-net#15955 import sonic-vlan in yang model, which would cause YANG backlink issue. So sonic-net#15955 was reverted by sonic-net#16322. This PR is re-submitted of sonic-net#15955 without import sonic-vlan. Add yang model for IPv4 DHCP Server. How I did it Add yang model for IPv4 DHCP Server. Add four new tables: DHCP_SERVER_IPV4, DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS, DHCP_SERVER_IPV4_RANGE, DHCP_SERVER_IPV4_PORT. Add related unit test. HLD: https://github.com/yaqiangz/SONiC/blob/master_dhcp_server_hld/doc/dhcp_server/port_based_dhcp_server_high_level_design.md#rev-01 How to verify it Build sonic_yang_models packages.
- Loading branch information
Showing
6 changed files
with
1,303 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
src/sonic-yang-models/tests/yang_model_tests/tests/dhcp_server_ipv4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
"DHCP_SERVER_IPV4_VALID_FORMAT": { | ||
"desc": "Add dhcp_server_ipv4 in correct format." | ||
}, | ||
"DHCP_SERVER_IPV4_WITH_INVALID_VLAN": { | ||
"desc": "Configure vlan-id in DHCP_SERVER_IPV4 table which is invalid.", | ||
"eStrKey" : "Pattern" | ||
}, | ||
"DHCP_SERVER_IPV4_INCORRECT_GATEWAY": { | ||
"desc": "Add gateway which is not in correct ip-prefix format.", | ||
"eStrKey": "Pattern" | ||
}, | ||
"DHCP_SERVER_IPV4_INCORRECT_NETMASK": { | ||
"desc": "Add netmask which is not in correct ip-prefix format.", | ||
"eStrKey": "Pattern" | ||
}, | ||
"DHCP_SERVER_IPV4_STATE_WRONG_VALUE": { | ||
"desc": "Configure wrong value for state.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"DHCP_SERVER_IPV4_MODE_WRONG_VALUE": { | ||
"desc": "Configure wrong value for mode.", | ||
"eStrKey": "InvalidValue" | ||
}, | ||
"DHCP_SREVER_IPV4_NON_EXIST_OPTION": { | ||
"desc": "Configure option in DHCP_SERVER_IPV4 table which does not exist in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS table.", | ||
"eStrKey": "LeafRef" | ||
}, | ||
"DHCP_SERVER_IPV4_PORT_WITH_NO_EXIST_NAME": { | ||
"desc": "Configure DHCP interface in DHCP_SERVER_IPV4_PORT table which is no exist.", | ||
"eStrKey": "LeafRef" | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_WRONG_VALUE": { | ||
"desc": "Configure wrong value for type.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["type"] | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_TEXT": { | ||
"desc": "Add text type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_IPV4_ADDRESS": { | ||
"desc": "Add ipv4-address type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT8": { | ||
"desc": "Add uint8 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT16": { | ||
"desc": "Add uint16 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_TYPE_VALID_VALUE_UINT32": { | ||
"desc": "Add uint32 type of DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS." | ||
}, | ||
"DHCP_SERVER_IPV4_RANGE_INVALID_END": { | ||
"desc": "Configure wrong end ip of range.", | ||
"eStrKey": "Pattern" | ||
}, | ||
"DHCP_SERVER_IPV4_RANGE_RANGES_WITH_IP": { | ||
"desc": "Configure both ip and ranges in DHCP_SERVER_IPV4_RANGE_RANGES", | ||
"eStr": ["Statement of 'ips' and 'ranges' cannot both exist"] | ||
}, | ||
"DHCP_SERVER_IPV4_GATEWAY_ABSENT": { | ||
"desc": "Missing gateway in DHCP_SERVER_IPV4", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_LEASE_TIME_ABSENT": { | ||
"desc": "Missing lease_time in DHCP_SERVER_IPV4", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_MODE_ABSENT": { | ||
"desc": "Missing mode in DHCP_SERVER_IPV4", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_NETMASK_ABSENT": { | ||
"desc": "Missing netmask in DHCP_SERVER_IPV4", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_STATE_ABSENT": { | ||
"desc": "Missing state in DHCP_SERVER_IPV4", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_ID_ABSENT": { | ||
"desc": "Missing id in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS_VALUE_ABSENT": { | ||
"desc": "Missing value in DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS", | ||
"eStrKey" : "Mandatory" | ||
}, | ||
"DHCP_SERVER_IPV4_RANGE_RANGE_ABSENT": { | ||
"desc": "Missing ranges in DHCP_SERVER_IPV4_RANGE", | ||
"eStrKey": "Must" | ||
}, | ||
"DHCP_SERVER_IPV4_RANGE_SINGLE_IP": { | ||
"desc": "Single ip in DHCP_SERVER_IPV4_RANGE" | ||
}, | ||
"DHCP_SERVER_IPV4_RANGE_THREE_IP": { | ||
"desc": "Three ips in DHCP_SERVER_IPV4_RANGE", | ||
"eStrKey": "Must" | ||
} | ||
} |
Oops, something went wrong.