-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yang-models] Add YANG model for SYSTEM_PORT (#12689)
Add YANG model for SYSTEM_PORT. Resolves #12458 YANG model for SYSTEM_PORT in CONFIG_DB was missing. Added new YANG model and associated unit tests. Passing unit tests
- Loading branch information
1 parent
c49f39b
commit 88301b3
Showing
8 changed files
with
331 additions
and
16 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
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
9 changes: 9 additions & 0 deletions
9
src/sonic-yang-models/tests/yang_model_tests/tests/system_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,9 @@ | ||
{ | ||
"SYSTEM_PORT_POSITIVE_CONFIG": { | ||
"desc": "Configure SYSTEM_PORT positive config." | ||
}, | ||
"SYSTEM_PORT_WRONG_SPEED_PATTERN": { | ||
"desc": "Configure SYSTEM_PORT wrong speed.", | ||
"eStr": ["pattern", "does not satisfy"] | ||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
src/sonic-yang-models/tests/yang_model_tests/tests_config/system_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,91 @@ | ||
{ | ||
"SYSTEM_PORT_POSITIVE_CONFIG": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet0", | ||
"speed": 100000 | ||
}, | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth4", | ||
"description": "Ethernet4", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet4", | ||
"speed": 100000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-system-port:sonic-system-port": { | ||
"sonic-system-port:SYSTEM_PORT": { | ||
"SYSTEM_PORT_LIST": [ | ||
{ | ||
"hostname": "host123", | ||
"asic_name": "asic0", | ||
"ifname": "Ethernet0", | ||
"core_index": "0", | ||
"core_port_index": "10", | ||
"num_voq": "8", | ||
"speed": "100000", | ||
"switch_id": "0", | ||
"system_port_id": "100" | ||
}, | ||
{ | ||
"hostname": "host123", | ||
"asic_name": "asic1", | ||
"ifname": "Ethernet4", | ||
"core_index": "1", | ||
"core_port_index": "20", | ||
"num_voq": "8", | ||
"speed": "100000", | ||
"switch_id": "1", | ||
"system_port_id": "200" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"SYSTEM_PORT_WRONG_SPEED_PATTERN": { | ||
"sonic-port:sonic-port": { | ||
"sonic-port:PORT": { | ||
"PORT_LIST": [ | ||
{ | ||
"admin_status": "up", | ||
"alias": "eth0", | ||
"description": "Ethernet0", | ||
"lanes": "65", | ||
"mtu": 9000, | ||
"name": "Ethernet0", | ||
"speed": 100000 | ||
} | ||
] | ||
} | ||
}, | ||
"sonic-system-port:sonic-system-port": { | ||
"sonic-system-port:SYSTEM_PORT": { | ||
"SYSTEM_PORT_LIST": [ | ||
{ | ||
"hostname": "host456", | ||
"asic_name": "asic0", | ||
"ifname": "Ethernet0", | ||
"core_index": "1", | ||
"core_port_index": "20", | ||
"num_voq": "8", | ||
"speed": "900000", | ||
"switch_id": "1", | ||
"system_port_id": "200" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.