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