meta-flow: Correctly set destination MAC in mf_set_flow_value().
[sliver-openvswitch.git] / tests / stp.at
1 AT_BANNER([Spanning Tree Protocol unit tests])
2
3 AT_SETUP([STP example from IEEE 802.1D-1998])
4 AT_KEYWORDS([STP])
5 AT_DATA([test-stp-ieee802.1d-1998],
6 [bridge 0 0x42 = a b
7 bridge 1 0x97 = c:5 a d:5
8 bridge 2 0x45 = b e
9 bridge 3 0x57 = b:5 e:5
10 bridge 4 0x83 = a:5 e:5
11 run 1000
12 check 0 = root
13 check 1 = F F:10 F
14 check 2 = F:10 B
15 check 3 = F:5 F
16 check 4 = F:5 B
17 ])
18 AT_CHECK([test-stp test-stp-ieee802.1d-1998])
19 AT_CLEANUP
20
21 AT_SETUP([STP example from IEEE 802.1D-2004 figures 17.4 and 17.5])
22 AT_KEYWORDS([STP])
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
32 run 1000
33 check 0 = root
34 check 1 = F:10 B F F
35 check 2 = F:10 B F F F F
36 check 3 = F:10 B F F F F
37 check 4 = F:20 B F F
38 check 5 = F:20 B F F
39 check 6 = F:20 B F F
40 check 7 = F:20 B F F
41
42 # Now connect two ports of bridge 7 to the same LAN.
43 bridge 7 = l n o o
44 # Same results except for bridge 7:
45 run 1000
46 check 0 = root
47 check 1 = F:10 B F F
48 check 2 = F:10 B F F F F
49 check 3 = F:10 B F F F F
50 check 4 = F:20 B F F
51 check 5 = F:20 B F F
52 check 6 = F:20 B F F
53 check 7 = F:20 B F B
54 ])
55 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.4])
56 AT_CLEANUP
57
58 AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.6])
59 AT_KEYWORDS([STP])
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
67 run 1000
68 check 0 = root
69 check 1 = F:10 F F
70 check 2 = F:20 F F
71 check 3 = F:30 F B
72 check 4 = F:20 F F
73 check 5 = F:10 F F
74 ])
75 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.6])
76 AT_CLEANUP
77
78 AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.7])
79 AT_KEYWORDS([STP])
80 AT_DATA([test-stp-ieee802.1d-2004-fig17.7],
81 [bridge 0 0xaa = b
82 bridge 1 0x111 = a b d f h g e c
83 bridge 2 0x222 = g h j l n m k i
84 run 1000
85 check 0 = root
86 check 1 = F F:10 F F F F F F
87 check 2 = B F:20 F F F F F F
88
89 # This is not the port priority change described in that figure,
90 # but I don't understand what port priority change would cause
91 # that change.
92 bridge 2 = g X j l n m k i
93 run 1000
94 check 0 = root
95 check 1 = F F:10 F F F F F F
96 check 2 = F:20 D F F F F F F
97 ])
98 AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.7])
99 AT_CLEANUP
100
101 AT_SETUP([STP.io.1.1: Link Failure])
102 AT_KEYWORDS([STP])
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
106 # Version 1.5":
107 #
108 # STP.io.1.1: Link Failure
109 bridge 0 0x111 = a b c
110 bridge 1 0x222 = a b c
111 run 1000
112 check 0 = root
113 check 1 = F:10 B B
114 bridge 1 = 0 _ _
115 run 1000
116 check 0 = root
117 check 1 = F F:10 B
118 bridge 1 = X _ _
119 run 1000
120 check 0 = root
121 check 1 = D F:10 B
122 bridge 1 = _ 0 _
123 run 1000
124 check 0 = root
125 check 1 = D F F:10
126 bridge 1 = _ X _
127 run 1000
128 check 0 = root
129 check 1 = D D F:10
130 ])
131 AT_CHECK([test-stp test-stp-iol-io-1.1])
132 AT_CLEANUP
133
134 AT_SETUP([STP.io.1.2: Repeated Network])
135 AT_KEYWORDS([STP])
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
139 # Version 1.5":
140 # STP.io.1.2: Repeated Network
141 bridge 0 0x111 = a a
142 bridge 1 0x222 = a a
143 run 1000
144 check 0 = rootid:0x111 F B
145 check 1 = rootid:0x111 F:10 B
146 bridge 1 = a^0x90 _
147 run 1000
148 check 0 = rootid:0x111 F B
149 check 1 = rootid:0x111 B F:10
150 ])
151 AT_CHECK([test-stp test-stp-iol-io-1.2])
152 AT_CLEANUP
153
154 AT_SETUP([STP.io.1.4: Network Initialization])
155 AT_KEYWORDS([STP])
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
159 # Version 1.5":
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
165 run 1000
166 check 0 = root
167 check 1 = F:10 F F
168 check 2 = F:10 B F
169 check 3 = F:10 B B
170 ])
171 AT_CHECK([test-stp test-stp-iol-io-1.4])
172 AT_CLEANUP
173
174 AT_SETUP([STP.io.1.5: Topology Change])
175 AT_KEYWORDS([STP])
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
179 # Version 1.5":
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
185 run 1000
186 check 0 = root
187 check 1 = F:10 B F F
188 check 2 = B F:10 F F
189 check 3 = B F:20 B B
190 bridge 1^0x7000
191 run 1000
192 check 0 = F:10 B F F
193 check 1 = root
194 check 2 = B F:20 B B
195 check 3 = B F:10 F F
196 bridge 2^0x6000
197 run 1000
198 check 0 = F F B F:10
199 check 1 = F:20 B B B
200 check 2 = root
201 check 3 = F F F:10 B
202 bridge 3^0x5000
203 run 1000
204 check 0 = B B B F:20
205 check 1 = F F B F:10
206 check 2 = F F F:10 B
207 check 3 = root
208 bridge 0^0x4000
209 bridge 1^0x4001
210 bridge 2^0x4002
211 bridge 3^0x4003
212 run 1000
213 check 0 = root
214 check 1 = F:10 B F F
215 check 2 = B F:10 F F
216 check 3 = B F:20 B B
217 ])
218 AT_CHECK([test-stp test-stp-iol-io-1.5])
219 AT_CLEANUP
220
221 AT_SETUP([STP.op.1.1 and STP.op.1.2])
222 AT_KEYWORDS([STP])
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
226 # Version 2.3":
227 # Test STP.op.1.1: Root ID Initialized to Bridge ID
228 # Test STP.op.1.2: Root Path Cost Initialized to Zero
229 bridge 0 0x123 =
230 check 0 = root
231 ])
232 AT_CHECK([test-stp test-stp-iol-op-1.1])
233 AT_CLEANUP
234
235 AT_SETUP([STP.op.1.4: All Ports Initialized to Designated Ports])
236 AT_KEYWORDS([STP])
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
240 # Version 2.3":
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
244 run 1000
245 check 0 = F F F F F F
246 ])
247 AT_CHECK([test-stp test-stp-iol-op-1.4])
248 AT_CLEANUP
249
250 AT_SETUP([STP.op.3.1: Root Bridge Selection: Root ID Values])
251 AT_KEYWORDS([STP])
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
255 # Version 2.3":
256 # Test STP.op.3.1: Root Bridge Selection: Root ID Values
257 bridge 0 0x111 = a
258 bridge 1 0x222 = a
259 check 0 = rootid:0x111 Li
260 check 1 = rootid:0x222 Li
261 run 1000
262 check 0 = rootid:0x111 root
263 check 1 = rootid:0x111 F:10
264 ])
265 AT_CHECK([test-stp test-stp-iol-op-3.1])
266 AT_CLEANUP
267
268 AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
269 AT_KEYWORDS([STP])
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
273 # Version 2.3":
274 # Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
275 bridge 0 0x333^0x6000 = a
276 bridge 1 0x222^0x7000 = b
277 bridge 2 0x111 = a b
278 run 1000
279 check 0 = rootid:0x333^0x6000 root
280 check 1 = rootid:0x333^0x6000 F:20
281 check 2 = rootid:0x333^0x6000 F:10 F
282 ])
283 AT_CHECK([test-stp test-stp-iol-op-3.3])
284 AT_CLEANUP
285
286 AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
287 AT_KEYWORDS([STP])
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
291 # Version 2.3":
292 # Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
293 bridge 0 0x333^0x6000 = a
294 bridge 1 0x222^0x7000 = b
295 bridge 2 0x111 = a b
296 run 1000
297 check 0 = rootid:0x333^0x6000 root
298 check 1 = rootid:0x333^0x6000 F:20
299 check 2 = rootid:0x333^0x6000 F:10 F
300 ])
301 AT_CHECK([test-stp test-stp-iol-op-3.4])
302 AT_CLEANUP