1 dnl VTEP_OVSDB_INIT([$1])
3 dnl Creates an empty database named $1.
4 m4_define([VTEP_OVSDB_INIT],
5 [OVS_RUNDIR=`pwd`; export OVS_RUNDIR
7 [ovsdb-tool create $1 $abs_top_srcdir/vtep/vtep.ovsschema],
8 [0], [stdout], [ignore])
10 [[ovsdb-tool transact $1 \
15 [0], [ignore], [ignore])])
19 dnl Creates an empty database in the current directory and then starts
20 dnl an ovsdb-server on it for vtep-ctl to connect to.
21 m4_define([VTEP_CTL_SETUP],
22 [VTEP_OVSDB_INIT([db])
23 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1], [0], [ignore], [ignore])])
27 dnl Kills off the database server.
28 m4_define([VTEP_CTL_CLEANUP], [OVSDB_SERVER_SHUTDOWN])
30 dnl RUN_VTEP_CTL(COMMAND, ...)
32 dnl Executes each vtep-ctl COMMAND.
33 m4_define([RUN_VTEP_CTL],
34 [m4_foreach([command], [$@], [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket command
36 m4_define([RUN_VTEP_CTL_ONELINE],
37 [m4_foreach([command], [$@], [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- command
40 dnl RUN_VTEP_CTL_TOGETHER(COMMAND, ...)
42 dnl Executes each vtep-ctl COMMAND in a single run of vtep-ctl.
43 m4_define([RUN_VTEP_CTL_TOGETHER],
44 [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline dnl
45 m4_foreach([command], [$@], [ -- command])])
47 dnl CHECK_PSWITCHES([PSWITCH], ...)
49 dnl Verifies that "vtep-ctl list-ps" prints the specified list of
50 dnl physical switches, which must be in alphabetical order.
51 m4_define([CHECK_PSWITCHES],
52 [dnl Check that the pswitches appear on list-ps, without --oneline.
54 [RUN_VTEP_CTL([list-ps])],
56 [m4_foreach([psinfo], [$@], [m4_car(psinfo)
61 dnl Check that the pswitches appear on list-ps, with --oneline.
63 [RUN_VTEP_CTL_ONELINE([list-ps])],
65 [m4_join([\n], m4_foreach([psinfo], [$@], [m4_car(psinfo),]))
70 dnl Check that each pswitch exists according to ps-exists and that
71 dnl a pswitch that should not exist does not.
72 m4_foreach([psinfo], [$@],
73 [AT_CHECK([RUN_VTEP_CTL([ps-exists m4_car(psinfo)])], [0], [],
74 [], [VTEP_CTL_CLEANUP])])
75 AT_CHECK([RUN_VTEP_CTL([ps-exists nonexistent])], [2], [], [],
78 dnl CHECK_PORTS(PSWITCH, PORT[, PORT...])
80 dnl Verifies that "vtep-ctl list-ports PSWITCH" prints the specified
81 dnl list of ports, which must be in alphabetical order.
82 m4_define([CHECK_PORTS],
83 [dnl Check ports without --oneline.
85 [RUN_VTEP_CTL([list-ports $1])],
87 [m4_foreach([port], m4_cdr($@), [port
92 dnl Check ports with --oneline.
94 [RUN_VTEP_CTL_ONELINE([list-ports $1])],
96 [m4_join([\n], m4_shift($@))
102 dnl CHECK_LSWITCHES([LSWITCH], ...)
104 dnl Verifies that "vtep-ctl list-ls" prints the specified list of
105 dnl logical switches, which must be in alphabetical order.
106 m4_define([CHECK_LSWITCHES],
107 [dnl Check that the lswitches appear on list-ls, without --oneline.
109 [RUN_VTEP_CTL([list-ls])],
111 [m4_foreach([lsinfo], [$@], [m4_car(lsinfo)
116 dnl Check that the lswitches appear on list-ls, with --oneline.
118 [RUN_VTEP_CTL_ONELINE([list-ls])],
120 [m4_join([\n], m4_foreach([lsinfo], [$@], [m4_car(lsinfo),]))
125 dnl Check that each lswitch exists according to ls-exists and that
126 dnl a pswitch that should not exist does not.
127 m4_foreach([lsinfo], [$@],
128 [AT_CHECK([RUN_VTEP_CTL([ls-exists m4_car(lsinfo)])], [0], [],
129 [], [VTEP_CTL_CLEANUP])])
130 AT_CHECK([RUN_VTEP_CTL([ls-exists nonexistent])], [2], [], [],
131 [VTEP_CTL_CLEANUP])])
133 dnl ----------------------------------------------------------------------
134 AT_BANNER([vtep-ctl unit tests -- physical switch tests])
137 AT_KEYWORDS([vtep-ctl])
139 AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP])
144 AT_SETUP([add-ps a, add-ps a])
145 AT_KEYWORDS([vtep-ctl])
147 AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP])
148 AT_CHECK([RUN_VTEP_CTL([add-ps a])], [1], [],
149 [vtep-ctl: cannot create physical switch a because it already exists
150 ], [VTEP_CTL_CLEANUP])
154 AT_SETUP([add-ps a, add-ps b])
155 AT_KEYWORDS([vtep-ctl])
157 AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b])], [0], [], [],
159 CHECK_PSWITCHES([a], [b])
163 AT_SETUP([add-ps a, add-ps b, del-ps a])
164 AT_KEYWORDS([vtep-ctl])
166 AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b], [del-ps a])], [0], [], [],
172 AT_SETUP([add-ps a, del-ps a, add-ps a])
173 AT_KEYWORDS([vtep-ctl])
175 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
181 ], [], [VTEP_CTL_CLEANUP])
186 AT_SETUP([add-ps a, add-port a a1, add-port a a2])
187 AT_KEYWORDS([vtep-ctl])
189 AT_CHECK([RUN_VTEP_CTL(
191 [--if-exists del-ps b],
193 [add-port a a2])], [0], [], [], [VTEP_CTL_CLEANUP])
195 CHECK_PORTS([a], [a1], [a2])
199 AT_SETUP([add-ps a, add-port a a1, add-port a a1])
200 AT_KEYWORDS([vtep-ctl])
202 AT_CHECK([RUN_VTEP_CTL(
204 [add-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP])
205 AT_CHECK([RUN_VTEP_CTL([add-port a a1])], [1], [],
206 [vtep-ctl: cannot create a port named a1 on a because a port with that name already exists
207 ], [VTEP_CTL_CLEANUP])
211 AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-ps a])
212 AT_KEYWORDS([vtep-ctl])
214 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
219 [--if-exists del-port b b2],
226 ], [], [VTEP_CTL_CLEANUP])
228 CHECK_PORTS([b], [b1])
232 AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-port a a1])
233 AT_KEYWORDS([vtep-ctl])
235 AT_CHECK([RUN_VTEP_CTL(
239 [--may-exist add-port b b1],
240 [del-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP])
241 AT_CHECK([RUN_VTEP_CTL([--may-exist add-port b b1])], [0], [], [],
243 CHECK_PSWITCHES([a], [b])
245 CHECK_PORTS([b], [b1])
249 AT_SETUP([add-ps a b, add-port a p1, add-port b p1, del-port a p1])
250 AT_KEYWORDS([vtep-ctl])
252 AT_CHECK([RUN_VTEP_CTL(
256 [add-port b p1])], [0], [], [], [VTEP_CTL_CLEANUP])
257 CHECK_PSWITCHES([a], [b])
258 CHECK_PORTS([a], [p1])
259 CHECK_PORTS([b], [p1])
260 AT_CHECK([RUN_VTEP_CTL([del-port a p1])], [0], [], [],
262 CHECK_PSWITCHES([a], [b])
264 CHECK_PORTS([b], [p1])
269 dnl ----------------------------------------------------------------------
270 AT_BANNER([vtep-ctl unit tests -- logical switch tests])
273 AT_KEYWORDS([vtep-ctl])
275 AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP])
280 AT_SETUP([add-ls a, add-ls a])
281 AT_KEYWORDS([vtep-ctl])
283 AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP])
284 AT_CHECK([RUN_VTEP_CTL([add-ls a])], [1], [],
285 [vtep-ctl: cannot create logical switch a because it already exists
286 ], [VTEP_CTL_CLEANUP])
290 AT_SETUP([add-ls a, add-ls b])
291 AT_KEYWORDS([vtep-ctl])
293 AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b])], [0], [], [],
295 CHECK_LSWITCHES([a], [b])
299 AT_SETUP([add-ls a, add-ls b, del-ls a])
300 AT_KEYWORDS([vtep-ctl])
302 AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b], [del-ls a])], [0], [], [],
308 AT_SETUP([add-ls a, del-ls a, add-ls a])
309 AT_KEYWORDS([vtep-ctl])
311 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
317 ], [], [VTEP_CTL_CLEANUP])
323 dnl ----------------------------------------------------------------------
324 AT_BANNER([vtep-ctl unit tests -- logical binding tests])
326 AT_SETUP([bind-ls ps1 pp1 300 ls1])
327 AT_KEYWORDS([vtep-ctl])
329 AT_CHECK([RUN_VTEP_CTL(
332 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
333 CHECK_PSWITCHES([ps1])
334 CHECK_PORTS([ps1], [pp1])
335 CHECK_LSWITCHES([ls1])
336 AT_CHECK([RUN_VTEP_CTL(
337 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
338 AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
340 ], [], [VTEP_CTL_CLEANUP])
344 AT_SETUP([bind-ls ps1 pp1 300 ls1, bind-ls ps1 pp1 400 ls2])
345 AT_KEYWORDS([vtep-ctl])
347 AT_CHECK([RUN_VTEP_CTL(
351 [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
352 CHECK_PSWITCHES([ps1])
353 CHECK_PORTS([ps1], [pp1])
354 CHECK_LSWITCHES([ls1], [ls2])
355 AT_CHECK([RUN_VTEP_CTL(
356 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
357 AT_CHECK([RUN_VTEP_CTL(
358 [bind-ls ps1 pp1 400 ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
359 AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
362 ], [], [VTEP_CTL_CLEANUP])
366 AT_SETUP([bind-ls ps1 pp1 300, bind-ls ps2 pp2 300 ls2])
367 AT_KEYWORDS([vtep-ctl])
369 AT_CHECK([RUN_VTEP_CTL(
375 [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
376 CHECK_PSWITCHES([ps1], [ps2])
377 CHECK_PORTS([ps1], [pp1])
378 CHECK_PORTS([ps2], [pp2])
379 CHECK_LSWITCHES([ls1], [ls2])
380 AT_CHECK([RUN_VTEP_CTL(
381 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
382 AT_CHECK([RUN_VTEP_CTL(
383 [bind-ls ps2 pp2 300 ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
384 AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
386 ], [], [VTEP_CTL_CLEANUP])
387 AT_CHECK([RUN_VTEP_CTL([list-bindings ps2 pp2])], [0],
389 ], [], [VTEP_CTL_CLEANUP])
394 dnl ----------------------------------------------------------------------
395 AT_BANNER([vtep-ctl unit tests -- MAC binding tests])
397 AT_SETUP([add-ucast-local ls1])
398 AT_KEYWORDS([vtep-ctl])
400 AT_CHECK([RUN_VTEP_CTL(
401 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
402 CHECK_LSWITCHES([ls1])
403 AT_CHECK([RUN_VTEP_CTL(
404 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
405 [add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
406 ], [0], [], [], [VTEP_CTL_CLEANUP])
407 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
409 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
410 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
414 ], [], [VTEP_CTL_CLEANUP])
415 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
420 ], [], [VTEP_CTL_CLEANUP])
424 AT_SETUP([add-ucast-local ls1, overwrite])
425 AT_KEYWORDS([vtep-ctl])
427 AT_CHECK([RUN_VTEP_CTL(
428 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
429 CHECK_LSWITCHES([ls1])
430 AT_CHECK([RUN_VTEP_CTL(
431 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
432 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.11])
433 ], [0], [], [], [VTEP_CTL_CLEANUP])
434 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
436 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11
440 ], [], [VTEP_CTL_CLEANUP])
444 AT_SETUP([add-ucast-local ls1, del-ucast-local ls1])
445 AT_KEYWORDS([vtep-ctl])
447 AT_CHECK([RUN_VTEP_CTL(
448 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
449 CHECK_LSWITCHES([ls1])
450 AT_CHECK([RUN_VTEP_CTL(
451 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
452 [add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
453 ], [0], [], [], [VTEP_CTL_CLEANUP])
454 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
456 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
457 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
461 ], [], [VTEP_CTL_CLEANUP])
462 AT_CHECK([RUN_VTEP_CTL(
463 [del-ucast-local ls1 00:11:22:33:44:55])
464 ], [0], [], [], [VTEP_CTL_CLEANUP])
465 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
467 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
471 ], [], [VTEP_CTL_CLEANUP])
475 AT_SETUP([add-ucast-remote ls1])
476 AT_KEYWORDS([vtep-ctl])
478 AT_CHECK([RUN_VTEP_CTL(
479 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
480 CHECK_LSWITCHES([ls1])
481 AT_CHECK([RUN_VTEP_CTL(
482 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
483 [add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
484 ], [0], [], [], [VTEP_CTL_CLEANUP])
485 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
487 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
488 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
492 ], [], [VTEP_CTL_CLEANUP])
493 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
498 ], [], [VTEP_CTL_CLEANUP])
502 AT_SETUP([add-ucast-remote ls1, overwrite])
503 AT_KEYWORDS([vtep-ctl])
505 AT_CHECK([RUN_VTEP_CTL(
506 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
507 CHECK_LSWITCHES([ls1])
508 AT_CHECK([RUN_VTEP_CTL(
509 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
510 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.11])
511 ], [0], [], [], [VTEP_CTL_CLEANUP])
512 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
514 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11
518 ], [], [VTEP_CTL_CLEANUP])
522 AT_SETUP([add-ucast-remote ls1, del-ucast-remote ls1])
523 AT_KEYWORDS([vtep-ctl])
525 AT_CHECK([RUN_VTEP_CTL(
526 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
527 CHECK_LSWITCHES([ls1])
528 AT_CHECK([RUN_VTEP_CTL(
529 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
530 [add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
531 ], [0], [], [], [VTEP_CTL_CLEANUP])
532 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
534 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
535 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
539 ], [], [VTEP_CTL_CLEANUP])
540 AT_CHECK([RUN_VTEP_CTL(
541 [del-ucast-remote ls1 00:11:22:33:44:55])
542 ], [0], [], [], [VTEP_CTL_CLEANUP])
543 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
545 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
549 ], [], [VTEP_CTL_CLEANUP])
553 AT_SETUP([add-ucast-local ls1, add-ucast-remote ls1])
554 AT_KEYWORDS([vtep-ctl])
556 AT_CHECK([RUN_VTEP_CTL(
557 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
558 CHECK_LSWITCHES([ls1])
559 AT_CHECK([RUN_VTEP_CTL(
560 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
561 [add-ucast-local ls1 00:11:22:33:44:66 10.0.0.11],
562 [add-ucast-remote ls1 02:11:22:33:44:55 10.0.0.10],
563 [add-ucast-remote ls1 02:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
564 ], [0], [], [], [VTEP_CTL_CLEANUP])
565 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
567 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
568 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
572 ], [], [VTEP_CTL_CLEANUP])
573 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
575 02:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
576 02:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
580 ], [], [VTEP_CTL_CLEANUP])
584 AT_SETUP([add-mcast-local ls1])
585 AT_KEYWORDS([vtep-ctl])
587 AT_CHECK([RUN_VTEP_CTL(
588 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
589 CHECK_LSWITCHES([ls1])
590 AT_CHECK([RUN_VTEP_CTL(
591 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
592 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
593 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12])
594 ], [0], [], [], [VTEP_CTL_CLEANUP])
595 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
599 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
600 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
601 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
603 ], [], [VTEP_CTL_CLEANUP])
604 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
609 ], [], [VTEP_CTL_CLEANUP])
613 AT_SETUP([add-mcast-local ls1, del-mcast-local ls1])
614 AT_KEYWORDS([vtep-ctl])
616 AT_CHECK([RUN_VTEP_CTL(
617 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
618 CHECK_LSWITCHES([ls1])
619 AT_CHECK([RUN_VTEP_CTL(
620 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
621 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
622 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
623 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.13])
624 ], [0], [], [], [VTEP_CTL_CLEANUP])
625 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
629 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
630 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
631 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
632 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
634 ], [], [VTEP_CTL_CLEANUP])
635 AT_CHECK([RUN_VTEP_CTL(
636 [del-mcast-local ls1 01:11:22:33:44:55 10.0.0.12])
637 ], [0], [], [], [VTEP_CTL_CLEANUP])
638 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
642 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
643 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
644 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
646 ], [], [VTEP_CTL_CLEANUP])
650 AT_SETUP([add-mcast-remote ls1])
651 AT_KEYWORDS([vtep-ctl])
653 AT_CHECK([RUN_VTEP_CTL(
654 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
655 CHECK_LSWITCHES([ls1])
656 AT_CHECK([RUN_VTEP_CTL(
657 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
658 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
659 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
660 ], [0], [], [], [VTEP_CTL_CLEANUP])
661 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
665 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
666 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
667 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
669 ], [], [VTEP_CTL_CLEANUP])
670 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
675 ], [], [VTEP_CTL_CLEANUP])
679 AT_SETUP([add-mcast-remote ls1, del-mcast-remote ls1])
680 AT_KEYWORDS([vtep-ctl])
682 AT_CHECK([RUN_VTEP_CTL(
683 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
684 CHECK_LSWITCHES([ls1])
685 AT_CHECK([RUN_VTEP_CTL(
686 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
687 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
688 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12],
689 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.13])
690 ], [0], [], [], [VTEP_CTL_CLEANUP])
691 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
695 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
696 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
697 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
698 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
700 ], [], [VTEP_CTL_CLEANUP])
701 AT_CHECK([RUN_VTEP_CTL(
702 [del-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
703 ], [0], [], [], [VTEP_CTL_CLEANUP])
704 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
708 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
709 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
710 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
712 ], [], [VTEP_CTL_CLEANUP])
716 AT_SETUP([add-mcast-local ls1, add-mcast-remote ls1])
717 AT_KEYWORDS([vtep-ctl])
719 AT_CHECK([RUN_VTEP_CTL(
720 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
721 CHECK_LSWITCHES([ls1])
722 AT_CHECK([RUN_VTEP_CTL(
723 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
724 [add-mcast-local ls1 01:11:22:33:44:66 10.0.0.11],
725 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
726 [add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.10],
727 [add-mcast-remote ls1 03:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
728 [add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.12])
729 ], [0], [], [], [VTEP_CTL_CLEANUP])
730 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
734 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
735 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
736 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
738 ], [], [VTEP_CTL_CLEANUP])
739 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
743 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
744 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
745 03:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
747 ], [], [VTEP_CTL_CLEANUP])
751 AT_SETUP([add local and remote macs, clear-local-macs])
752 AT_KEYWORDS([vtep-ctl])
754 AT_CHECK([RUN_VTEP_CTL(
755 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
756 CHECK_LSWITCHES([ls1])
757 AT_CHECK([RUN_VTEP_CTL(
758 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
759 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
760 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
761 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
762 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
763 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
764 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
765 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
766 ], [0], [], [], [VTEP_CTL_CLEANUP])
767 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
769 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
772 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
773 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
774 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
776 ], [], [VTEP_CTL_CLEANUP])
777 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
779 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
782 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
783 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
784 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
786 ], [], [VTEP_CTL_CLEANUP])
787 AT_CHECK([RUN_VTEP_CTL(
788 [clear-local-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
789 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
794 ], [], [VTEP_CTL_CLEANUP])
795 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
797 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
800 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
801 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
802 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
804 ], [], [VTEP_CTL_CLEANUP])
808 AT_SETUP([add local and remote macs, clear-remote-macs])
809 AT_KEYWORDS([vtep-ctl])
811 AT_CHECK([RUN_VTEP_CTL(
812 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
813 CHECK_LSWITCHES([ls1])
814 AT_CHECK([RUN_VTEP_CTL(
815 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
816 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
817 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
818 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
819 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
820 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
821 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
822 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
823 ], [0], [], [], [VTEP_CTL_CLEANUP])
824 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
826 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
829 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
830 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
831 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
833 ], [], [VTEP_CTL_CLEANUP])
834 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
836 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
839 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
840 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
841 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
843 ], [], [VTEP_CTL_CLEANUP])
844 AT_CHECK([RUN_VTEP_CTL(
845 [clear-remote-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
846 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
848 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
851 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
852 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
853 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
855 ], [], [VTEP_CTL_CLEANUP])
856 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
861 ], [], [VTEP_CTL_CLEANUP])
865 dnl ----------------------------------------------------------------------
866 AT_BANNER([vtep-ctl unit tests -- manager commands])
869 AT_KEYWORDS([manager vtep-ctl])
871 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
874 [set-manager tcp:4.5.6.7],
876 [set-manager tcp:8.9.10.11 tcp:5.4.3.2],
879 [get-manager])], [0], [
884 tcp:5.4.3.2\ntcp:8.9.10.11
887 ], [], [VTEP_CTL_CLEANUP])