forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SONiC YANGs for Management Port, Management Interface, Management…
… VRF and NTP. (sonic-net#7252) * SONiC YANG model support for Management Port, Management Interface, Management VRF and NTP. Co-authored-by: Bing Sun <Bing_Sun@dell.com>
- Loading branch information
Showing
15 changed files
with
932 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
23 changes: 23 additions & 0 deletions
23
src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_interface.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,23 @@ | ||
{ | ||
"MGMT_INTERFACE_TEST": { | ||
"desc": "CONFIGURE MANAGEMENT INTERFACE WITH IP AND GW." | ||
}, | ||
"MGMT_INTERFACE_WITH_NON_EXIST_PORT": { | ||
"desc": "CONFIGURE MANAGEMENT INTERFACE WITH NON EXIST MGMT PORT.", | ||
"eStrKey": "LeafRef", | ||
"eStr": ["port", "name"] | ||
}, | ||
"MGMT_INTERFACE_WITH_WRONG_PORT": { | ||
"desc": "CONFIGURE MANAGEMENT INTERFACE WITH WRONG MGMT PORT.", | ||
"eStrKey": "LeafRef", | ||
"eStr": ["port", "name"] | ||
}, | ||
"MGMT_INTERFACE_IPV4_ADDR_WITH_IPV6_GW": { | ||
"desc": "CONFIGURE MANAGEMENT INTERFACE WITH IPV4 ADDRESS BUT IPV6 GW ADDRESS.", | ||
"eStrKey": "Must" | ||
}, | ||
"MGMT_INTERFACE_IPV6_ADDR_WITH_IPV4_GW": { | ||
"desc": "CONFIGURE MANAGEMENT INTERFACE WITH IPV6 ADDRESS BUT IPV4 GW ADDRESS.", | ||
"eStrKey": "Must" | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_port.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,39 @@ | ||
{ | ||
"MGMT_PORT_TEST": { | ||
"desc": "LOAD MGMT PORT WITH ALIAS AND ADMIN_STATUS SUCCESSFULLY. VERIFY ADMIN_STATUS", | ||
"eStrKey": "Verify", | ||
"verify": { | ||
"xpath": "/sonic-mgmt_port:sonic-mgmt_port/MGMT_PORT/MGMT_PORT_LIST[name='eth0']/name", | ||
"key": "sonic-mgmt_port:admin_status", | ||
"value": "up" | ||
} | ||
}, | ||
"MGMT_PORT_INVALID_NAME_PATTERN": { | ||
"desc": "INCORRECT MANAGEMENT PORT NAME", | ||
"eStrKey": "Pattern", | ||
"eStr": ["eth"] | ||
}, | ||
"MGMT_PORT_INVALID_SPEED": { | ||
"desc": "INVALID SPEED", | ||
"eStrKey": "Range", | ||
"eStr": ["10|100|1000"] | ||
}, | ||
"MGMT_PORT_INVALID_MTU": { | ||
"desc": "INVALID MTU", | ||
"eStrKey": "Range", | ||
"eStr": "1500..9216" | ||
}, | ||
"MGMT_PORT_DEFAULT_MTU": { | ||
"desc": "VALIDATE DEFAULT MTU", | ||
"eStrKey": "Verify", | ||
"verify": { | ||
"xpath": "/sonic-mgmt_port:sonic-mgmt_port/MGMT_PORT/MGMT_PORT_LIST[name='eth0']/name", | ||
"key": "sonic-mgmt_port:mtu", | ||
"value": 1500 | ||
} | ||
}, | ||
"MGMT_PORT_INVALID_AUTONEG": { | ||
"desc": "INVALID AUTONEG CONFIGURATION", | ||
"eStrKey": "Pattern" | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/sonic-yang-models/tests/yang_model_tests/tests/mgmt_vrf.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,8 @@ | ||
{ | ||
"MGMT_VRF_TEST": { | ||
"desc": "LOAD MGMT VRF TABLE WITH mgmtVrfEnabled SET TO TRUE SUCCESSFULLY." | ||
}, | ||
"MGMT_VRF_TEST_WITH_DEFAULT_VALUE": { | ||
"desc": "LOAD MGMT VRF TABLE WITH DEFAULT mgmtVrfEnabled SUCCESSFULLY." | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
src/sonic-yang-models/tests/yang_model_tests/tests/ntp.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,62 @@ | ||
{ | ||
"NTP_SERVER_TEST": { | ||
"desc": "LOAD NTP SERVER TABLE WITH ADDRESS WITH IPV4, IPV6 AND HOST NAME AS NTP SERVERS." | ||
}, | ||
"NTP_SERVER_1_NEG_TEST": { | ||
"desc": "LOAD NTP SERVER TABLE WITH EMPTY ADDRESS AS NTP SERVER.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["server_address"] | ||
}, | ||
"NTP_SERVER_2_NEG_TEST": { | ||
"desc": "LOAD NTP SERVER TABLE WITH INVALID IP ADDRESS AS NTP SERVER.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["server_address"] | ||
}, | ||
"NTP_SERVER_3_NEG_TEST": { | ||
"desc": "LOAD NTP SERVER TABLE WITH INVALID HOST NAME AS NTP SERVER.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["server_address"] | ||
}, | ||
"NTP_DEFAULT_VRF_TEST": { | ||
"desc": "CONFIGURE NTP IN DEFAULT VRF." | ||
}, | ||
"NTP_MGMT_VRF_TEST": { | ||
"desc": "CONFIGURE NTP IN MGMT VRF." | ||
}, | ||
"NTP_MGMT_VRF_INVALID_MGMT_VRF_STATE_TEST": { | ||
"desc": "CONFIGURE NTP IN MGMT VRF WITH MGMT VRF DISABLED SHOULD BE REJECTED.", | ||
"eStrKey": "Must" | ||
}, | ||
"NTP_MGMT_VRF_WITH_NOEXIST_MGMT_VRF_TEST": { | ||
"desc": "CONFIGURE NTP IN MGMT VRF WITHOUT MGMT VRF CONFIGURED SHOULD BE REJECTED.", | ||
"eStrKey": "Must" | ||
}, | ||
"NTP_VRF_INVALID_NAME": { | ||
"desc": "CONFIGURE NTP IN INVALID VRF.", | ||
"eStrKey": "Pattern", | ||
"eStr": ["mgmt|default"] | ||
}, | ||
"NTP_SRC_INTF": { | ||
"desc": "CONFIGURE MULTIPLE INTERFACES AS NTP SOURCE INTERFACE." | ||
}, | ||
"NTP_SRC_INTF_WITH_NONEXIST_ETH_PORT": { | ||
"desc": "CONFIGURE NON-EXISTING ETHERNET INTERFACE AS NTP SOURCE INTERFACE.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["src"] | ||
}, | ||
"NTP_SRC_INTF_WITH_NONEXIST_LOOPBACK_INTF": { | ||
"desc": "CONFIGURE NON-EXISTING LOOPBACK INTERFACE AS NTP SOURCE INTERFACE.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["src"] | ||
}, | ||
"NTP_SRC_INTF_WITH_NONEXIST_PORTCHANNEL_INTF": { | ||
"desc": "CONFIGURE NON-EXISTING PORTCHANNEL INTERFACE AS NTP SOURCE INTERFACE.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["src"] | ||
}, | ||
"NTP_SRC_INTF_WITH_NONEXIST_MGMT_INTF": { | ||
"desc": "CONFIGURE NON-EXISTING MGMT INTERFACE AS NTP SOURCE INTERFACE.", | ||
"eStrKey": "InvalidValue", | ||
"eStr": ["src"] | ||
} | ||
} |
114 changes: 114 additions & 0 deletions
114
src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_interface.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,114 @@ | ||
{ | ||
"MGMT_INTERFACE_TEST": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-mgmt_interface:sonic-mgmt_interface": { | ||
"sonic-mgmt_interface:MGMT_INTERFACE": { | ||
"MGMT_INTERFACE_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"ip_prefix": "10.11.12.13/16", | ||
"gwaddr": "10.11.12.254" | ||
}, | ||
{ | ||
"name": "eth0", | ||
"ip_prefix": "2001:aa:aa::aa/64", | ||
"gwaddr": "2001:aa:aa::fe", | ||
"forced_mgmt_routes": [ | ||
"10.3.145.14", | ||
"2001:aa:aa::aa", | ||
"10.0.0.100/31", | ||
"10.250.0.8/24" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_INTERFACE_WITH_NON_EXIST_PORT": { | ||
"sonic-mgmt_interface:sonic-mgmt_interface": { | ||
"sonic-mgmt_interface:MGMT_INTERFACE": { | ||
"MGMT_INTERFACE_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"ip_prefix": "2001:aa:aa::aa/64", | ||
"gwaddr": "2001:aa:aa::fe" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_INTERFACE_WITH_WRONG_PORT": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth1" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-mgmt_interface:sonic-mgmt_interface": { | ||
"sonic-mgmt_interface:MGMT_INTERFACE": { | ||
"MGMT_INTERFACE_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"ip_prefix": "10.11.12.13/16", | ||
"gwaddr": "10.11.12.254" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_INTERFACE_IPV4_ADDR_WITH_IPV6_GW": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-mgmt_interface:sonic-mgmt_interface": { | ||
"sonic-mgmt_interface:MGMT_INTERFACE": { | ||
"MGMT_INTERFACE_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"ip_prefix": "10.11.12.13/24", | ||
"gwaddr": "2001:aa:aa::aa" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_INTERFACE_IPV6_ADDR_WITH_IPV4_GW": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0" | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-mgmt_interface:sonic-mgmt_interface": { | ||
"sonic-mgmt_interface:MGMT_INTERFACE": { | ||
"MGMT_INTERFACE_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"ip_prefix": "2001:aa:aa::aa/64", | ||
"gwaddr": "10.11.12.13" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/sonic-yang-models/tests/yang_model_tests/tests_config/mgmt_port.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,77 @@ | ||
{ | ||
"MGMT_PORT_TEST": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"alias": "eth0", | ||
"name": "eth0", | ||
"admin_status": "up", | ||
"speed": 100, | ||
"autoneg": "off", | ||
"description": "management interface", | ||
"mtu": 1500 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_PORT_INVALID_NAME_PATTERN": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "ethernet0" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_PORT_INVALID_SPEED": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"speed": 222 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_PORT_INVALID_MTU": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"mtu": 500 | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_PORT_DEFAULT_MTU": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"MGMT_PORT_INVALID_AUTONEG": { | ||
"sonic-mgmt_port:sonic-mgmt_port": { | ||
"sonic-mgmt_port:MGMT_PORT": { | ||
"MGMT_PORT_LIST": [ | ||
{ | ||
"name": "eth0", | ||
"autoneg": "true" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.