]> git.proxmox.com Git - mirror_ovs.git/blame - tests/lacp.at
checkpatch: Check FOR_EACH loops with numbers.
[mirror_ovs.git] / tests / lacp.at
CommitLineData
742468d9
EJ
1AT_BANNER([lacp])
2
adcf00ba
AZ
3# Strips out Reciulation ID information since it may change over time.
4m4_define([STRIP_RECIRC_ID], [[sed '
5 s/Recirc-ID.*$/<del>/
6' ]])
7
3e5aeeb5
AZ
8# Strips out active slave mac address since it may change over time.
9m4_define([STRIP_ACTIVE_SLAVE_MAC], [[sed '
10 s/active slave mac.*$/<active slave mac del>/
11' ]])
12
742468d9
EJ
13AT_SETUP([lacp - config])
14OVS_VSWITCHD_START([\
15 add-port br0 p1 --\
16 set Port p1 lacp=active --\
17 set Interface p1 type=dummy ])
18
bf24a5f9 19ovs-appctl time/stop
bdba1947 20ovs-appctl time/warp 300 100
bf24a5f9 21
a2a57624 22AT_CHECK([ovs-appctl lacp/show], [0], [dnl
742468d9 23---- p1 ----
6d7d467e
BP
24 status: active negotiated
25 sys_id: aa:55:aa:55:00:00
26 sys_priority: 65535
27 aggregation key: 1
28 lacp_time: slow
742468d9
EJ
29
30slave: p1: expired attached
6d7d467e
BP
31 port_id: 1
32 port_priority: 65535
33 may_enable: false
34
35 actor sys_id: aa:55:aa:55:00:00
36 actor sys_priority: 65535
37 actor port_id: 1
38 actor port_priority: 65535
39 actor key: 1
40 actor state: activity synchronized collecting distributing expired
41
42 partner sys_id: 00:00:00:00:00:00
43 partner sys_priority: 0
44 partner port_id: 0
45 partner port_priority: 0
46 partner key: 0
47 partner state: timeout
742468d9 48])
a2a57624 49AT_CHECK([ovs-appctl bond/show])
742468d9
EJ
50OVS_VSWITCHD_STOP
51AT_CLEANUP
52
a2a57624 53AT_SETUP([lacp - multi port config])
742468d9
EJ
54OVS_VSWITCHD_START([dnl
55 add-bond br0 bond p1 p2 --\
1f76f3b7 56 set Port bond lacp=active bond-mode=active-backup \
742468d9
EJ
57 other_config:lacp-time="fast" \
58 other_config:lacp-system-id=11:22:33:44:55:66 \
59 other_config:lacp-system-priority=54321 --\
60 set Interface p1 type=dummy \
61 other_config:lacp-port-id=11 \
62 other_config:lacp-port-priority=111 \
63 other_config:lacp-aggregation-key=3333 --\
64 set Interface p2 type=dummy \
65 other_config:lacp-port-id=22 \
66 other_config:lacp-port-priority=222 \
67 other_config:lacp-aggregation-key=3333 ])
68
bf24a5f9 69ovs-appctl time/stop
bdba1947 70ovs-appctl time/warp 300 100
bf24a5f9 71
742468d9
EJ
72AT_CHECK([ovs-appctl lacp/show], [0], [stdout])
73AT_CHECK([sed -e 's/aggregation key:.*/aggregation key: <omitted>/' < stdout], [0], [dnl
74---- bond ----
6d7d467e
BP
75 status: active negotiated
76 sys_id: 11:22:33:44:55:66
77 sys_priority: 54321
78 aggregation key: <omitted>
79 lacp_time: fast
742468d9
EJ
80
81slave: p1: expired attached
6d7d467e
BP
82 port_id: 11
83 port_priority: 111
84 may_enable: false
85
86 actor sys_id: 11:22:33:44:55:66
87 actor sys_priority: 54321
88 actor port_id: 11
89 actor port_priority: 111
90 actor key: 3333
91 actor state: activity timeout aggregation synchronized collecting distributing expired
92
93 partner sys_id: 00:00:00:00:00:00
94 partner sys_priority: 0
95 partner port_id: 0
96 partner port_priority: 0
97 partner key: 0
98 partner state: timeout
742468d9
EJ
99
100slave: p2: expired attached
6d7d467e
BP
101 port_id: 22
102 port_priority: 222
103 may_enable: false
104
105 actor sys_id: 11:22:33:44:55:66
106 actor sys_priority: 54321
107 actor port_id: 22
108 actor port_priority: 222
109 actor key: 3333
110 actor state: activity timeout aggregation synchronized collecting distributing expired
111
112 partner sys_id: 00:00:00:00:00:00
113 partner sys_priority: 0
114 partner port_id: 0
115 partner port_priority: 0
116 partner key: 0
117 partner state: timeout
742468d9 118])
a2a57624
EJ
119AT_CHECK([ovs-appctl bond/show], [0], [dnl
120---- bond ----
121bond_mode: active-backup
adcf00ba 122bond may use recirculation: no, Recirc-ID : -1
a2a57624
EJ
123bond-hash-basis: 0
124updelay: 0 ms
125downdelay: 0 ms
bdebeece 126lacp_status: negotiated
57fc4fd0 127lacp_fallback_ab: false
3e5aeeb5 128active slave mac: 00:00:00:00:00:00(none)
a2a57624
EJ
129
130slave p1: disabled
828519ca 131 may_enable: false
a2a57624
EJ
132
133slave p2: disabled
828519ca 134 may_enable: false
a2a57624
EJ
135
136])
742468d9
EJ
137OVS_VSWITCHD_STOP
138AT_CLEANUP
f72f0c47
BP
139
140AT_SETUP([lacp - negotiation])
141# Create bond0 on br0 with interfaces p0 and p1
142# and bond1 on br1 with interfaces p2 and p3
143# with p0 patched to p2 and p1 patched to p3.
144OVS_VSWITCHD_START(
145 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
146 other-config:lacp-time=fast \
147 other-config:bond-rebalance-interval=0 -- \
b369c233
BP
148 set interface p0 type=patch options:peer=p2 ofport_request=1 \
149 other-config:lacp-aggregation-key=2 -- \
150 set interface p1 type=patch options:peer=p3 ofport_request=2 \
151 other-config:lacp-aggregation-key=2 -- \
f72f0c47
BP
152 add-br br1 -- \
153 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
154 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
155 fail-mode=secure -- \
156 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
157 other-config:lacp-time=fast \
158 other-config:bond-rebalance-interval=0 -- \
b369c233
BP
159 set interface p2 type=patch options:peer=p0 ofport_request=3 \
160 other-config:lacp-aggregation-key=4 -- \
161 set interface p3 type=patch options:peer=p1 ofport_request=4 \
162 other-config:lacp-aggregation-key=4 --])
f72f0c47
BP
163
164AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
165])
166
8e63fd14
BP
167ovs-appctl time/stop
168
f72f0c47
BP
169# Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
170i=0
171while :; do
172 ovs-appctl lacp/show bond0 > bond0
173 AT_CAPTURE_FILE([bond0])
174 ovs-appctl lacp/show bond1 > bond1
175 AT_CAPTURE_FILE([bond1])
176 if grep negotiated bond0 && grep negotiated bond1; then
177 if grep expired bond0 || grep expired bond1; then
178 :
179 else
180 break
181 fi
182 fi
183 i=`expr $i + 1`
184 if test $i = 50; then
185 AT_FAIL_IF([:])
186 fi
187 ovs-appctl time/warp 100
188done
189
190# Now check the correctly negotiated configuration.
191AT_CHECK(
192 [ovs-appctl lacp/show bond0
193ovs-appctl lacp/show bond1
3e5aeeb5
AZ
194ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
195ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [stdout])
f72f0c47
BP
196AT_CHECK([sed '/active slave/d' stdout], [0], [dnl
197---- bond0 ----
6d7d467e
BP
198 status: active negotiated
199 sys_id: aa:55:aa:55:00:00
200 sys_priority: 65534
201 aggregation key: 2
202 lacp_time: fast
f72f0c47
BP
203
204slave: p0: current attached
6d7d467e
BP
205 port_id: 1
206 port_priority: 65535
207 may_enable: true
208
209 actor sys_id: aa:55:aa:55:00:00
210 actor sys_priority: 65534
211 actor port_id: 1
212 actor port_priority: 65535
213 actor key: 2
214 actor state: activity timeout aggregation synchronized collecting distributing
215
216 partner sys_id: aa:66:aa:66:00:00
217 partner sys_priority: 65534
218 partner port_id: 3
219 partner port_priority: 65535
220 partner key: 4
221 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47
BP
222
223slave: p1: current attached
6d7d467e
BP
224 port_id: 2
225 port_priority: 65535
226 may_enable: true
227
228 actor sys_id: aa:55:aa:55:00:00
229 actor sys_priority: 65534
230 actor port_id: 2
231 actor port_priority: 65535
232 actor key: 2
233 actor state: activity timeout aggregation synchronized collecting distributing
234
235 partner sys_id: aa:66:aa:66:00:00
236 partner sys_priority: 65534
237 partner port_id: 4
238 partner port_priority: 65535
239 partner key: 4
240 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47 241---- bond1 ----
6d7d467e
BP
242 status: active negotiated
243 sys_id: aa:66:aa:66:00:00
244 sys_priority: 65534
245 aggregation key: 4
246 lacp_time: fast
f72f0c47
BP
247
248slave: p2: current attached
6d7d467e
BP
249 port_id: 3
250 port_priority: 65535
251 may_enable: true
252
253 actor sys_id: aa:66:aa:66:00:00
254 actor sys_priority: 65534
255 actor port_id: 3
256 actor port_priority: 65535
257 actor key: 4
258 actor state: activity timeout aggregation synchronized collecting distributing
259
260 partner sys_id: aa:55:aa:55:00:00
261 partner sys_priority: 65534
262 partner port_id: 1
263 partner port_priority: 65535
264 partner key: 2
265 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47
BP
266
267slave: p3: current attached
6d7d467e
BP
268 port_id: 4
269 port_priority: 65535
270 may_enable: true
271
272 actor sys_id: aa:66:aa:66:00:00
273 actor sys_priority: 65534
274 actor port_id: 4
275 actor port_priority: 65535
276 actor key: 4
277 actor state: activity timeout aggregation synchronized collecting distributing
278
279 partner sys_id: aa:55:aa:55:00:00
280 partner sys_priority: 65534
281 partner port_id: 2
282 partner port_priority: 65535
283 partner key: 2
284 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47
BP
285---- bond0 ----
286bond_mode: balance-tcp
adcf00ba 287bond may use recirculation: yes, <del>
f72f0c47
BP
288bond-hash-basis: 0
289updelay: 0 ms
290downdelay: 0 ms
291lacp_status: negotiated
57fc4fd0 292lacp_fallback_ab: false
f72f0c47
BP
293
294slave p0: enabled
828519ca 295 may_enable: true
f72f0c47
BP
296
297slave p1: enabled
828519ca 298 may_enable: true
f72f0c47
BP
299
300---- bond1 ----
301bond_mode: balance-tcp
adcf00ba 302bond may use recirculation: yes, <del>
f72f0c47
BP
303bond-hash-basis: 0
304updelay: 0 ms
305downdelay: 0 ms
306lacp_status: negotiated
57fc4fd0 307lacp_fallback_ab: false
f72f0c47
BP
308
309slave p2: enabled
828519ca 310 may_enable: true
f72f0c47
BP
311
312slave p3: enabled
828519ca 313 may_enable: true
f72f0c47
BP
314
315])
3e5aeeb5 316AT_CHECK([grep 'active slave$' stdout], [0], [dnl
828519ca
BP
317 active slave
318 active slave
f72f0c47
BP
319])
320
321# Redirect the patch link between p0 and p2 so that no packets get
0239c860 322# back and forth across them anymore. Then wait 4 simulated
f72f0c47
BP
323# seconds. The LACP state should become "expired" for p0 and p2.
324AT_CHECK([ovs-vsctl \
325-- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
326-- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
327
bdba1947 328ovs-appctl time/warp 4100 100
f72f0c47
BP
329AT_CHECK(
330 [ovs-appctl lacp/show bond0
331ovs-appctl lacp/show bond1
3e5aeeb5
AZ
332ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
333ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
f72f0c47 334---- bond0 ----
6d7d467e
BP
335 status: active negotiated
336 sys_id: aa:55:aa:55:00:00
337 sys_priority: 65534
338 aggregation key: 2
339 lacp_time: fast
f72f0c47
BP
340
341slave: p0: expired attached
6d7d467e
BP
342 port_id: 1
343 port_priority: 65535
344 may_enable: false
345
346 actor sys_id: aa:55:aa:55:00:00
347 actor sys_priority: 65534
348 actor port_id: 1
349 actor port_priority: 65535
350 actor key: 2
351 actor state: activity timeout aggregation synchronized collecting distributing expired
352
353 partner sys_id: aa:66:aa:66:00:00
354 partner sys_priority: 65534
355 partner port_id: 3
356 partner port_priority: 65535
357 partner key: 4
358 partner state: activity timeout aggregation collecting distributing
f72f0c47
BP
359
360slave: p1: current attached
6d7d467e
BP
361 port_id: 2
362 port_priority: 65535
363 may_enable: true
364
365 actor sys_id: aa:55:aa:55:00:00
366 actor sys_priority: 65534
367 actor port_id: 2
368 actor port_priority: 65535
369 actor key: 2
370 actor state: activity timeout aggregation synchronized collecting distributing
371
372 partner sys_id: aa:66:aa:66:00:00
373 partner sys_priority: 65534
374 partner port_id: 4
375 partner port_priority: 65535
376 partner key: 4
377 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47 378---- bond1 ----
6d7d467e
BP
379 status: active negotiated
380 sys_id: aa:66:aa:66:00:00
381 sys_priority: 65534
382 aggregation key: 4
383 lacp_time: fast
f72f0c47
BP
384
385slave: p2: expired attached
6d7d467e
BP
386 port_id: 3
387 port_priority: 65535
388 may_enable: false
389
390 actor sys_id: aa:66:aa:66:00:00
391 actor sys_priority: 65534
392 actor port_id: 3
393 actor port_priority: 65535
394 actor key: 4
395 actor state: activity timeout aggregation synchronized collecting distributing expired
396
397 partner sys_id: aa:55:aa:55:00:00
398 partner sys_priority: 65534
399 partner port_id: 1
400 partner port_priority: 65535
401 partner key: 2
402 partner state: activity timeout aggregation collecting distributing
f72f0c47
BP
403
404slave: p3: current attached
6d7d467e
BP
405 port_id: 4
406 port_priority: 65535
407 may_enable: true
408
409 actor sys_id: aa:66:aa:66:00:00
410 actor sys_priority: 65534
411 actor port_id: 4
412 actor port_priority: 65535
413 actor key: 4
414 actor state: activity timeout aggregation synchronized collecting distributing
415
416 partner sys_id: aa:55:aa:55:00:00
417 partner sys_priority: 65534
418 partner port_id: 2
419 partner port_priority: 65535
420 partner key: 2
421 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47
BP
422---- bond0 ----
423bond_mode: balance-tcp
adcf00ba 424bond may use recirculation: yes, <del>
f72f0c47
BP
425bond-hash-basis: 0
426updelay: 0 ms
427downdelay: 0 ms
428lacp_status: negotiated
57fc4fd0 429lacp_fallback_ab: false
3e5aeeb5 430<active slave mac del>
f72f0c47
BP
431
432slave p0: disabled
828519ca 433 may_enable: false
f72f0c47
BP
434
435slave p1: enabled
828519ca
BP
436 active slave
437 may_enable: true
f72f0c47
BP
438
439---- bond1 ----
440bond_mode: balance-tcp
adcf00ba 441bond may use recirculation: yes, <del>
f72f0c47
BP
442bond-hash-basis: 0
443updelay: 0 ms
444downdelay: 0 ms
445lacp_status: negotiated
57fc4fd0 446lacp_fallback_ab: false
3e5aeeb5 447<active slave mac del>
f72f0c47
BP
448
449slave p2: disabled
828519ca 450 may_enable: false
f72f0c47
BP
451
452slave p3: enabled
828519ca
BP
453 active slave
454 may_enable: true
f72f0c47
BP
455
456])
457
458# Wait 4 more simulated seconds. The LACP state should become
459# "defaulted" for p0 and p2.
bdba1947 460ovs-appctl time/warp 4100 100
f72f0c47
BP
461AT_CHECK(
462 [ovs-appctl lacp/show bond0
463ovs-appctl lacp/show bond1
3e5aeeb5
AZ
464ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
465ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
f72f0c47 466---- bond0 ----
6d7d467e
BP
467 status: active negotiated
468 sys_id: aa:55:aa:55:00:00
469 sys_priority: 65534
470 aggregation key: 2
471 lacp_time: fast
f72f0c47
BP
472
473slave: p0: defaulted detached
6d7d467e
BP
474 port_id: 1
475 port_priority: 65535
476 may_enable: false
477
478 actor sys_id: aa:55:aa:55:00:00
479 actor sys_priority: 65534
480 actor port_id: 1
481 actor port_priority: 65535
482 actor key: 2
483 actor state: activity timeout aggregation defaulted
484
485 partner sys_id: 00:00:00:00:00:00
486 partner sys_priority: 0
487 partner port_id: 0
488 partner port_priority: 0
489 partner key: 0
490 partner state:
f72f0c47
BP
491
492slave: p1: current attached
6d7d467e
BP
493 port_id: 2
494 port_priority: 65535
495 may_enable: true
496
497 actor sys_id: aa:55:aa:55:00:00
498 actor sys_priority: 65534
499 actor port_id: 2
500 actor port_priority: 65535
501 actor key: 2
502 actor state: activity timeout aggregation synchronized collecting distributing
503
504 partner sys_id: aa:66:aa:66:00:00
505 partner sys_priority: 65534
506 partner port_id: 4
507 partner port_priority: 65535
508 partner key: 4
509 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47 510---- bond1 ----
6d7d467e
BP
511 status: active negotiated
512 sys_id: aa:66:aa:66:00:00
513 sys_priority: 65534
514 aggregation key: 4
515 lacp_time: fast
f72f0c47
BP
516
517slave: p2: defaulted detached
6d7d467e
BP
518 port_id: 3
519 port_priority: 65535
520 may_enable: false
521
522 actor sys_id: aa:66:aa:66:00:00
523 actor sys_priority: 65534
524 actor port_id: 3
525 actor port_priority: 65535
526 actor key: 4
527 actor state: activity timeout aggregation defaulted
528
529 partner sys_id: 00:00:00:00:00:00
530 partner sys_priority: 0
531 partner port_id: 0
532 partner port_priority: 0
533 partner key: 0
534 partner state:
f72f0c47
BP
535
536slave: p3: current attached
6d7d467e
BP
537 port_id: 4
538 port_priority: 65535
539 may_enable: true
540
541 actor sys_id: aa:66:aa:66:00:00
542 actor sys_priority: 65534
543 actor port_id: 4
544 actor port_priority: 65535
545 actor key: 4
546 actor state: activity timeout aggregation synchronized collecting distributing
547
548 partner sys_id: aa:55:aa:55:00:00
549 partner sys_priority: 65534
550 partner port_id: 2
551 partner port_priority: 65535
552 partner key: 2
553 partner state: activity timeout aggregation synchronized collecting distributing
f72f0c47
BP
554---- bond0 ----
555bond_mode: balance-tcp
adcf00ba 556bond may use recirculation: yes, <del>
f72f0c47
BP
557bond-hash-basis: 0
558updelay: 0 ms
559downdelay: 0 ms
560lacp_status: negotiated
57fc4fd0 561lacp_fallback_ab: false
3e5aeeb5 562<active slave mac del>
f72f0c47
BP
563
564slave p0: disabled
828519ca 565 may_enable: false
f72f0c47
BP
566
567slave p1: enabled
828519ca
BP
568 active slave
569 may_enable: true
f72f0c47
BP
570
571---- bond1 ----
572bond_mode: balance-tcp
adcf00ba 573bond may use recirculation: yes, <del>
f72f0c47
BP
574bond-hash-basis: 0
575updelay: 0 ms
576downdelay: 0 ms
577lacp_status: negotiated
57fc4fd0 578lacp_fallback_ab: false
3e5aeeb5 579<active slave mac del>
f72f0c47
BP
580
581slave p2: disabled
828519ca 582 may_enable: false
f72f0c47
BP
583
584slave p3: enabled
828519ca
BP
585 active slave
586 may_enable: true
f72f0c47
BP
587
588])
3afefab9
SS
589
590# Reconnect the patch link between p0 and p2 to allow traffic between the ports.
591AT_CHECK([ovs-vsctl \
592-- del-port null0 -- set int p2 options:peer=p0 \
593-- del-port null1 -- set int p0 options:peer=p2])
594
595# Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
596ovs-appctl time/warp 30100 100
597
598AT_CHECK(
599 [ovs-appctl lacp/show bond0
600ovs-appctl lacp/show bond1
601ovs-appctl bond/show bond0 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC
602ovs-appctl bond/show bond1 | STRIP_RECIRC_ID | STRIP_ACTIVE_SLAVE_MAC ], [0], [dnl
603---- bond0 ----
6d7d467e
BP
604 status: active negotiated
605 sys_id: aa:55:aa:55:00:00
606 sys_priority: 65534
607 aggregation key: 2
608 lacp_time: fast
3afefab9
SS
609
610slave: p0: current attached
6d7d467e
BP
611 port_id: 1
612 port_priority: 65535
613 may_enable: true
614
615 actor sys_id: aa:55:aa:55:00:00
616 actor sys_priority: 65534
617 actor port_id: 1
618 actor port_priority: 65535
619 actor key: 2
620 actor state: activity timeout aggregation synchronized collecting distributing
621
622 partner sys_id: aa:66:aa:66:00:00
623 partner sys_priority: 65534
624 partner port_id: 3
625 partner port_priority: 65535
626 partner key: 4
627 partner state: activity timeout aggregation synchronized collecting distributing
3afefab9
SS
628
629slave: p1: current attached
6d7d467e
BP
630 port_id: 2
631 port_priority: 65535
632 may_enable: true
633
634 actor sys_id: aa:55:aa:55:00:00
635 actor sys_priority: 65534
636 actor port_id: 2
637 actor port_priority: 65535
638 actor key: 2
639 actor state: activity timeout aggregation synchronized collecting distributing
640
641 partner sys_id: aa:66:aa:66:00:00
642 partner sys_priority: 65534
643 partner port_id: 4
644 partner port_priority: 65535
645 partner key: 4
646 partner state: activity timeout aggregation synchronized collecting distributing
3afefab9 647---- bond1 ----
6d7d467e
BP
648 status: active negotiated
649 sys_id: aa:66:aa:66:00:00
650 sys_priority: 65534
651 aggregation key: 4
652 lacp_time: fast
3afefab9
SS
653
654slave: p2: current attached
6d7d467e
BP
655 port_id: 3
656 port_priority: 65535
657 may_enable: true
658
659 actor sys_id: aa:66:aa:66:00:00
660 actor sys_priority: 65534
661 actor port_id: 3
662 actor port_priority: 65535
663 actor key: 4
664 actor state: activity timeout aggregation synchronized collecting distributing
665
666 partner sys_id: aa:55:aa:55:00:00
667 partner sys_priority: 65534
668 partner port_id: 1
669 partner port_priority: 65535
670 partner key: 2
671 partner state: activity timeout aggregation synchronized collecting distributing
3afefab9
SS
672
673slave: p3: current attached
6d7d467e
BP
674 port_id: 4
675 port_priority: 65535
676 may_enable: true
677
678 actor sys_id: aa:66:aa:66:00:00
679 actor sys_priority: 65534
680 actor port_id: 4
681 actor port_priority: 65535
682 actor key: 4
683 actor state: activity timeout aggregation synchronized collecting distributing
684
685 partner sys_id: aa:55:aa:55:00:00
686 partner sys_priority: 65534
687 partner port_id: 2
688 partner port_priority: 65535
689 partner key: 2
690 partner state: activity timeout aggregation synchronized collecting distributing
3afefab9
SS
691---- bond0 ----
692bond_mode: balance-tcp
693bond may use recirculation: yes, <del>
694bond-hash-basis: 0
695updelay: 0 ms
696downdelay: 0 ms
697lacp_status: negotiated
57fc4fd0 698lacp_fallback_ab: false
3afefab9
SS
699<active slave mac del>
700
701slave p0: enabled
828519ca 702 may_enable: true
3afefab9
SS
703
704slave p1: enabled
828519ca
BP
705 active slave
706 may_enable: true
3afefab9
SS
707
708---- bond1 ----
709bond_mode: balance-tcp
710bond may use recirculation: yes, <del>
711bond-hash-basis: 0
712updelay: 0 ms
713downdelay: 0 ms
714lacp_status: negotiated
57fc4fd0 715lacp_fallback_ab: false
3afefab9
SS
716<active slave mac del>
717
718slave p2: enabled
828519ca 719 may_enable: true
3afefab9
SS
720
721slave p3: enabled
828519ca
BP
722 active slave
723 may_enable: true
3afefab9
SS
724
725])
726
f72f0c47
BP
727OVS_VSWITCHD_STOP
728AT_CLEANUP
f73b83fd
LS
729
730# test lacp liveness propagation - OF1.3.
731AT_SETUP([lacp - liveness propagation - OF1.3])
732OVS_VSWITCHD_START
733AT_CHECK([ovs-ofctl -O OpenFlow13 -P standard monitor br0 --detach --no-chdir --pidfile])
734check_liveness () {
735 printf '\n\n--- check_liveness %d ---\n\n\n' $1
736 shift
737
5a0e4aec 738 echo >>expout "OFPT_PORT_STATUS (OF1.3): MOD: 1(p0): addr:
f73b83fd
LS
739 config: 0
740 state: $1
741 speed: 0 Mbps now, 0 Mbps max"
742
5a0e4aec 743 AT_CHECK(
f73b83fd
LS
744 [[sed '
745s/ (xid=0x[0-9a-fA-F]*)//
746s/ *duration.*//
747s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
748 [0], [expout])
749}
750: > expout
751ovs-appctl -t ovs-ofctl ofctl/barrier
752ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
753# Set miss_send_len to 128, enabling port_status messages to our service connection.
754ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
755
756# Create bond0 on br0 with interfaces p0 and p1
757# and bond1 on br1 with interfaces p2 and p3
758# with p0 patched to p2 and p1 patched to p3.
759AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
760 other-config:lacp-time=fast \
761 other-config:bond-rebalance-interval=0 -- \
762 set interface p0 type=patch options:peer=p2 ofport_request=1 \
763 other-config:lacp-aggregation-key=2 -- \
764 set interface p1 type=patch options:peer=p3 ofport_request=2 \
765 other-config:lacp-aggregation-key=2 -- \
766 add-br br1 -- \
767 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
768 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
769 fail-mode=secure -- \
770 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
771 other-config:lacp-time=fast \
772 other-config:bond-rebalance-interval=0 -- \
773 set interface p2 type=patch options:peer=p0 ofport_request=3 \
774 other-config:lacp-aggregation-key=4 -- \
775 set interface p3 type=patch options:peer=p1 ofport_request=4 \
776 other-config:lacp-aggregation-key=4 --])
777
778AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
779])
780ovs-appctl time/stop
781
782# Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
783i=0
784while :; do
785 ovs-appctl lacp/show bond0 > bond0
786 AT_CAPTURE_FILE([bond0])
787 ovs-appctl lacp/show bond1 > bond1
788 AT_CAPTURE_FILE([bond1])
789 if grep negotiated bond0 && grep negotiated bond1; then
790 if grep expired bond0 || grep expired bond1; then
791 :
792 else
793 break
794 fi
795 fi
796 i=`expr $i + 1`
797 if test $i = 50; then
798 AT_FAIL_IF([:])
799 fi
800 ovs-appctl time/warp 100
801done
802check_liveness 1 LIVE
803
804# Makes LACP state "expired" for p0 and p2.
805AT_CHECK([ovs-vsctl \
806-- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
807-- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
f73b83fd
LS
808
809# Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
810ovs-appctl time/warp 4100 100
811check_liveness 3 0
812
813# Reconnect the patch link between p0 and p2 to allow traffic between the ports.
814AT_CHECK([ovs-vsctl \
815-- del-port null0 -- set int p2 options:peer=p0 \
816-- del-port null1 -- set int p0 options:peer=p2])
817
818# Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
819ovs-appctl time/warp 30100 100
820check_liveness 3 LIVE
821
822OVS_VSWITCHD_STOP
823AT_CLEANUP
824
825# test lacp liveness propagation - OF1.4.
826AT_SETUP([lacp - liveness propagation - OF1.4])
827OVS_VSWITCHD_START
828AT_CHECK([ovs-ofctl -O OpenFlow14 -P standard monitor br0 --detach --no-chdir --pidfile])
829check_liveness () {
830 printf '\n\n--- check_liveness %d ---\n\n\n' $1
831 shift
832
5a0e4aec 833 echo >>expout "OFPT_PORT_STATUS (OF1.4): MOD: 1(p0): addr:
f73b83fd
LS
834 config: 0
835 state: $1
836 speed: 0 Mbps now, 0 Mbps max"
837
5a0e4aec 838 AT_CHECK(
f73b83fd
LS
839 [[sed '
840s/ (xid=0x[0-9a-fA-F]*)//
841s/ *duration.*//
842s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
843 [0], [expout])
844}
845: > expout
846ovs-appctl -t ovs-ofctl ofctl/barrier
847ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
848# Set miss_send_len to 128, enabling port_status messages to our service connection.
849ovs-appctl -t ovs-ofctl ofctl/send 0509000c0123456700000080
850
851# Create bond0 on br0 with interfaces p0 and p1
852# and bond1 on br1 with interfaces p2 and p3
853# with p0 patched to p2 and p1 patched to p3.
854AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
855 other-config:lacp-time=fast \
856 other-config:bond-rebalance-interval=0 -- \
857 set interface p0 type=patch options:peer=p2 ofport_request=1 \
858 other-config:lacp-aggregation-key=2 -- \
859 set interface p1 type=patch options:peer=p3 ofport_request=2 \
860 other-config:lacp-aggregation-key=2 -- \
861 add-br br1 -- \
862 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
863 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
864 fail-mode=secure -- \
865 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
866 other-config:lacp-time=fast \
867 other-config:bond-rebalance-interval=0 -- \
868 set interface p2 type=patch options:peer=p0 ofport_request=3 \
869 other-config:lacp-aggregation-key=4 -- \
870 set interface p3 type=patch options:peer=p1 ofport_request=4 \
871 other-config:lacp-aggregation-key=4 --])
872
873AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
874])
875ovs-appctl time/stop
876
877# Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
878i=0
879while :; do
880 ovs-appctl lacp/show bond0 > bond0
881 AT_CAPTURE_FILE([bond0])
882 ovs-appctl lacp/show bond1 > bond1
883 AT_CAPTURE_FILE([bond1])
884 if grep negotiated bond0 && grep negotiated bond1; then
885 if grep expired bond0 || grep expired bond1; then
886 :
887 else
888 break
889 fi
890 fi
891 i=`expr $i + 1`
892 if test $i = 50; then
893 AT_FAIL_IF([:])
894 fi
895 ovs-appctl time/warp 100
896done
897check_liveness 1 LIVE
898
899# Makes LACP state "expired" for p0 and p2.
900AT_CHECK([ovs-vsctl \
901-- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
902-- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
f73b83fd
LS
903
904# Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
905ovs-appctl time/warp 4100 100
906check_liveness 3 0
907
908# Reconnect the patch link between p0 and p2 to allow traffic between the ports.
909AT_CHECK([ovs-vsctl \
910-- del-port null0 -- set int p2 options:peer=p0 \
911-- del-port null1 -- set int p0 options:peer=p2])
912
913# Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
914ovs-appctl time/warp 30100 100
915check_liveness 3 LIVE
916
917OVS_VSWITCHD_STOP
918AT_CLEANUP
919
920# test lacp liveness propagation - OF1.5.
921AT_SETUP([lacp - liveness propagation - OF1.5])
922OVS_VSWITCHD_START
923AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
924check_liveness () {
925 printf '\n\n--- check_liveness %d ---\n\n\n' $1
926 shift
927
5a0e4aec 928 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: 1(p0): addr:
f73b83fd
LS
929 config: 0
930 state: $1
931 speed: 0 Mbps now, 0 Mbps max"
932
5a0e4aec 933 AT_CHECK(
f73b83fd
LS
934 [[sed '
935s/ (xid=0x[0-9a-fA-F]*)//
936s/ *duration.*//
937s/addr:[0-9a-fA-F:]*/addr:/' < monitor.log|grep -A3 "MOD: 1(p0)"|grep -ve --]],
938 [0], [expout])
939}
940: > expout
941ovs-appctl -t ovs-ofctl ofctl/barrier
942ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
943# Set miss_send_len to 128, enabling port_status messages to our service connection.
944ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
945
946# Create bond0 on br0 with interfaces p0 and p1
947# and bond1 on br1 with interfaces p2 and p3
948# with p0 patched to p2 and p1 patched to p3.
949AT_CHECK([ovs-vsctl add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
950 other-config:lacp-time=fast \
951 other-config:bond-rebalance-interval=0 -- \
952 set interface p0 type=patch options:peer=p2 ofport_request=1 \
953 other-config:lacp-aggregation-key=2 -- \
954 set interface p1 type=patch options:peer=p3 ofport_request=2 \
955 other-config:lacp-aggregation-key=2 -- \
956 add-br br1 -- \
957 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
958 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
959 fail-mode=secure -- \
960 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
961 other-config:lacp-time=fast \
962 other-config:bond-rebalance-interval=0 -- \
963 set interface p2 type=patch options:peer=p0 ofport_request=3 \
964 other-config:lacp-aggregation-key=4 -- \
965 set interface p3 type=patch options:peer=p1 ofport_request=4 \
966 other-config:lacp-aggregation-key=4 --])
967
968AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
969])
970ovs-appctl time/stop
971
972# Wait for up to 5 (simulated) seconds, until LACP negotiation finishes.
973i=0
974while :; do
975 ovs-appctl lacp/show bond0 > bond0
976 AT_CAPTURE_FILE([bond0])
977 ovs-appctl lacp/show bond1 > bond1
978 AT_CAPTURE_FILE([bond1])
979 if grep negotiated bond0 && grep negotiated bond1; then
980 if grep expired bond0 || grep expired bond1; then
981 :
982 else
983 break
984 fi
985 fi
986 i=`expr $i + 1`
987 if test $i = 50; then
988 AT_FAIL_IF([:])
989 fi
990 ovs-appctl time/warp 100
991done
992check_liveness 1 LIVE
993
994# Makes LACP state "expired" for p0 and p2.
995AT_CHECK([ovs-vsctl \
996-- add-port br0 null0 -- set int null0 type=patch options:peer=p2 -- set int p2 options:peer=null0 \
997-- add-port br1 null1 -- set int null1 type=patch options:peer=p0 -- set int p0 options:peer=null1])
f73b83fd
LS
998
999# Wait 4 more simulated seconds. The LACP state should become "defaulted" for p0 and p2.
1000ovs-appctl time/warp 4100 100
1001check_liveness 3 0
1002
1003# Reconnect the patch link between p0 and p2 to allow traffic between the ports.
1004AT_CHECK([ovs-vsctl \
1005-- del-port null0 -- set int p2 options:peer=p0 \
1006-- del-port null1 -- set int p0 options:peer=p2])
1007
1008# Wait for 30 more seconds (LACP_SLOW_TIME_TX) for the lacp to renegotiate
1009ovs-appctl time/warp 30100 100
1010check_liveness 3 LIVE
1011
1012OVS_VSWITCHD_STOP
1013AT_CLEANUP