Skip to content

Commit 7264a5b

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

File tree

4 files changed

+107
-174
lines changed

4 files changed

+107
-174
lines changed

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

+30-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",
@@ -2380,14 +2379,16 @@
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
},
23932394
"STP_VLAN_INTF": {
@@ -2400,70 +2401,69 @@
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"
2436+
"portfast": "false",
2437+
"uplink_fast": "true"
24372438
}
24382439
},
2439-
24402440
"STP_MST": {
24412441
"GLOBAL": {
2442-
"global-stp-mode": "GLOBAL",
24432442
"name": "region1",
24442443
"revision": "0",
24452444
"max_hops": "20",
24462445
"max_age": "20",
24472446
"hello_time": "2",
2448-
"forward_delay": "15"
2447+
"forward_delay": "15",
2448+
"hold_count": "6"
24492449
}
24502450
},
24512451
"STP_MST_INST": {
24522452
"0": {
24532453
"bridge_priority": "32768",
2454-
"vlan_list": "1-99,4000-4094"
2454+
"vlan": ["1-99", "4000-4094"]
24552455
},
24562456
"1": {
24572457
"bridge_priority": "16384",
2458-
"vlan_list": "100-199"
2458+
"vlan": ["100-199"]
24592459
},
24602460
"2": {
24612461
"bridge_priority": "20480",
2462-
"vlan_list": "200-299"
2462+
"vlan": ["200-299"]
24632463
},
24642464
"3": {
24652465
"bridge_priority": "24576",
2466-
"vlan_list": "300-399"
2466+
"vlan": ["300-399"]
24672467
}
24682468
},
24692469
"STP_MST_PORT": {
@@ -2484,38 +2484,6 @@
24842484
"priority": "64"
24852485
}
24862486
},
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-
},
25192487

25202488
"MCLAG_DOMAIN": {
25212489
"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)