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])
21 AT_SETUP([STP example from IEEE 802.1D-2004 figures 17.4 and 17.5])
23 AT_DATA([test-stp-ieee802.1d-2004-fig17.4],
24 [bridge 0 0x111 = a b e c
25 bridge 1 0x222 = a b d f
26 bridge 2 0x333 = c d l j h g
27 bridge 3 0x444 = e f n m k i
28 bridge 4 0x555 = g i 0 0
29 bridge 5 0x666 = h k 0 0
30 bridge 6 0x777 = j m 0 0
31 bridge 7 0x888 = l n 0 0
35 check 2 = F:10 B F F F F
36 check 3 = F:10 B F F F F
42 # Now connect two ports of bridge 7 to the same LAN.
44 # Same results except for bridge 7:
48 check 2 = F:10 B F F F F
49 check 3 = F:10 B F F F F
55 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.4])
58 AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.6])
60 AT_DATA([test-stp-ieee802.1d-2004-fig17.6],
61 [bridge 0 0x111 = a b l
62 bridge 1 0x222 = b c d
63 bridge 2 0x333 = d e f
64 bridge 3 0x444 = f g h
65 bridge 4 0x555 = j h i
66 bridge 5 0x666 = l j k
75 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.6])
78 AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.7])
80 AT_DATA([test-stp-ieee802.1d-2004-fig17.7],
82 bridge 1 0x111 = a b d f h g e c
83 bridge 2 0x222 = g h j l n m k i
86 check 1 = F F:10 F F F F F F
87 check 2 = B F:20 F F F F F F
89 # This is not the port priority change described in that figure,
90 # but I don't understand what port priority change would cause
92 bridge 2 = g X j l n m k i
95 check 1 = F F:10 F F F F F F
96 check 2 = F:20 D F F F F F F
98 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.7])
101 AT_SETUP([STP.io.1.1: Link Failure])
103 AT_DATA([test-stp-iol-io-1.1],
104 [# This test file approximates the following test from "Bridge
105 # Functions Consortium Spanning Tree Interoperability Test Suite
108 # STP.io.1.1: Link Failure
109 bridge 0 0x111 = a b c
110 bridge 1 0x222 = a b c
131 AT_CHECK([test-stp test-stp-iol-io-1.1])
134 AT_SETUP([STP.io.1.2: Repeated Network])
136 AT_DATA([test-stp-iol-io-1.2],
137 [# This test file approximates the following test from "Bridge
138 # Functions Consortium Spanning Tree Interoperability Test Suite
140 # STP.io.1.2: Repeated Network
144 check 0 = rootid:0x111 F B
145 check 1 = rootid:0x111 F:10 B
148 check 0 = rootid:0x111 F B
149 check 1 = rootid:0x111 B F:10
151 AT_CHECK([test-stp test-stp-iol-io-1.2])
154 AT_SETUP([STP.io.1.4: Network Initialization])
156 AT_DATA([test-stp-iol-io-1.4],
157 [# This test file approximates the following test from "Bridge
158 # Functions Consortium Spanning Tree Interoperability Test Suite
160 # STP.io.1.4: Network Initialization
161 bridge 0 0x111 = a b c
162 bridge 1 0x222 = b d e
163 bridge 2 0x333 = a d f
164 bridge 3 0x444 = c e f
171 AT_CHECK([test-stp test-stp-iol-io-1.4])
174 AT_SETUP([STP.io.1.5: Topology Change])
176 AT_DATA([test-stp-iol-io-1.5],
177 [# This test file approximates the following test from "Bridge
178 # Functions Consortium Spanning Tree Interoperability Test Suite
180 # STP.io.1.5: Topology Change
181 bridge 0 0x111 = a b d c
182 bridge 1 0x222 = a b f e
183 bridge 2 0x333 = c d g h
184 bridge 3 0x444 = e f g h
218 AT_CHECK([test-stp test-stp-iol-io-1.5])
221 AT_SETUP([STP.op.1.1 and STP.op.1.2])
223 AT_DATA([test-stp-iol-op-1.1],
224 [# This test file approximates the following tests from "Bridge
225 # Functions Consortium Spanning Tree Protocol Operations Test Suite
227 # Test STP.op.1.1: Root ID Initialized to Bridge ID
228 # Test STP.op.1.2: Root Path Cost Initialized to Zero
232 AT_CHECK([test-stp test-stp-iol-op-1.1])
235 AT_SETUP([STP.op.1.4: All Ports Initialized to Designated Ports])
237 AT_DATA([test-stp-iol-op-1.4],
238 [# This test file approximates the following test from "Bridge
239 # Functions Consortium Spanning Tree Protocol Operations Test Suite
241 # Test STP.op.1.4: All Ports Initialized to Designated Ports
242 bridge 0 0x123 = a b c d e f
243 check 0 = Li Li Li Li Li Li
245 check 0 = F F F F F F
247 AT_CHECK([test-stp test-stp-iol-op-1.4])
250 AT_SETUP([STP.op.3.1: Root Bridge Selection: Root ID Values])
252 AT_DATA([test-stp-iol-op-3.1],
253 [# This test file approximates the following test from "Bridge
254 # Functions Consortium Spanning Tree Protocol Operations Test Suite
256 # Test STP.op.3.1: Root Bridge Selection: Root ID Values
259 check 0 = rootid:0x111 Li
260 check 1 = rootid:0x222 Li
262 check 0 = rootid:0x111 root
263 check 1 = rootid:0x111 F:10
265 AT_CHECK([test-stp test-stp-iol-op-3.1])
268 AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
270 AT_DATA([test-stp-iol-op-3.3],
271 [# This test file approximates the following test from "Bridge
272 # Functions Consortium Spanning Tree Protocol Operations Test Suite
274 # Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
275 bridge 0 0x333^0x6000 = a
276 bridge 1 0x222^0x7000 = b
279 check 0 = rootid:0x333^0x6000 root
280 check 1 = rootid:0x333^0x6000 F:20
281 check 2 = rootid:0x333^0x6000 F:10 F
283 AT_CHECK([test-stp test-stp-iol-op-3.3])
286 AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
288 AT_DATA([test-stp-iol-op-3.4],
289 [# This test file approximates the following test from "Bridge
290 # Functions Consortium Spanning Tree Protocol Operations Test Suite
292 # Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
293 bridge 0 0x333^0x6000 = a
294 bridge 1 0x222^0x7000 = b
297 check 0 = rootid:0x333^0x6000 root
298 check 1 = rootid:0x333^0x6000 F:20
299 check 2 = rootid:0x333^0x6000 F:10 F
301 AT_CHECK([test-stp test-stp-iol-op-3.4])