Skip to content

Commit c4a339f

Browse files
committed
Fixed Errors in STP YANG model
1 parent cc45750 commit c4a339f

File tree

8 files changed

+3338
-102
lines changed

8 files changed

+3338
-102
lines changed

MSTP.md

+1,272
Large diffs are not rendered by default.

SONiC_PVST_HLD.md

+746
Large diffs are not rendered by default.

SONiC_YANG_Model_Guidelines.md

+1,018
Large diffs are not rendered by default.

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

+151
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,157 @@
23632363
}
23642364
},
23652365

2366+
"STP": {
2367+
"GLOBAL": {
2368+
"mode": "pvst",
2369+
"rootguard_timeout": "30",
2370+
"forward_delay": "15",
2371+
"hello_time": "2",
2372+
"max_age": "20",
2373+
"priority": "32768"
2374+
}
2375+
},
2376+
"STP_VLAN": {
2377+
"Vlan100": {
2378+
"forward_delay": "15",
2379+
"hello_time": "2",
2380+
"max_age": "20",
2381+
"priority": "32768",
2382+
"enabled": "true"
2383+
},
2384+
"Vlan200": {
2385+
"forward_delay": "16",
2386+
"hello_time": "3",
2387+
"max_age": "22",
2388+
"priority": "16384",
2389+
"enabled": "true"
2390+
}
2391+
},
2392+
"STP_VLAN_INTF": {
2393+
"Vlan100|Ethernet0": {
2394+
"path_cost": "200000",
2395+
"priority": "128"
2396+
},
2397+
"Vlan100|PortChannel2": {
2398+
"path_cost": "20000",
2399+
"priority": "64"
2400+
},
2401+
"Vlan200|Ethernet4": {
2402+
"path_cost": "200000",
2403+
"priority": "128"
2404+
}
2405+
},
2406+
"STP_INTF": {
2407+
"Ethernet0": {
2408+
"enabled": "1",
2409+
"root_guard": "0",
2410+
"bpdu_guard": "0",
2411+
"bpdu_guard_do_disable": "0",
2412+
"path_cost": "200000",
2413+
"priority": "128",
2414+
"portfast": "1",
2415+
"uplink_fast": "0"
2416+
},
2417+
"Ethernet4": {
2418+
"enabled": "1",
2419+
"root_guard": "0",
2420+
"bpdu_guard": "1",
2421+
"bpdu_guard_do_disable": "1",
2422+
"path_cost": "200000",
2423+
"priority": "128",
2424+
"portfast": "0",
2425+
"uplink_fast": "0"
2426+
},
2427+
"PortChannel2": {
2428+
"enabled": "1",
2429+
"root_guard": "1",
2430+
"bpdu_guard": "0",
2431+
"bpdu_guard_do_disable": "0",
2432+
"path_cost": "20000",
2433+
"priority": "64",
2434+
"portfast": "0",
2435+
"uplink_fast": "1"
2436+
}
2437+
},
2438+
2439+
"STP_MST": {
2440+
"GLOBAL": {
2441+
"name": "region1",
2442+
"revision": "0",
2443+
"max_hops": "20",
2444+
"max_age": "20",
2445+
"hello_time": "2",
2446+
"forward_delay": "15"
2447+
}
2448+
},
2449+
"STP_MST_INST": {
2450+
"0": {
2451+
"bridge_priority": "32768",
2452+
"vlan_list": "1-99,4000-4094"
2453+
},
2454+
"1": {
2455+
"bridge_priority": "16384",
2456+
"vlan_list": "100-199"
2457+
},
2458+
"2": {
2459+
"bridge_priority": "20480",
2460+
"vlan_list": "200-299"
2461+
},
2462+
"3": {
2463+
"bridge_priority": "24576",
2464+
"vlan_list": "300-399"
2465+
}
2466+
},
2467+
"STP_MST_PORT": {
2468+
"0|Ethernet0": {
2469+
"path_cost": "200000",
2470+
"priority": "128"
2471+
},
2472+
"1|Ethernet0": {
2473+
"path_cost": "200000",
2474+
"priority": "128"
2475+
},
2476+
"2|Ethernet4": {
2477+
"path_cost": "200000",
2478+
"priority": "128"
2479+
},
2480+
"3|PortChannel2": {
2481+
"path_cost": "20000",
2482+
"priority": "64"
2483+
}
2484+
},
2485+
"STP_PORT": {
2486+
"Ethernet0": {
2487+
"edge_port": "1",
2488+
"link_type": "point-to-point",
2489+
"enabled": "1",
2490+
"bpdu_guard": "0",
2491+
"bpdu_guard_do": "0",
2492+
"root_guard": "0",
2493+
"path_cost": "200000",
2494+
"priority": "128"
2495+
},
2496+
"Ethernet4": {
2497+
"edge_port": "0",
2498+
"link_type": "shared",
2499+
"enabled": "1",
2500+
"bpdu_guard": "1",
2501+
"bpdu_guard_do": "1",
2502+
"root_guard": "0",
2503+
"path_cost": "200000",
2504+
"priority": "128"
2505+
},
2506+
"PortChannel2": {
2507+
"edge_port": "0",
2508+
"link_type": "point-to-point",
2509+
"enabled": "1",
2510+
"bpdu_guard": "0",
2511+
"bpdu_guard_do": "0",
2512+
"root_guard": "1",
2513+
"path_cost": "20000",
2514+
"priority": "64"
2515+
}
2516+
},
23662517

23672518
"MCLAG_DOMAIN": {
23682519
"123": {

src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py

+2
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ def test_run_tests(self):
267267
elif test in self.SpecialTests:
268268
ret = ret + self.runSpecialTest(test);
269269
else:
270+
#log.error("Unexpected Test: {}".format(test))
271+
#ret = ret + 1
270272
raise Exception("Unexpected Test")
271273
except Exception as e:
272274
ret = FAIL * len(self.tests)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"PVST_GLOBAL_VALID": {
3-
"desc": "Configure valid global PVST settings"
4-
3+
"desc": "Configure valid global PVST settings",
4+
"eStr": []
5+
},
6+
"MSTP_GLOBAL_VALID": {
7+
"desc": "Configure valid global MSTP settings",
8+
"eStr": []
59
}
610
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"PVST_GLOBAL_VALID": {
33
"sonic-spanning-tree:sonic-spanning-tree": {
4-
"sonic-spanning-tree:stp-config": {
5-
"stp-list": [
4+
"sonic-spanning-tree:STP": {
5+
"GLOBAL": [
66
{
7-
"keyleaf": "GLOBAL",
7+
"global-stp-mode": "GLOBAL",
88
"mode": "pvst",
99
"rootguard_timeout": 30,
1010
"forward_delay": 15,
@@ -15,5 +15,34 @@
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+
"forward_delay": 15,
27+
"hello_time": 2,
28+
"max_age": 20,
29+
"priority": 32768
30+
}
31+
]
32+
},
33+
"sonic-spanning-tree:STP_MST": {
34+
"MST_GLOBAL": [
35+
{
36+
"global-stp-mode": "GLOBAL",
37+
"name": "region1",
38+
"revision": 0,
39+
"max_hops": 20,
40+
"hello_time": 2,
41+
"max_age": 20,
42+
"forward_delay": 15
43+
}
44+
]
45+
}
46+
}
1847
}
1948
}

0 commit comments

Comments
 (0)