Skip to content

Commit 98a03ae

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

File tree

4 files changed

+123
-177
lines changed

4 files changed

+123
-177
lines changed

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

+41-62
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",
@@ -2374,20 +2373,33 @@
23742373
"priority": "32768"
23752374
}
23762375
},
2376+
2377+
"STP": {
2378+
"GLOBAL": {
2379+
"mode": "mst",
2380+
"forward_delay": 15,
2381+
"hello_time": 2,
2382+
"max_age": 20,
2383+
"priority": 32768
2384+
}
2385+
},
2386+
23772387
"STP_VLAN": {
23782388
"Vlan100": {
23792389
"forward_delay": "15",
23802390
"hello_time": "2",
23812391
"max_age": "20",
23822392
"priority": "32768",
2383-
"enabled": "true"
2393+
"enabled": "true",
2394+
"vlanid": "100"
23842395
},
23852396
"Vlan200": {
23862397
"forward_delay": "16",
23872398
"hello_time": "3",
23882399
"max_age": "22",
23892400
"priority": "16384",
2390-
"enabled": "true"
2401+
"enabled": "true",
2402+
"vlanid": "200"
23912403
}
23922404
},
23932405
"STP_VLAN_INTF": {
@@ -2400,70 +2412,69 @@
24002412
"priority": "64"
24012413
},
24022414
"Vlan200|Ethernet4": {
2403-
"path_cost": "200000",
2415+
"path_cost": "200000",
24042416
"priority": "128"
24052417
}
24062418
},
2407-
"STP_INTF": {
2419+
"STP_PORT": {
24082420
"Ethernet0": {
2409-
"enabled": "1",
2410-
"root_guard": "0",
2411-
"bpdu_guard": "0",
2412-
"bpdu_guard_do_disable": "0",
2421+
"enabled": "true",
2422+
"root_guard": "false",
2423+
"bpdu_guard": "false",
2424+
"bpdu_guard_do_disable": "false",
24132425
"path_cost": "200000",
24142426
"priority": "128",
2415-
"portfast": "1",
2416-
"uplink_fast": "0"
2427+
"portfast": "true",
2428+
"uplink_fast": "false"
24172429
},
24182430
"Ethernet4": {
2419-
"enabled": "1",
2420-
"root_guard": "0",
2421-
"bpdu_guard": "1",
2422-
"bpdu_guard_do_disable": "1",
2431+
"enabled": "true",
2432+
"root_guard": "false",
2433+
"bpdu_guard": "true",
2434+
"bpdu_guard_do_disable": "true",
24232435
"path_cost": "200000",
24242436
"priority": "128",
2425-
"portfast": "0",
2426-
"uplink_fast": "0"
2437+
"portfast": "false",
2438+
"uplink_fast": "false"
24272439
},
24282440
"PortChannel2": {
2429-
"enabled": "1",
2430-
"root_guard": "1",
2431-
"bpdu_guard": "0",
2432-
"bpdu_guard_do_disable": "0",
2441+
"enabled": "true",
2442+
"root_guard": "true",
2443+
"bpdu_guard": "false",
2444+
"bpdu_guard_do_disable": "false",
24332445
"path_cost": "20000",
24342446
"priority": "64",
2435-
"portfast": "0",
2436-
"uplink_fast": "1"
2447+
"portfast": "false",
2448+
"uplink_fast": "true"
24372449
}
24382450
},
2439-
24402451
"STP_MST": {
24412452
"GLOBAL": {
2442-
"global-stp-mode": "GLOBAL",
24432453
"name": "region1",
24442454
"revision": "0",
24452455
"max_hops": "20",
24462456
"max_age": "20",
24472457
"hello_time": "2",
2448-
"forward_delay": "15"
2458+
"forward_delay": "15",
2459+
"hold_count": "6"
24492460
}
24502461
},
24512462
"STP_MST_INST": {
24522463
"0": {
24532464
"bridge_priority": "32768",
2454-
"vlan_list": "1-99,4000-4094"
2465+
"vlan": ["1-99", "4000-4094"]
24552466
},
24562467
"1": {
24572468
"bridge_priority": "16384",
2458-
"vlan_list": "100-199"
2469+
"vlan": ["100-199"]
24592470
},
24602471
"2": {
24612472
"bridge_priority": "20480",
2462-
"vlan_list": "200-299"
2473+
"vlan": ["200-299"]
24632474
},
24642475
"3": {
24652476
"bridge_priority": "24576",
2466-
"vlan_list": "300-399"
2477+
"vlan": ["300-399"]
24672478
}
24682479
},
24692480
"STP_MST_PORT": {
@@ -2484,38 +2495,6 @@
24842495
"priority": "64"
24852496
}
24862497
},
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"
2517-
}
2518-
},
25192498

25202499
"MCLAG_DOMAIN": {
25212500
"123": {

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)