1 AT_BANNER([Spanning Tree Protocol unit tests])
3 AT_SETUP([STP example from IEEE 802.1D-1998])
5 AT_DATA([test-stp-ieee802.1d-1998],
7 bridge 1 0x97 = c:5 a d:5
9 bridge 3 0x57 = b:5 e:5
10 bridge 4 0x83 = a:5 e:5
18 AT_CHECK([test-stp test-stp-ieee802.1d-1998], [0], [], [dnl
19 stp|INFO|stp42: detected topology change.
20 stp|INFO|stp42: detected topology change.
21 stp|INFO|stp97: detected topology change.
22 stp|INFO|stp97: detected topology change.
23 stp|INFO|stp97: detected topology change.
27 AT_SETUP([STP example from IEEE 802.1D-2004 figures 17.4 and 17.5])
29 AT_DATA([test-stp-ieee802.1d-2004-fig17.4],
30 [bridge 0 0x111 = a b e c
31 bridge 1 0x222 = a b d f
32 bridge 2 0x333 = c d l j h g
33 bridge 3 0x444 = e f n m k i
34 bridge 4 0x555 = g i 0 0
35 bridge 5 0x666 = h k 0 0
36 bridge 6 0x777 = j m 0 0
37 bridge 7 0x888 = l n 0 0
41 check 2 = F:10 B F F F F
42 check 3 = F:10 B F F F F
48 # Now connect two ports of bridge 7 to the same LAN.
50 # Same results except for bridge 7:
54 check 2 = F:10 B F F F F
55 check 3 = F:10 B F F F F
61 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.4], [0], [], [dnl
62 stp|INFO|stp111: detected topology change.
63 stp|INFO|stp111: detected topology change.
64 stp|INFO|stp111: detected topology change.
65 stp|INFO|stp111: detected topology change.
66 stp|INFO|stp222: detected topology change.
70 AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.6])
72 AT_DATA([test-stp-ieee802.1d-2004-fig17.6],
73 [bridge 0 0x111 = a b l
74 bridge 1 0x222 = b c d
75 bridge 2 0x333 = d e f
76 bridge 3 0x444 = f g h
77 bridge 4 0x555 = j h i
78 bridge 5 0x666 = l j k
87 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.6], [0], [], [dnl
88 stp|INFO|stp111: detected topology change.
89 stp|INFO|stp111: detected topology change.
90 stp|INFO|stp111: detected topology change.
91 stp|INFO|stp222: detected topology change.
92 stp|INFO|stp222: detected topology change.
96 AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.7])
98 AT_DATA([test-stp-ieee802.1d-2004-fig17.7],
100 bridge 1 0x111 = a b d f h g e c
101 bridge 2 0x222 = g h j l n m k i
104 check 1 = F F:10 F F F F F F
105 check 2 = B F:20 F F F F F F
107 # This is not the port priority change described in that figure,
108 # but I don't understand what port priority change would cause
110 bridge 2 = g X j l n m k i
113 check 1 = F F:10 F F F F F F
114 check 2 = F:20 D F F F F F F
116 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.7], [0], [], [dnl
117 stp|INFO|stpaa: detected topology change.
118 stp|INFO|stp111: detected topology change.
119 stp|INFO|stp111: detected topology change.
120 stp|INFO|stp111: detected topology change.
121 stp|INFO|stp111: detected topology change.
125 AT_SETUP([STP.io.1.1: Link Failure])
127 AT_DATA([test-stp-iol-io-1.1],
128 [# This test file approximates the following test from "Bridge
129 # Functions Consortium Spanning Tree Interoperability Test Suite
132 # STP.io.1.1: Link Failure
133 bridge 0 0x111 = a b c
134 bridge 1 0x222 = a b c
155 AT_CHECK([test-stp test-stp-iol-io-1.1], [0], [], [dnl
156 stp|INFO|stp111: detected topology change.
157 stp|INFO|stp111: detected topology change.
158 stp|INFO|stp111: detected topology change.
159 stp|INFO|stp222: detected topology change.
160 stp|INFO|stp111: detected topology change.
164 AT_SETUP([STP.io.1.2: Repeated Network])
166 AT_DATA([test-stp-iol-io-1.2],
167 [# This test file approximates the following test from "Bridge
168 # Functions Consortium Spanning Tree Interoperability Test Suite
170 # STP.io.1.2: Repeated Network
174 check 0 = rootid:0x111 F B
175 check 1 = rootid:0x111 F:10 B
178 check 0 = rootid:0x111 F B
179 check 1 = rootid:0x111 B F:10
181 AT_CHECK([test-stp test-stp-iol-io-1.2], [0], [], [dnl
182 stp|INFO|stp111: detected topology change.
183 stp|INFO|stp222: detected topology change.
184 stp|INFO|stp111: detected topology change.
188 AT_SETUP([STP.io.1.4: Network Initialization])
190 AT_DATA([test-stp-iol-io-1.4],
191 [# This test file approximates the following test from "Bridge
192 # Functions Consortium Spanning Tree Interoperability Test Suite
194 # STP.io.1.4: Network Initialization
195 bridge 0 0x111 = a b c
196 bridge 1 0x222 = b d e
197 bridge 2 0x333 = a d f
198 bridge 3 0x444 = c e f
205 AT_CHECK([test-stp test-stp-iol-io-1.4], [0], [], [dnl
206 stp|INFO|stp111: detected topology change.
207 stp|INFO|stp111: detected topology change.
208 stp|INFO|stp111: detected topology change.
209 stp|INFO|stp222: detected topology change.
210 stp|INFO|stp222: detected topology change.
214 AT_SETUP([STP.io.1.5: Topology Change])
216 AT_DATA([test-stp-iol-io-1.5],
217 [# This test file approximates the following test from "Bridge
218 # Functions Consortium Spanning Tree Interoperability Test Suite
220 # STP.io.1.5: Topology Change
221 bridge 0 0x111 = a b d c
222 bridge 1 0x222 = a b f e
223 bridge 2 0x333 = c d g h
224 bridge 3 0x444 = e f g h
258 AT_CHECK([test-stp test-stp-iol-io-1.5], [0], [], [dnl
259 stp|INFO|stp111: detected topology change.
260 stp|INFO|stp111: detected topology change.
261 stp|INFO|stp111: detected topology change.
262 stp|INFO|stp111: detected topology change.
263 stp|INFO|stp222: detected topology change.
267 AT_SETUP([STP.op.1.1 and STP.op.1.2])
269 AT_DATA([test-stp-iol-op-1.1],
270 [# This test file approximates the following tests from "Bridge
271 # Functions Consortium Spanning Tree Protocol Operations Test Suite
273 # Test STP.op.1.1: Root ID Initialized to Bridge ID
274 # Test STP.op.1.2: Root Path Cost Initialized to Zero
278 AT_CHECK([test-stp test-stp-iol-op-1.1])
281 AT_SETUP([STP.op.1.4: All Ports Initialized to Designated Ports])
283 AT_DATA([test-stp-iol-op-1.4],
284 [# This test file approximates the following test from "Bridge
285 # Functions Consortium Spanning Tree Protocol Operations Test Suite
287 # Test STP.op.1.4: All Ports Initialized to Designated Ports
288 bridge 0 0x123 = a b c d e f
289 check 0 = Li Li Li Li Li Li
291 check 0 = F F F F F F
293 AT_CHECK([test-stp test-stp-iol-op-1.4], [0], [], [dnl
294 stp|INFO|stp123: detected topology change.
295 stp|INFO|stp123: detected topology change.
296 stp|INFO|stp123: detected topology change.
297 stp|INFO|stp123: detected topology change.
298 stp|INFO|stp123: detected topology change.
302 AT_SETUP([STP.op.3.1: Root Bridge Selection: Root ID Values])
304 AT_DATA([test-stp-iol-op-3.1],
305 [# This test file approximates the following test from "Bridge
306 # Functions Consortium Spanning Tree Protocol Operations Test Suite
308 # Test STP.op.3.1: Root Bridge Selection: Root ID Values
311 check 0 = rootid:0x111 Li
312 check 1 = rootid:0x222 Li
314 check 0 = rootid:0x111 root
315 check 1 = rootid:0x111 F:10
317 AT_CHECK([test-stp test-stp-iol-op-3.1], [0], [], [dnl
318 stp|INFO|stp111: detected topology change.
322 AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
324 AT_DATA([test-stp-iol-op-3.3],
325 [# This test file approximates the following test from "Bridge
326 # Functions Consortium Spanning Tree Protocol Operations Test Suite
328 # Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
329 bridge 0 0x333^0x6000 = a
330 bridge 1 0x222^0x7000 = b
333 check 0 = rootid:0x333^0x6000 root
334 check 1 = rootid:0x333^0x6000 F:20
335 check 2 = rootid:0x333^0x6000 F:10 F
337 AT_CHECK([test-stp test-stp-iol-op-3.3], [0], [], [dnl
338 stp|INFO|stp333: detected topology change.
339 stp|INFO|stp111: detected topology change.
340 stp|INFO|stp111: detected topology change.
341 stp|INFO|stp333: detected topology change.
345 AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
347 AT_DATA([test-stp-iol-op-3.4],
348 [# This test file approximates the following test from "Bridge
349 # Functions Consortium Spanning Tree Protocol Operations Test Suite
351 # Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
352 bridge 0 0x333^0x6000 = a
353 bridge 1 0x222^0x7000 = b
356 check 0 = rootid:0x333^0x6000 root
357 check 1 = rootid:0x333^0x6000 F:20
358 check 2 = rootid:0x333^0x6000 F:10 F
360 AT_CHECK([test-stp test-stp-iol-op-3.4], [0], [], [dnl
361 stp|INFO|stp333: detected topology change.
362 stp|INFO|stp111: detected topology change.
363 stp|INFO|stp111: detected topology change.
364 stp|INFO|stp333: detected topology change.