Skip to content

Commit dfa1074

Browse files
committed
Fixing STP YANG model errors
1 parent 8ae4468 commit dfa1074

File tree

4 files changed

+109
-221
lines changed

4 files changed

+109
-221
lines changed

src/sonic-yang-models/tests/files/sample_config_db.json

+25-104
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,6 @@
23652365

23662366
"STP": {
23672367
"GLOBAL": {
2368-
"global-stp-mode": "GLOBAL",
23692368
"mode": "pvst",
23702369
"rootguard_timeout": "30",
23712370
"forward_delay": "15",
@@ -2380,17 +2379,19 @@
23802379
"hello_time": "2",
23812380
"max_age": "20",
23822381
"priority": "32768",
2383-
"enabled": "true"
2382+
"enabled": "true",
2383+
"vlanid": "100"
23842384
},
23852385
"Vlan200": {
23862386
"forward_delay": "16",
23872387
"hello_time": "3",
23882388
"max_age": "22",
23892389
"priority": "16384",
2390-
"enabled": "true"
2390+
"enabled": "true",
2391+
"vlanid": "200"
23912392
}
23922393
},
2393-
"STP_VLAN_INTF": {
2394+
"STP_VLAN_PORT": {
23942395
"Vlan100|Ethernet0": {
23952396
"path_cost": "200000",
23962397
"priority": "128"
@@ -2400,120 +2401,40 @@
24002401
"priority": "64"
24012402
},
24022403
"Vlan200|Ethernet4": {
2403-
"path_cost": "200000",
2404+
"path_cost": "200000",
24042405
"priority": "128"
24052406
}
24062407
},
2407-
"STP_INTF": {
2408+
"STP_PORT": {
24082409
"Ethernet0": {
2409-
"enabled": "1",
2410-
"root_guard": "0",
2411-
"bpdu_guard": "0",
2412-
"bpdu_guard_do_disable": "0",
2410+
"enabled": "true",
2411+
"root_guard": "false",
2412+
"bpdu_guard": "false",
2413+
"bpdu_guard_do_disable": "false",
24132414
"path_cost": "200000",
24142415
"priority": "128",
2415-
"portfast": "1",
2416-
"uplink_fast": "0"
2416+
"portfast": "true",
2417+
"uplink_fast": "false"
24172418
},
24182419
"Ethernet4": {
2419-
"enabled": "1",
2420-
"root_guard": "0",
2421-
"bpdu_guard": "1",
2422-
"bpdu_guard_do_disable": "1",
2420+
"enabled": "true",
2421+
"root_guard": "false",
2422+
"bpdu_guard": "true",
2423+
"bpdu_guard_do_disable": "true",
24232424
"path_cost": "200000",
24242425
"priority": "128",
2425-
"portfast": "0",
2426-
"uplink_fast": "0"
2426+
"portfast": "false",
2427+
"uplink_fast": "false"
24272428
},
24282429
"PortChannel2": {
2429-
"enabled": "1",
2430-
"root_guard": "1",
2431-
"bpdu_guard": "0",
2432-
"bpdu_guard_do_disable": "0",
2430+
"enabled": "true",
2431+
"root_guard": "true",
2432+
"bpdu_guard": "false",
2433+
"bpdu_guard_do_disable": "false",
24332434
"path_cost": "20000",
24342435
"priority": "64",
2435-
"portfast": "0",
2436-
"uplink_fast": "1"
2437-
}
2438-
},
2439-
2440-
"STP_MST": {
2441-
"GLOBAL": {
2442-
"global-stp-mode": "GLOBAL",
2443-
"name": "region1",
2444-
"revision": "0",
2445-
"max_hops": "20",
2446-
"max_age": "20",
2447-
"hello_time": "2",
2448-
"forward_delay": "15"
2449-
}
2450-
},
2451-
"STP_MST_INST": {
2452-
"0": {
2453-
"bridge_priority": "32768",
2454-
"vlan_list": "1-99,4000-4094"
2455-
},
2456-
"1": {
2457-
"bridge_priority": "16384",
2458-
"vlan_list": "100-199"
2459-
},
2460-
"2": {
2461-
"bridge_priority": "20480",
2462-
"vlan_list": "200-299"
2463-
},
2464-
"3": {
2465-
"bridge_priority": "24576",
2466-
"vlan_list": "300-399"
2467-
}
2468-
},
2469-
"STP_MST_PORT": {
2470-
"0|Ethernet0": {
2471-
"path_cost": "200000",
2472-
"priority": "128"
2473-
},
2474-
"1|Ethernet0": {
2475-
"path_cost": "200000",
2476-
"priority": "128"
2477-
},
2478-
"2|Ethernet4": {
2479-
"path_cost": "200000",
2480-
"priority": "128"
2481-
},
2482-
"3|PortChannel2": {
2483-
"path_cost": "20000",
2484-
"priority": "64"
2485-
}
2486-
},
2487-
"STP_PORT": {
2488-
"Ethernet0": {
2489-
"edge_port": "1",
2490-
"link_type": "point-to-point",
2491-
"enabled": "1",
2492-
"bpdu_guard": "0",
2493-
"bpdu_guard_do": "0",
2494-
"root_guard": "0",
2495-
"path_cost": "200000",
2496-
"priority": "128"
2497-
},
2498-
"Ethernet4": {
2499-
"edge_port": "0",
2500-
"link_type": "shared",
2501-
"enabled": "1",
2502-
"bpdu_guard": "1",
2503-
"bpdu_guard_do": "1",
2504-
"root_guard": "0",
2505-
"path_cost": "200000",
2506-
"priority": "128"
2507-
},
2508-
"PortChannel2": {
2509-
"edge_port": "0",
2510-
"link_type": "point-to-point",
2511-
"enabled": "1",
2512-
"bpdu_guard": "0",
2513-
"bpdu_guard_do": "0",
2514-
"root_guard": "1",
2515-
"path_cost": "20000",
2516-
"priority": "64"
2436+
"portfast": "false",
2437+
"uplink_fast": "true"
25172438
}
25182439
},
25192440

src/sonic-yang-models/tests/yang_model_tests/tests/stp.json

-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,5 @@
22
"PVST_GLOBAL_VALID": {
33
"desc": "Configure valid global PVST settings",
44
"eStr": []
5-
},
6-
"MSTP_GLOBAL_VALID": {
7-
"desc": "Configure valid global MSTP settings",
8-
"eStr": []
95
}
106
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/stp.json

+2-27
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"PVST_GLOBAL_VALID": {
33
"sonic-spanning-tree:sonic-spanning-tree": {
44
"sonic-spanning-tree:STP": {
5-
"GLOBAL": [
5+
"STP_LIST": [
66
{
7-
"global-stp-mode": "GLOBAL",
7+
"keyleaf": "GLOBAL",
88
"mode": "pvst",
99
"rootguard_timeout": 30,
1010
"forward_delay": 15,
@@ -15,30 +15,5 @@
1515
]
1616
}
1717
}
18-
},
19-
"MSTP_GLOBAL_VALID": {
20-
"sonic-spanning-tree:sonic-spanning-tree": {
21-
"sonic-spanning-tree:STP": {
22-
"GLOBAL": [
23-
{
24-
"global-stp-mode": "GLOBAL",
25-
"mode": "mst"
26-
}
27-
]
28-
},
29-
"sonic-spanning-tree:STP_MST": {
30-
"GLOBAL": [
31-
{
32-
"global-stp-mode": "GLOBAL",
33-
"name": "region1",
34-
"revision": 0,
35-
"max_hops": 20,
36-
"max_age": 20,
37-
"hello_time": 2,
38-
"forward_delay": 15
39-
}
40-
]
41-
}
42-
}
4318
}
4419
}

0 commit comments

Comments
 (0)