1 dnl VTEP_OVSDB_INIT([$1])
3 dnl Creates an empty database named $1.
4 m4_define([VTEP_OVSDB_INIT],
6 [ovsdb-tool create $1 $abs_top_srcdir/vtep/vtep.ovsschema],
7 [0], [stdout], [ignore])
9 [[ovsdb-tool transact $1 \
14 [0], [ignore], [ignore])])
18 dnl Creates an empty database in the current directory and then starts
19 dnl an ovsdb-server on it for vtep-ctl to connect to.
20 m4_define([VTEP_CTL_SETUP],
21 [VTEP_OVSDB_INIT([db])
22 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db >/dev/null 2>&1], [0], [ignore], [ignore])])
26 dnl Kills off the database server.
27 m4_define([VTEP_CTL_CLEANUP], [OVSDB_SERVER_SHUTDOWN])
29 dnl RUN_VTEP_CTL(COMMAND, ...)
31 dnl Executes each vtep-ctl COMMAND.
32 m4_define([RUN_VTEP_CTL],
33 [m4_foreach([command], [$@], [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket command
35 m4_define([RUN_VTEP_CTL_ONELINE],
36 [m4_foreach([command], [$@], [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- command
39 dnl RUN_VTEP_CTL_TOGETHER(COMMAND, ...)
41 dnl Executes each vtep-ctl COMMAND in a single run of vtep-ctl.
42 m4_define([RUN_VTEP_CTL_TOGETHER],
43 [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline dnl
44 m4_foreach([command], [$@], [ -- command])])
46 dnl CHECK_PSWITCHES([PSWITCH], ...)
48 dnl Verifies that "vtep-ctl list-ps" prints the specified list of
49 dnl physical switches, which must be in alphabetical order.
50 m4_define([CHECK_PSWITCHES],
51 [dnl Check that the pswitches appear on list-ps, without --oneline.
53 [RUN_VTEP_CTL([list-ps])],
55 [m4_foreach([psinfo], [$@], [m4_car(psinfo)
60 dnl Check that the pswitches appear on list-ps, with --oneline.
62 [RUN_VTEP_CTL_ONELINE([list-ps])],
64 [m4_join([\n], m4_foreach([psinfo], [$@], [m4_car(psinfo),]))
69 dnl Check that each pswitch exists according to ps-exists and that
70 dnl a pswitch that should not exist does not.
71 m4_foreach([psinfo], [$@],
72 [AT_CHECK([RUN_VTEP_CTL([ps-exists m4_car(psinfo)])], [0], [],
73 [], [VTEP_CTL_CLEANUP])])
74 AT_CHECK([RUN_VTEP_CTL([ps-exists nonexistent])], [2], [], [],
77 dnl CHECK_PORTS(PSWITCH, PORT[, PORT...])
79 dnl Verifies that "vtep-ctl list-ports PSWITCH" prints the specified
80 dnl list of ports, which must be in alphabetical order.
81 m4_define([CHECK_PORTS],
82 [dnl Check ports without --oneline.
84 [RUN_VTEP_CTL([list-ports $1])],
86 [m4_foreach([port], m4_cdr($@), [port
91 dnl Check ports with --oneline.
93 [RUN_VTEP_CTL_ONELINE([list-ports $1])],
95 [m4_join([\n], m4_shift($@))
101 dnl CHECK_LSWITCHES([LSWITCH], ...)
103 dnl Verifies that "vtep-ctl list-ls" prints the specified list of
104 dnl logical switches, which must be in alphabetical order.
105 m4_define([CHECK_LSWITCHES],
106 [dnl Check that the lswitches appear on list-ls, without --oneline.
108 [RUN_VTEP_CTL([list-ls])],
110 [m4_foreach([lsinfo], [$@], [m4_car(lsinfo)
115 dnl Check that the lswitches appear on list-ls, with --oneline.
117 [RUN_VTEP_CTL_ONELINE([list-ls])],
119 [m4_join([\n], m4_foreach([lsinfo], [$@], [m4_car(lsinfo),]))
124 dnl Check that each lswitch exists according to ls-exists and that
125 dnl a pswitch that should not exist does not.
126 m4_foreach([lsinfo], [$@],
127 [AT_CHECK([RUN_VTEP_CTL([ls-exists m4_car(lsinfo)])], [0], [],
128 [], [VTEP_CTL_CLEANUP])])
129 AT_CHECK([RUN_VTEP_CTL([ls-exists nonexistent])], [2], [], [],
130 [VTEP_CTL_CLEANUP])])
132 dnl ----------------------------------------------------------------------
133 AT_BANNER([vtep-ctl unit tests -- physical switch tests])
136 AT_KEYWORDS([vtep-ctl])
138 AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP])
143 AT_SETUP([add-ps a, add-ps a])
144 AT_KEYWORDS([vtep-ctl])
146 AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP])
147 AT_CHECK([RUN_VTEP_CTL([add-ps a])], [1], [],
148 [vtep-ctl: cannot create physical switch a because it already exists
149 ], [VTEP_CTL_CLEANUP])
153 AT_SETUP([add-ps a, add-ps b])
154 AT_KEYWORDS([vtep-ctl])
156 AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b])], [0], [], [],
158 CHECK_PSWITCHES([a], [b])
162 AT_SETUP([add-ps a, add-ps b, del-ps a])
163 AT_KEYWORDS([vtep-ctl])
165 AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b], [del-ps a])], [0], [], [],
171 AT_SETUP([add-ps a, del-ps a, add-ps a])
172 AT_KEYWORDS([vtep-ctl])
174 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
180 ], [], [VTEP_CTL_CLEANUP])
185 AT_SETUP([add-ps a, add-port a a1, add-port a a2])
186 AT_KEYWORDS([vtep-ctl])
188 AT_CHECK([RUN_VTEP_CTL(
190 [--if-exists del-ps b],
192 [add-port a a2])], [0], [], [], [VTEP_CTL_CLEANUP])
194 CHECK_PORTS([a], [a1], [a2])
198 AT_SETUP([add-ps a, add-port a a1, add-port a a1])
199 AT_KEYWORDS([vtep-ctl])
201 AT_CHECK([RUN_VTEP_CTL(
203 [add-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP])
204 AT_CHECK([RUN_VTEP_CTL([add-port a a1])], [1], [],
205 [vtep-ctl: cannot create a port named a1 on a because a port with that name already exists
206 ], [VTEP_CTL_CLEANUP])
210 AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-ps a])
211 AT_KEYWORDS([vtep-ctl])
213 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
218 [--if-exists del-port b b2],
225 ], [], [VTEP_CTL_CLEANUP])
227 CHECK_PORTS([b], [b1])
231 AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-port a a1])
232 AT_KEYWORDS([vtep-ctl])
234 AT_CHECK([RUN_VTEP_CTL(
238 [--may-exist add-port b b1],
239 [del-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP])
240 AT_CHECK([RUN_VTEP_CTL([--may-exist add-port b b1])], [0], [], [],
242 CHECK_PSWITCHES([a], [b])
244 CHECK_PORTS([b], [b1])
248 AT_SETUP([add-ps a b, add-port a p1, add-port b p1, del-port a p1])
249 AT_KEYWORDS([vtep-ctl])
251 AT_CHECK([RUN_VTEP_CTL(
255 [add-port b p1])], [0], [], [], [VTEP_CTL_CLEANUP])
256 CHECK_PSWITCHES([a], [b])
257 CHECK_PORTS([a], [p1])
258 CHECK_PORTS([b], [p1])
259 AT_CHECK([RUN_VTEP_CTL([del-port a p1])], [0], [], [],
261 CHECK_PSWITCHES([a], [b])
263 CHECK_PORTS([b], [p1])
268 dnl ----------------------------------------------------------------------
269 AT_BANNER([vtep-ctl unit tests -- logical switch tests])
272 AT_KEYWORDS([vtep-ctl])
274 AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP])
279 AT_SETUP([add-ls a, add-ls a])
280 AT_KEYWORDS([vtep-ctl])
282 AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP])
283 AT_CHECK([RUN_VTEP_CTL([add-ls a])], [1], [],
284 [vtep-ctl: cannot create logical switch a because it already exists
285 ], [VTEP_CTL_CLEANUP])
289 AT_SETUP([add-ls a, add-ls b])
290 AT_KEYWORDS([vtep-ctl])
292 AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b])], [0], [], [],
294 CHECK_LSWITCHES([a], [b])
298 AT_SETUP([add-ls a, add-ls b, del-ls a])
299 AT_KEYWORDS([vtep-ctl])
301 AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b], [del-ls a])], [0], [], [],
307 AT_SETUP([add-ls a, del-ls a, add-ls a])
308 AT_KEYWORDS([vtep-ctl])
310 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
316 ], [], [VTEP_CTL_CLEANUP])
322 dnl ----------------------------------------------------------------------
323 AT_BANNER([vtep-ctl unit tests -- logical binding tests])
325 AT_SETUP([bind-ls ps1 pp1 300 ls1])
326 AT_KEYWORDS([vtep-ctl])
328 AT_CHECK([RUN_VTEP_CTL(
331 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
332 CHECK_PSWITCHES([ps1])
333 CHECK_PORTS([ps1], [pp1])
334 CHECK_LSWITCHES([ls1])
335 AT_CHECK([RUN_VTEP_CTL(
336 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
337 AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
339 ], [], [VTEP_CTL_CLEANUP])
343 AT_SETUP([bind-ls ps1 pp1 300 ls1, bind-ls ps1 pp1 400 ls2])
344 AT_KEYWORDS([vtep-ctl])
346 AT_CHECK([RUN_VTEP_CTL(
350 [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
351 CHECK_PSWITCHES([ps1])
352 CHECK_PORTS([ps1], [pp1])
353 CHECK_LSWITCHES([ls1], [ls2])
354 AT_CHECK([RUN_VTEP_CTL(
355 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
356 AT_CHECK([RUN_VTEP_CTL(
357 [bind-ls ps1 pp1 400 ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
358 AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
361 ], [], [VTEP_CTL_CLEANUP])
365 AT_SETUP([bind-ls ps1 pp1 300, bind-ls ps2 pp2 300 ls2])
366 AT_KEYWORDS([vtep-ctl])
368 AT_CHECK([RUN_VTEP_CTL(
374 [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
375 CHECK_PSWITCHES([ps1], [ps2])
376 CHECK_PORTS([ps1], [pp1])
377 CHECK_PORTS([ps2], [pp2])
378 CHECK_LSWITCHES([ls1], [ls2])
379 AT_CHECK([RUN_VTEP_CTL(
380 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
381 AT_CHECK([RUN_VTEP_CTL(
382 [bind-ls ps2 pp2 300 ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
383 AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
385 ], [], [VTEP_CTL_CLEANUP])
386 AT_CHECK([RUN_VTEP_CTL([list-bindings ps2 pp2])], [0],
388 ], [], [VTEP_CTL_CLEANUP])
393 dnl ----------------------------------------------------------------------
394 AT_BANNER([vtep-ctl unit tests -- MAC binding tests])
396 AT_SETUP([add-ucast-local ls1])
397 AT_KEYWORDS([vtep-ctl])
399 AT_CHECK([RUN_VTEP_CTL(
400 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
401 CHECK_LSWITCHES([ls1])
402 AT_CHECK([RUN_VTEP_CTL(
403 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
404 [add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
405 ], [0], [], [], [VTEP_CTL_CLEANUP])
406 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
408 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
409 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
413 ], [], [VTEP_CTL_CLEANUP])
414 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
419 ], [], [VTEP_CTL_CLEANUP])
423 AT_SETUP([add-ucast-local ls1, overwrite])
424 AT_KEYWORDS([vtep-ctl])
426 AT_CHECK([RUN_VTEP_CTL(
427 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
428 CHECK_LSWITCHES([ls1])
429 AT_CHECK([RUN_VTEP_CTL(
430 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
431 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.11])
432 ], [0], [], [], [VTEP_CTL_CLEANUP])
433 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
435 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11
439 ], [], [VTEP_CTL_CLEANUP])
443 AT_SETUP([add-ucast-local ls1, del-ucast-local ls1])
444 AT_KEYWORDS([vtep-ctl])
446 AT_CHECK([RUN_VTEP_CTL(
447 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
448 CHECK_LSWITCHES([ls1])
449 AT_CHECK([RUN_VTEP_CTL(
450 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
451 [add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
452 ], [0], [], [], [VTEP_CTL_CLEANUP])
453 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
455 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
456 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
460 ], [], [VTEP_CTL_CLEANUP])
461 AT_CHECK([RUN_VTEP_CTL(
462 [del-ucast-local ls1 00:11:22:33:44:55])
463 ], [0], [], [], [VTEP_CTL_CLEANUP])
464 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
466 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
470 ], [], [VTEP_CTL_CLEANUP])
474 AT_SETUP([add-ucast-remote ls1])
475 AT_KEYWORDS([vtep-ctl])
477 AT_CHECK([RUN_VTEP_CTL(
478 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
479 CHECK_LSWITCHES([ls1])
480 AT_CHECK([RUN_VTEP_CTL(
481 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
482 [add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
483 ], [0], [], [], [VTEP_CTL_CLEANUP])
484 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
486 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
487 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
491 ], [], [VTEP_CTL_CLEANUP])
492 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
497 ], [], [VTEP_CTL_CLEANUP])
501 AT_SETUP([add-ucast-remote ls1, overwrite])
502 AT_KEYWORDS([vtep-ctl])
504 AT_CHECK([RUN_VTEP_CTL(
505 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
506 CHECK_LSWITCHES([ls1])
507 AT_CHECK([RUN_VTEP_CTL(
508 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
509 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.11])
510 ], [0], [], [], [VTEP_CTL_CLEANUP])
511 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
513 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11
517 ], [], [VTEP_CTL_CLEANUP])
521 AT_SETUP([add-ucast-remote ls1, del-ucast-remote ls1])
522 AT_KEYWORDS([vtep-ctl])
524 AT_CHECK([RUN_VTEP_CTL(
525 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
526 CHECK_LSWITCHES([ls1])
527 AT_CHECK([RUN_VTEP_CTL(
528 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
529 [add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
530 ], [0], [], [], [VTEP_CTL_CLEANUP])
531 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
533 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
534 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
538 ], [], [VTEP_CTL_CLEANUP])
539 AT_CHECK([RUN_VTEP_CTL(
540 [del-ucast-remote ls1 00:11:22:33:44:55])
541 ], [0], [], [], [VTEP_CTL_CLEANUP])
542 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
544 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
548 ], [], [VTEP_CTL_CLEANUP])
552 AT_SETUP([add-ucast-local ls1, add-ucast-remote ls1])
553 AT_KEYWORDS([vtep-ctl])
555 AT_CHECK([RUN_VTEP_CTL(
556 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
557 CHECK_LSWITCHES([ls1])
558 AT_CHECK([RUN_VTEP_CTL(
559 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
560 [add-ucast-local ls1 00:11:22:33:44:66 10.0.0.11],
561 [add-ucast-remote ls1 02:11:22:33:44:55 10.0.0.10],
562 [add-ucast-remote ls1 02:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11])
563 ], [0], [], [], [VTEP_CTL_CLEANUP])
564 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
566 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
567 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
571 ], [], [VTEP_CTL_CLEANUP])
572 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
574 02:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
575 02:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
579 ], [], [VTEP_CTL_CLEANUP])
583 AT_SETUP([add-mcast-local ls1])
584 AT_KEYWORDS([vtep-ctl])
586 AT_CHECK([RUN_VTEP_CTL(
587 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
588 CHECK_LSWITCHES([ls1])
589 AT_CHECK([RUN_VTEP_CTL(
590 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
591 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
592 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12])
593 ], [0], [], [], [VTEP_CTL_CLEANUP])
594 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
598 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
599 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
600 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
602 ], [], [VTEP_CTL_CLEANUP])
603 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
608 ], [], [VTEP_CTL_CLEANUP])
612 AT_SETUP([add-mcast-local ls1, del-mcast-local ls1])
613 AT_KEYWORDS([vtep-ctl])
615 AT_CHECK([RUN_VTEP_CTL(
616 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
617 CHECK_LSWITCHES([ls1])
618 AT_CHECK([RUN_VTEP_CTL(
619 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
620 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
621 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
622 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.13])
623 ], [0], [], [], [VTEP_CTL_CLEANUP])
624 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
628 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
629 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
630 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
631 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
633 ], [], [VTEP_CTL_CLEANUP])
634 AT_CHECK([RUN_VTEP_CTL(
635 [del-mcast-local ls1 01:11:22:33:44:55 10.0.0.12])
636 ], [0], [], [], [VTEP_CTL_CLEANUP])
637 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
641 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
642 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
643 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
645 ], [], [VTEP_CTL_CLEANUP])
649 AT_SETUP([add-mcast-remote ls1])
650 AT_KEYWORDS([vtep-ctl])
652 AT_CHECK([RUN_VTEP_CTL(
653 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
654 CHECK_LSWITCHES([ls1])
655 AT_CHECK([RUN_VTEP_CTL(
656 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
657 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
658 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
659 ], [0], [], [], [VTEP_CTL_CLEANUP])
660 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
664 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
665 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
666 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
668 ], [], [VTEP_CTL_CLEANUP])
669 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
674 ], [], [VTEP_CTL_CLEANUP])
678 AT_SETUP([add-mcast-remote ls1, del-mcast-remote ls1])
679 AT_KEYWORDS([vtep-ctl])
681 AT_CHECK([RUN_VTEP_CTL(
682 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
683 CHECK_LSWITCHES([ls1])
684 AT_CHECK([RUN_VTEP_CTL(
685 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
686 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
687 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12],
688 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.13])
689 ], [0], [], [], [VTEP_CTL_CLEANUP])
690 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
694 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
695 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
696 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
697 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
699 ], [], [VTEP_CTL_CLEANUP])
700 AT_CHECK([RUN_VTEP_CTL(
701 [del-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
702 ], [0], [], [], [VTEP_CTL_CLEANUP])
703 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
707 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
708 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13
709 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
711 ], [], [VTEP_CTL_CLEANUP])
715 AT_SETUP([add-mcast-local ls1, add-mcast-remote ls1])
716 AT_KEYWORDS([vtep-ctl])
718 AT_CHECK([RUN_VTEP_CTL(
719 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
720 CHECK_LSWITCHES([ls1])
721 AT_CHECK([RUN_VTEP_CTL(
722 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
723 [add-mcast-local ls1 01:11:22:33:44:66 10.0.0.11],
724 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
725 [add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.10],
726 [add-mcast-remote ls1 03:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
727 [add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.12])
728 ], [0], [], [], [VTEP_CTL_CLEANUP])
729 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
733 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
734 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
735 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
737 ], [], [VTEP_CTL_CLEANUP])
738 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
742 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
743 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12
744 03:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
746 ], [], [VTEP_CTL_CLEANUP])
750 AT_SETUP([add local and remote macs, clear-local-macs])
751 AT_KEYWORDS([vtep-ctl])
753 AT_CHECK([RUN_VTEP_CTL(
754 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
755 CHECK_LSWITCHES([ls1])
756 AT_CHECK([RUN_VTEP_CTL(
757 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
758 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
759 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
760 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
761 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
762 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
763 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
764 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
765 ], [0], [], [], [VTEP_CTL_CLEANUP])
766 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
768 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
771 01: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.12
773 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
775 ], [], [VTEP_CTL_CLEANUP])
776 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
778 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
781 01: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.12
783 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
785 ], [], [VTEP_CTL_CLEANUP])
786 AT_CHECK([RUN_VTEP_CTL(
787 [clear-local-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
788 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
793 ], [], [VTEP_CTL_CLEANUP])
794 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
796 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
799 01: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.12
801 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
803 ], [], [VTEP_CTL_CLEANUP])
807 AT_SETUP([add local and remote macs, clear-remote-macs])
808 AT_KEYWORDS([vtep-ctl])
810 AT_CHECK([RUN_VTEP_CTL(
811 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
812 CHECK_LSWITCHES([ls1])
813 AT_CHECK([RUN_VTEP_CTL(
814 [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10],
815 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10],
816 [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
817 [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12],
818 [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10],
819 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10],
820 [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11],
821 [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
822 ], [0], [], [], [VTEP_CTL_CLEANUP])
823 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
825 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
828 01: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.12
830 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
832 ], [], [VTEP_CTL_CLEANUP])
833 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
835 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
838 01: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.12
840 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
842 ], [], [VTEP_CTL_CLEANUP])
843 AT_CHECK([RUN_VTEP_CTL(
844 [clear-remote-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
845 AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
847 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
850 01: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.12
852 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
854 ], [], [VTEP_CTL_CLEANUP])
855 AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
860 ], [], [VTEP_CTL_CLEANUP])
864 dnl ----------------------------------------------------------------------
865 AT_BANNER([vtep-ctl unit tests -- manager commands])
868 AT_KEYWORDS([manager vtep-ctl])
870 AT_CHECK([RUN_VTEP_CTL_TOGETHER(
873 [set-manager tcp:4.5.6.7],
875 [set-manager tcp:8.9.10.11 tcp:5.4.3.2],
878 [get-manager])], [0], [
883 tcp:5.4.3.2\ntcp:8.9.10.11
886 ], [], [VTEP_CTL_CLEANUP])
890 AT_SETUP([show command])
891 AT_KEYWORDS([vtep-ctl show])
893 AT_CHECK([RUN_VTEP_CTL(
894 [set-manager tcp:4.5.6.7],
898 [bind-ls a a1 100 ls1],
899 [set Physical_Switch a management_ips=[[4.3.2.1]] tunnel_ips=[[1.2.3.4]]])], [0], [ignore], [], [VTEP_CTL_CLEANUP])
901 AT_CHECK([vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket show | tail -n+2 | sed 's/=[[a-f0-9-]][[a-f0-9-]]*}/=<ls>}/' ], [0], [dnl
902 Manager "tcp:4.5.6.7"
904 management_ips: [["4.3.2.1"]]
905 tunnel_ips: [["1.2.3.4"]]
909 ], [], [VTEP_CTL_CLEANUP])