Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wajahatrazi authored and ridahanif96 committed Jan 6, 2025
2 parents 0de9d67 + e684942 commit 158ff18
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 438 deletions.
2 changes: 1 addition & 1 deletion src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def run(self):
'./cvlyang-models/sonic-macsec.yang',
'./cvlyang-models/sonic-bmp.yang',
'./cvlyang-models/sonic-serial-console.yang',
'./yang-models/sonic-stp.yang',
'./cvlyang-models/sonic-stp.yang',
'./cvlyang-models/sonic-bgp-sentinel.yang']),
],
zip_safe=False,
Expand Down
146 changes: 4 additions & 142 deletions src/sonic-yang-models/tests/yang_model_tests/tests/stp.json
Original file line number Diff line number Diff line change
@@ -1,148 +1,10 @@
{
"STP_GLOBAL_CONFIG_TEST": {
"desc": "Configure STP globally with valid mode (mst or pvst)."
},
"STP_GLOBAL_INVALID_PRIORITY": {
"desc": "Configure an invalid priority value in the STP global settings.",
"eStrKey": "InvalidValue",
"eStr": ["priority"]
"STP_GLOBAL_VALID_TEST": {
"desc": "Configure valid global STP settings in PVST mode with default parameters"
},
"STP_GLOBAL_INVALID_MODE_TEST": {
"desc": "Configure STP globally with an invalid mode.",
"eStrKey": "InvalidSTPMode",
"eStr": ["Invalid STP mode value. Valid values are 'mst' or 'pvst'."]
},
"STP_GLOBAL_CONFIG_NO_MODE_NEG_TEST": {
"desc": "Configure STP globally without specifying a mode.",
"eStrKey": "Mandatory",
"eStr": ["STP mode must be specified."]
},
"STP_GLOBAL_INVALID_ROOTGUARD_TIMEOUT": {
"desc": "Configure an invalid root guard timeout in global STP settings.",
"eStrKey": "InvalidRootguardTimeout",
"eStr": ["Root-guard Timeout must be between 5 and 600 seconds."]
},
"STP_VLAN_VALID_CONFIG_TEST": {
"desc": "Configure PVST VLAN with valid parameters (priority and VLAN ID)."
},
"STP_VLAN_INVALID_VLAN_ID_NEG_TEST": {
"desc": "Configure PVST VLAN with an invalid VLAN ID.",
"eStrKey": "InvalidVlanID",
"eStr": ["VLAN ID must be between 1 and 4095."]
},
"STP_VLAN_INVALID_PRIORITY_NEG_TEST": {
"desc": "Configure PVST VLAN with an invalid bridge priority.",
"eStrKey": "InvalidPriority",
"eStr": ["Bridge priority must be between 0 and 61440."]
},
"STP_VLAN_MISSING_PRIORITY_NEG_TEST": {
"desc": "Configure PVST VLAN without specifying priority.",
"eStrKey": "Mandatory",
"eStr": ["Bridge priority must be specified for PVST VLAN."]
},
"STP_VLAN_DUPLICATE_CONFIG_NEG_TEST": {
"desc": "Configure PVST VLAN with a duplicate VLAN ID.",
"eStrKey": "DuplicateVlanID",
"eStr": ["Duplicate VLAN ID detected."]
},
"STP_INTERFACE_VALID_CONFIG_TEST": {
"desc": "Configure STP parameters on an interface with valid values."
},
"STP_INTERFACE_INVALID_COST_NEG_TEST": {
"desc": "Configure an invalid path cost for an interface.",
"eStrKey": "InvalidPathCost",
"eStr": ["Path cost must be between 1 and 200000000."]
},
"STP_INTERFACE_DUPLICATE_NEG_TEST": {
"desc": "Configure duplicate STP parameters for the same interface.",
"eStrKey": "DuplicateInterfaceConfig",
"eStr": ["Duplicate interface configuration detected."]
},
"STP_INTERFACE_INVALID_PORTFAST_NEG_TEST": {
"desc": "Configure portfast on MST mode interface.",
"eStrKey": "InvalidPortfast",
"eStr": ["Configuration not allowed in MST mode"]
},
"STP_MST_GLOBAL_CONFIG_TEST": {
"desc": "Configure MSTP globally with valid parameters."
},
"STP_MST_REGION_NAME_MISSING_NEG_TEST": {
"desc": "Configure MSTP region without specifying a name.",
"eStrKey": "Mandatory",
"eStr": ["MST region name must be provided."]
},
"STP_MST_REGION_NAME_INVALID_NEG_TEST": {
"desc": "Configure MSTP with an invalid region name.",
"desc": "Configure invalid STP mode value",
"eStrKey": "InvalidValue",
"eStr": ["MST region name must be between 1 and 32 characters."]
},
"STP_MST_INSTANCE_VALID_CONFIG_TEST": {
"desc": "Configure MSTP instance with valid instance ID and VLAN mapping."
},
"STP_MST_INSTANCE_DUPLICATE_ID_NEG_TEST": {
"desc": "Configure MSTP instance with a duplicate instance ID.",
"eStrKey": "DuplicateInstanceID",
"eStr": ["Duplicate MSTP instance ID detected."]
},
"STP_MST_INSTANCE_INVALID_VLAN_NEG_TEST": {
"desc": "Configure MSTP instance with an invalid VLAN list.",
"eStrKey": "InvalidVlanList",
"eStr": ["VLAN list contains invalid or out-of-range VLAN IDs."]
},
"STP_MST_INSTANCE_MISSING_VLAN_NEG_TEST": {
"desc": "Configure MSTP instance without associating VLANs.",
"eStrKey": "Mandatory",
"eStr": ["At least one VLAN must be associated with the MSTP instance."]
},
"STP_MST_PORT_CONFIG_TEST": {
"desc": "Configure MSTP parameters on a port with valid settings."
},
"STP_MST_PORT_INVALID_PRIORITY_NEG_TEST": {
"desc": "Configure MSTP port with an invalid port priority.",
"eStrKey": "InvalidPortPriority",
"eStr": ["Port priority must be between 0 and 240."]
},
"STP_MST_PORT_INVALID_COST_NEG_TEST": {
"desc": "Configure MSTP port with an invalid path cost.",
"eStrKey": "InvalidPathCost",
"eStr": ["Path cost must be between 1 and 20000000."]
},
"STP_MST_PORT_DUPLICATE_NEG_TEST": {
"desc": "Configure MSTP parameters with duplicate port settings.",
"eStrKey": "DuplicatePortConfig",
"eStr": ["Duplicate MSTP port configuration detected."]
},
"STP_MST_PORT_EDGE_PORT_NEG_TEST": {
"desc": "Configure MSTP port with edge-port enabled in non-MST mode.",
"eStrKey": "InvalidEdgePort",
"eStr": ["Edge-port configuration is only allowed in MST mode."]
},
"STP_MST_PORT_LINK_TYPE_TEST": {
"desc": "Configure MSTP port with valid link type (auto, shared, point-to-point)."
},
"STP_MST_PORT_INVALID_LINK_TYPE_NEG_TEST": {
"desc": "Configure MSTP port with an invalid link type.",
"eStrKey": "InvalidLinkType",
"eStr": ["Link type must be 'auto', 'shared', or 'point-to-point'."]
},
"STP_MST_PORT_CONFIG_DUPLICATE_EDGE_PORT_NEG_TEST": {
"desc": "Configure MSTP port with duplicate edge-port configuration.",
"eStrKey": "DuplicateEdgePortConfig",
"eStr": ["Duplicate edge-port configuration detected."]
},
"STP_PORT_EDGE_PORT_TEST": {
"desc": "Configure edge port settings on an interface."
},
"STP_PORT_LINK_TYPE_TEST": {
"desc": "Configure link type settings on an interface."
},
"STP_MST_HOLD_COUNT_TEST": {
"desc": "Configure MST hold count with valid settings."
},
"STP_MST_HELLO_TIME_TEST": {
"desc": "Configure MST hello time with valid settings."
},
"STP_MST_MAX_HOPS_TEST": {
"desc": "Configure MST max hops with valid settings."
"eStr": ["Invalid_STP_mode"]
}
}
Loading

0 comments on commit 158ff18

Please sign in to comment.