]> git.proxmox.com Git - mirror_ovs.git/blame - tests/vtep-ctl.at
lib/odp-util: Skip ignored fields when parsing and formatting.
[mirror_ovs.git] / tests / vtep-ctl.at
CommitLineData
ffc759c6
JP
1dnl VTEP_OVSDB_INIT([$1])
2dnl
3dnl Creates an empty database named $1.
4m4_define([VTEP_OVSDB_INIT],
5 [OVS_RUNDIR=`pwd`; export OVS_RUNDIR
6 AT_CHECK(
7 [ovsdb-tool create $1 $abs_top_srcdir/vtep/vtep.ovsschema],
8 [0], [stdout], [ignore])
9 AT_CHECK(
10 [[ovsdb-tool transact $1 \
11 '["hardware_vtep",
12 {"op": "insert",
13 "table": "Global",
14 "row": {}}]']],
15 [0], [ignore], [ignore])])
16
17dnl VTEP_CTL_SETUP
18dnl
19dnl Creates an empty database in the current directory and then starts
20dnl an ovsdb-server on it for vtep-ctl to connect to.
21m4_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])])
24
25dnl VTEP_CTL_CLEANUP
26dnl
27dnl Kills off the database server.
28m4_define([VTEP_CTL_CLEANUP], [OVSDB_SERVER_SHUTDOWN])
29
30dnl RUN_VTEP_CTL(COMMAND, ...)
31dnl
32dnl Executes each vtep-ctl COMMAND.
33m4_define([RUN_VTEP_CTL],
34 [m4_foreach([command], [$@], [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket command
35])])
36m4_define([RUN_VTEP_CTL_ONELINE],
37 [m4_foreach([command], [$@], [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline -- command
38])])
39
40dnl RUN_VTEP_CTL_TOGETHER(COMMAND, ...)
41dnl
42dnl Executes each vtep-ctl COMMAND in a single run of vtep-ctl.
43m4_define([RUN_VTEP_CTL_TOGETHER],
44 [vtep-ctl --timeout=5 -vreconnect:emer --db=unix:socket --oneline dnl
45m4_foreach([command], [$@], [ -- command])])
46
47dnl CHECK_PSWITCHES([PSWITCH], ...)
48dnl
49dnl Verifies that "vtep-ctl list-ps" prints the specified list of
50dnl physical switches, which must be in alphabetical order.
51m4_define([CHECK_PSWITCHES],
52 [dnl Check that the pswitches appear on list-ps, without --oneline.
53 AT_CHECK(
54 [RUN_VTEP_CTL([list-ps])],
55 [0],
56 [m4_foreach([psinfo], [$@], [m4_car(psinfo)
57])],
58 [],
59 [VTEP_CTL_CLEANUP])
60
61 dnl Check that the pswitches appear on list-ps, with --oneline.
62 AT_CHECK(
63 [RUN_VTEP_CTL_ONELINE([list-ps])],
64 [0],
65 [m4_join([\n], m4_foreach([psinfo], [$@], [m4_car(psinfo),]))
66],
67 [],
68 [VTEP_CTL_CLEANUP])
69
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], [], [],
76 [VTEP_CTL_CLEANUP])])
77
78dnl CHECK_PORTS(PSWITCH, PORT[, PORT...])
79dnl
80dnl Verifies that "vtep-ctl list-ports PSWITCH" prints the specified
81dnl list of ports, which must be in alphabetical order.
82m4_define([CHECK_PORTS],
83 [dnl Check ports without --oneline.
84 AT_CHECK(
85 [RUN_VTEP_CTL([list-ports $1])],
86 [0],
87 [m4_foreach([port], m4_cdr($@), [port
88])],
89 [],
90 [VTEP_CTL_CLEANUP])
91
92 dnl Check ports with --oneline.
93 AT_CHECK(
94 [RUN_VTEP_CTL_ONELINE([list-ports $1])],
95 [0],
96 [m4_join([\n], m4_shift($@))
97],
98 [],
99 [VTEP_CTL_CLEANUP])])
100
101
102dnl CHECK_LSWITCHES([LSWITCH], ...)
103dnl
104dnl Verifies that "vtep-ctl list-ls" prints the specified list of
105dnl logical switches, which must be in alphabetical order.
106m4_define([CHECK_LSWITCHES],
107 [dnl Check that the lswitches appear on list-ls, without --oneline.
108 AT_CHECK(
109 [RUN_VTEP_CTL([list-ls])],
110 [0],
111 [m4_foreach([lsinfo], [$@], [m4_car(lsinfo)
112])],
113 [],
114 [VTEP_CTL_CLEANUP])
115
116 dnl Check that the lswitches appear on list-ls, with --oneline.
117 AT_CHECK(
118 [RUN_VTEP_CTL_ONELINE([list-ls])],
119 [0],
120 [m4_join([\n], m4_foreach([lsinfo], [$@], [m4_car(lsinfo),]))
121],
122 [],
123 [VTEP_CTL_CLEANUP])
124
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])])
132
133dnl ----------------------------------------------------------------------
134AT_BANNER([vtep-ctl unit tests -- physical switch tests])
135
136AT_SETUP([add-ps a])
137AT_KEYWORDS([vtep-ctl])
138VTEP_CTL_SETUP
139AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP])
140CHECK_PSWITCHES([a])
141VTEP_CTL_CLEANUP
142AT_CLEANUP
143
144AT_SETUP([add-ps a, add-ps a])
145AT_KEYWORDS([vtep-ctl])
146VTEP_CTL_SETUP
147AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP])
148AT_CHECK([RUN_VTEP_CTL([add-ps a])], [1], [],
149 [vtep-ctl: cannot create physical switch a because it already exists
150], [VTEP_CTL_CLEANUP])
151VTEP_CTL_CLEANUP
152AT_CLEANUP
153
154AT_SETUP([add-ps a, add-ps b])
155AT_KEYWORDS([vtep-ctl])
156VTEP_CTL_SETUP
157AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b])], [0], [], [],
158 [VTEP_CTL_CLEANUP])
159CHECK_PSWITCHES([a], [b])
160VTEP_CTL_CLEANUP
161AT_CLEANUP
162
163AT_SETUP([add-ps a, add-ps b, del-ps a])
164AT_KEYWORDS([vtep-ctl])
165VTEP_CTL_SETUP
166AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b], [del-ps a])], [0], [], [],
167 [VTEP_CTL_CLEANUP])
168CHECK_PSWITCHES([b])
169VTEP_CTL_CLEANUP
170AT_CLEANUP
171
172AT_SETUP([add-ps a, del-ps a, add-ps a])
173AT_KEYWORDS([vtep-ctl])
174VTEP_CTL_SETUP
175AT_CHECK([RUN_VTEP_CTL_TOGETHER(
176 [add-ps a],
177 [del-ps a],
178 [add-ps a])], [0], [
179
180
181], [], [VTEP_CTL_CLEANUP])
182CHECK_PSWITCHES([a])
183VTEP_CTL_CLEANUP
184AT_CLEANUP
185
186AT_SETUP([add-ps a, add-port a a1, add-port a a2])
187AT_KEYWORDS([vtep-ctl])
188VTEP_CTL_SETUP
189AT_CHECK([RUN_VTEP_CTL(
190 [add-ps a],
191 [--if-exists del-ps b],
192 [add-port a a1],
193 [add-port a a2])], [0], [], [], [VTEP_CTL_CLEANUP])
194CHECK_PSWITCHES([a])
195CHECK_PORTS([a], [a1], [a2])
196VTEP_CTL_CLEANUP
197AT_CLEANUP
198
199AT_SETUP([add-ps a, add-port a a1, add-port a a1])
200AT_KEYWORDS([vtep-ctl])
201VTEP_CTL_SETUP
202AT_CHECK([RUN_VTEP_CTL(
203 [add-ps a],
204 [add-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP])
205AT_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])
208VTEP_CTL_CLEANUP
209AT_CLEANUP
210
211AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-ps a])
212AT_KEYWORDS([vtep-ctl])
213VTEP_CTL_SETUP
214AT_CHECK([RUN_VTEP_CTL_TOGETHER(
215 [add-ps a],
216 [add-ps b],
217 [add-port a a1],
218 [add-port b b1],
219 [--if-exists del-port b b2],
220 [del-ps a])], [0], [
221
222
223
224
225
226], [], [VTEP_CTL_CLEANUP])
227CHECK_PSWITCHES([b])
228CHECK_PORTS([b], [b1])
229VTEP_CTL_CLEANUP
230AT_CLEANUP
231
232AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-port a a1])
233AT_KEYWORDS([vtep-ctl])
234VTEP_CTL_SETUP
235AT_CHECK([RUN_VTEP_CTL(
236 [add-ps a],
237 [add-ps b],
238 [add-port a a1],
239 [--may-exist add-port b b1],
240 [del-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP])
241AT_CHECK([RUN_VTEP_CTL([--may-exist add-port b b1])], [0], [], [],
242 [VTEP_CTL_CLEANUP])
243CHECK_PSWITCHES([a], [b])
244CHECK_PORTS([a])
245CHECK_PORTS([b], [b1])
246VTEP_CTL_CLEANUP
247AT_CLEANUP
248
249AT_SETUP([add-ps a b, add-port a p1, add-port b p1, del-port a p1])
250AT_KEYWORDS([vtep-ctl])
251VTEP_CTL_SETUP
252AT_CHECK([RUN_VTEP_CTL(
253 [add-ps a],
254 [add-ps b],
255 [add-port a p1],
256 [add-port b p1])], [0], [], [], [VTEP_CTL_CLEANUP])
257CHECK_PSWITCHES([a], [b])
258CHECK_PORTS([a], [p1])
259CHECK_PORTS([b], [p1])
260AT_CHECK([RUN_VTEP_CTL([del-port a p1])], [0], [], [],
261 [VTEP_CTL_CLEANUP])
262CHECK_PSWITCHES([a], [b])
263CHECK_PORTS([a])
264CHECK_PORTS([b], [p1])
265VTEP_CTL_CLEANUP
266AT_CLEANUP
267
268
269dnl ----------------------------------------------------------------------
270AT_BANNER([vtep-ctl unit tests -- logical switch tests])
271
272AT_SETUP([add-ls a])
273AT_KEYWORDS([vtep-ctl])
274VTEP_CTL_SETUP
275AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP])
276CHECK_LSWITCHES([a])
277VTEP_CTL_CLEANUP
278AT_CLEANUP
279
280AT_SETUP([add-ls a, add-ls a])
281AT_KEYWORDS([vtep-ctl])
282VTEP_CTL_SETUP
283AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP])
284AT_CHECK([RUN_VTEP_CTL([add-ls a])], [1], [],
285 [vtep-ctl: cannot create logical switch a because it already exists
286], [VTEP_CTL_CLEANUP])
287VTEP_CTL_CLEANUP
288AT_CLEANUP
289
290AT_SETUP([add-ls a, add-ls b])
291AT_KEYWORDS([vtep-ctl])
292VTEP_CTL_SETUP
293AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b])], [0], [], [],
294 [VTEP_CTL_CLEANUP])
295CHECK_LSWITCHES([a], [b])
296VTEP_CTL_CLEANUP
297AT_CLEANUP
298
299AT_SETUP([add-ls a, add-ls b, del-ls a])
300AT_KEYWORDS([vtep-ctl])
301VTEP_CTL_SETUP
302AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b], [del-ls a])], [0], [], [],
303 [VTEP_CTL_CLEANUP])
304CHECK_LSWITCHES([b])
305VTEP_CTL_CLEANUP
306AT_CLEANUP
307
308AT_SETUP([add-ls a, del-ls a, add-ls a])
309AT_KEYWORDS([vtep-ctl])
310VTEP_CTL_SETUP
311AT_CHECK([RUN_VTEP_CTL_TOGETHER(
312 [add-ls a],
313 [del-ls a],
314 [add-ls a])], [0], [
315
316
317], [], [VTEP_CTL_CLEANUP])
318CHECK_LSWITCHES([a])
319VTEP_CTL_CLEANUP
320AT_CLEANUP
321
322
323dnl ----------------------------------------------------------------------
324AT_BANNER([vtep-ctl unit tests -- logical binding tests])
325
326AT_SETUP([bind-ls ps1 pp1 300 ls1])
327AT_KEYWORDS([vtep-ctl])
328VTEP_CTL_SETUP
329AT_CHECK([RUN_VTEP_CTL(
330 [add-ps ps1],
331 [add-port ps1 pp1],
332 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
333CHECK_PSWITCHES([ps1])
334CHECK_PORTS([ps1], [pp1])
335CHECK_LSWITCHES([ls1])
336AT_CHECK([RUN_VTEP_CTL(
337 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
338AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
339 [0300 ls1
340], [], [VTEP_CTL_CLEANUP])
341VTEP_CTL_CLEANUP
342AT_CLEANUP
343
344AT_SETUP([bind-ls ps1 pp1 300 ls1, bind-ls ps1 pp1 400 ls2])
345AT_KEYWORDS([vtep-ctl])
346VTEP_CTL_SETUP
347AT_CHECK([RUN_VTEP_CTL(
348 [add-ps ps1],
349 [add-port ps1 pp1],
350 [add-ls ls1],
351 [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
352CHECK_PSWITCHES([ps1])
353CHECK_PORTS([ps1], [pp1])
354CHECK_LSWITCHES([ls1], [ls2])
355AT_CHECK([RUN_VTEP_CTL(
356 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
357AT_CHECK([RUN_VTEP_CTL(
358 [bind-ls ps1 pp1 400 ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
359AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
360 [0300 ls1
3610400 ls2
362], [], [VTEP_CTL_CLEANUP])
363VTEP_CTL_CLEANUP
364AT_CLEANUP
365
366AT_SETUP([bind-ls ps1 pp1 300, bind-ls ps2 pp2 300 ls2])
367AT_KEYWORDS([vtep-ctl])
368VTEP_CTL_SETUP
369AT_CHECK([RUN_VTEP_CTL(
370 [add-ps ps1],
371 [add-ps ps2],
372 [add-port ps1 pp1],
373 [add-port ps2 pp2],
374 [add-ls ls1],
375 [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
376CHECK_PSWITCHES([ps1], [ps2])
377CHECK_PORTS([ps1], [pp1])
378CHECK_PORTS([ps2], [pp2])
379CHECK_LSWITCHES([ls1], [ls2])
380AT_CHECK([RUN_VTEP_CTL(
381 [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
382AT_CHECK([RUN_VTEP_CTL(
383 [bind-ls ps2 pp2 300 ls2])], [0], [], [], [VTEP_CTL_CLEANUP])
384AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0],
385 [0300 ls1
386], [], [VTEP_CTL_CLEANUP])
387AT_CHECK([RUN_VTEP_CTL([list-bindings ps2 pp2])], [0],
388 [0300 ls2
389], [], [VTEP_CTL_CLEANUP])
390VTEP_CTL_CLEANUP
391AT_CLEANUP
392
393
394dnl ----------------------------------------------------------------------
395AT_BANNER([vtep-ctl unit tests -- MAC binding tests])
396
397AT_SETUP([add-ucast-local ls1])
398AT_KEYWORDS([vtep-ctl])
399VTEP_CTL_SETUP
400AT_CHECK([RUN_VTEP_CTL(
401 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
402CHECK_LSWITCHES([ls1])
403AT_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])
407AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
408 [ucast-mac-local
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
411
412mcast-mac-local
413
414], [], [VTEP_CTL_CLEANUP])
415AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
416 [ucast-mac-remote
417
418mcast-mac-remote
419
420], [], [VTEP_CTL_CLEANUP])
421VTEP_CTL_CLEANUP
422AT_CLEANUP
423
424AT_SETUP([add-ucast-local ls1, overwrite])
425AT_KEYWORDS([vtep-ctl])
426VTEP_CTL_SETUP
427AT_CHECK([RUN_VTEP_CTL(
428 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
429CHECK_LSWITCHES([ls1])
430AT_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])
434AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
435 [ucast-mac-local
436 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11
437
438mcast-mac-local
439
440], [], [VTEP_CTL_CLEANUP])
441VTEP_CTL_CLEANUP
442AT_CLEANUP
443
444AT_SETUP([add-ucast-local ls1, del-ucast-local ls1])
445AT_KEYWORDS([vtep-ctl])
446VTEP_CTL_SETUP
447AT_CHECK([RUN_VTEP_CTL(
448 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
449CHECK_LSWITCHES([ls1])
450AT_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])
454AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
455 [ucast-mac-local
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
458
459mcast-mac-local
460
461], [], [VTEP_CTL_CLEANUP])
462AT_CHECK([RUN_VTEP_CTL(
463 [del-ucast-local ls1 00:11:22:33:44:55])
464], [0], [], [], [VTEP_CTL_CLEANUP])
465AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
466 [ucast-mac-local
467 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
468
469mcast-mac-local
470
471], [], [VTEP_CTL_CLEANUP])
472VTEP_CTL_CLEANUP
473AT_CLEANUP
474
475AT_SETUP([add-ucast-remote ls1])
476AT_KEYWORDS([vtep-ctl])
477VTEP_CTL_SETUP
478AT_CHECK([RUN_VTEP_CTL(
479 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
480CHECK_LSWITCHES([ls1])
481AT_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])
485AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
486 [ucast-mac-remote
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
489
490mcast-mac-remote
491
492], [], [VTEP_CTL_CLEANUP])
493AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
494 [ucast-mac-local
495
496mcast-mac-local
497
498], [], [VTEP_CTL_CLEANUP])
499VTEP_CTL_CLEANUP
500AT_CLEANUP
501
502AT_SETUP([add-ucast-remote ls1, overwrite])
503AT_KEYWORDS([vtep-ctl])
504VTEP_CTL_SETUP
505AT_CHECK([RUN_VTEP_CTL(
506 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
507CHECK_LSWITCHES([ls1])
508AT_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])
512AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
513 [ucast-mac-remote
514 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11
515
516mcast-mac-remote
517
518], [], [VTEP_CTL_CLEANUP])
519VTEP_CTL_CLEANUP
520AT_CLEANUP
521
522AT_SETUP([add-ucast-remote ls1, del-ucast-remote ls1])
523AT_KEYWORDS([vtep-ctl])
524VTEP_CTL_SETUP
525AT_CHECK([RUN_VTEP_CTL(
526 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
527CHECK_LSWITCHES([ls1])
528AT_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])
532AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
533 [ucast-mac-remote
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
536
537mcast-mac-remote
538
539], [], [VTEP_CTL_CLEANUP])
540AT_CHECK([RUN_VTEP_CTL(
541 [del-ucast-remote ls1 00:11:22:33:44:55])
542], [0], [], [], [VTEP_CTL_CLEANUP])
543AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
544 [ucast-mac-remote
545 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11
546
547mcast-mac-remote
548
549], [], [VTEP_CTL_CLEANUP])
550VTEP_CTL_CLEANUP
551AT_CLEANUP
552
553AT_SETUP([add-ucast-local ls1, add-ucast-remote ls1])
554AT_KEYWORDS([vtep-ctl])
555VTEP_CTL_SETUP
556AT_CHECK([RUN_VTEP_CTL(
557 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
558CHECK_LSWITCHES([ls1])
559AT_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])
565AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
566 [ucast-mac-local
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
569
570mcast-mac-local
571
572], [], [VTEP_CTL_CLEANUP])
573AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
574 [ucast-mac-remote
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
577
578mcast-mac-remote
579
580], [], [VTEP_CTL_CLEANUP])
581VTEP_CTL_CLEANUP
582AT_CLEANUP
583
584AT_SETUP([add-mcast-local ls1])
585AT_KEYWORDS([vtep-ctl])
586VTEP_CTL_SETUP
587AT_CHECK([RUN_VTEP_CTL(
588 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
589CHECK_LSWITCHES([ls1])
590AT_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])
595AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
596 [ucast-mac-local
597
598mcast-mac-local
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
602
603], [], [VTEP_CTL_CLEANUP])
604AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
605 [ucast-mac-remote
606
607mcast-mac-remote
608
609], [], [VTEP_CTL_CLEANUP])
610VTEP_CTL_CLEANUP
611AT_CLEANUP
612
613AT_SETUP([add-mcast-local ls1, del-mcast-local ls1])
614AT_KEYWORDS([vtep-ctl])
615VTEP_CTL_SETUP
616AT_CHECK([RUN_VTEP_CTL(
617 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
618CHECK_LSWITCHES([ls1])
619AT_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])
625AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
626 [ucast-mac-local
627
628mcast-mac-local
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
633
634], [], [VTEP_CTL_CLEANUP])
635AT_CHECK([RUN_VTEP_CTL(
636 [del-mcast-local ls1 01:11:22:33:44:55 10.0.0.12])
637], [0], [], [], [VTEP_CTL_CLEANUP])
638AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
639 [ucast-mac-local
640
641mcast-mac-local
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
645
646], [], [VTEP_CTL_CLEANUP])
647VTEP_CTL_CLEANUP
648AT_CLEANUP
649
650AT_SETUP([add-mcast-remote ls1])
651AT_KEYWORDS([vtep-ctl])
652VTEP_CTL_SETUP
653AT_CHECK([RUN_VTEP_CTL(
654 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
655CHECK_LSWITCHES([ls1])
656AT_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])
661AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
662 [ucast-mac-remote
663
664mcast-mac-remote
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
668
669], [], [VTEP_CTL_CLEANUP])
670AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
671 [ucast-mac-local
672
673mcast-mac-local
674
675], [], [VTEP_CTL_CLEANUP])
676VTEP_CTL_CLEANUP
677AT_CLEANUP
678
679AT_SETUP([add-mcast-remote ls1, del-mcast-remote ls1])
680AT_KEYWORDS([vtep-ctl])
681VTEP_CTL_SETUP
682AT_CHECK([RUN_VTEP_CTL(
683 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
684CHECK_LSWITCHES([ls1])
685AT_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])
691AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
692 [ucast-mac-remote
693
694mcast-mac-remote
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
699
700], [], [VTEP_CTL_CLEANUP])
701AT_CHECK([RUN_VTEP_CTL(
702 [del-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12])
703], [0], [], [], [VTEP_CTL_CLEANUP])
704AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
705 [ucast-mac-remote
706
707mcast-mac-remote
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
711
712], [], [VTEP_CTL_CLEANUP])
713VTEP_CTL_CLEANUP
714AT_CLEANUP
715
716AT_SETUP([add-mcast-local ls1, add-mcast-remote ls1])
717AT_KEYWORDS([vtep-ctl])
718VTEP_CTL_SETUP
719AT_CHECK([RUN_VTEP_CTL(
720 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
721CHECK_LSWITCHES([ls1])
722AT_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])
730AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
731 [ucast-mac-local
732
733mcast-mac-local
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
737
738], [], [VTEP_CTL_CLEANUP])
739AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
740 [ucast-mac-remote
741
742mcast-mac-remote
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
746
747], [], [VTEP_CTL_CLEANUP])
748VTEP_CTL_CLEANUP
749AT_CLEANUP
750
751AT_SETUP([add local and remote macs, clear-local-macs])
752AT_KEYWORDS([vtep-ctl])
753VTEP_CTL_SETUP
754AT_CHECK([RUN_VTEP_CTL(
755 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
756CHECK_LSWITCHES([ls1])
757AT_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])
767AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
768 [ucast-mac-local
769 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
770
771mcast-mac-local
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
775
776], [], [VTEP_CTL_CLEANUP])
777AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
778 [ucast-mac-remote
779 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
780
781mcast-mac-remote
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
785
786], [], [VTEP_CTL_CLEANUP])
787AT_CHECK([RUN_VTEP_CTL(
788 [clear-local-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
789AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
790 [ucast-mac-local
791
792mcast-mac-local
793
794], [], [VTEP_CTL_CLEANUP])
795AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
796 [ucast-mac-remote
797 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
798
799mcast-mac-remote
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
803
804], [], [VTEP_CTL_CLEANUP])
805VTEP_CTL_CLEANUP
806AT_CLEANUP
807
808AT_SETUP([add local and remote macs, clear-remote-macs])
809AT_KEYWORDS([vtep-ctl])
810VTEP_CTL_SETUP
811AT_CHECK([RUN_VTEP_CTL(
812 [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
813CHECK_LSWITCHES([ls1])
814AT_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])
824AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
825 [ucast-mac-local
826 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
827
828mcast-mac-local
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
832
833], [], [VTEP_CTL_CLEANUP])
834AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
835 [ucast-mac-remote
836 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
837
838mcast-mac-remote
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
842
843], [], [VTEP_CTL_CLEANUP])
844AT_CHECK([RUN_VTEP_CTL(
845 [clear-remote-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP])
846AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0],
847 [ucast-mac-local
848 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10
849
850mcast-mac-local
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
854
855], [], [VTEP_CTL_CLEANUP])
856AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0],
857 [ucast-mac-remote
858
859mcast-mac-remote
860
861], [], [VTEP_CTL_CLEANUP])
862VTEP_CTL_CLEANUP
863AT_CLEANUP
864
865dnl ----------------------------------------------------------------------
866AT_BANNER([vtep-ctl unit tests -- manager commands])
867
868AT_SETUP([managers])
869AT_KEYWORDS([manager vtep-ctl])
870VTEP_CTL_SETUP
871AT_CHECK([RUN_VTEP_CTL_TOGETHER(
872 [del-manager],
873 [get-manager],
874 [set-manager tcp:4.5.6.7],
875 [get-manager],
876 [set-manager tcp:8.9.10.11 tcp:5.4.3.2],
877 [get-manager],
878 [del-manager],
879 [get-manager])], [0], [
880
881
882tcp:4.5.6.7
883
884tcp:5.4.3.2\ntcp:8.9.10.11
885
886
887], [], [VTEP_CTL_CLEANUP])
888VTEP_CTL_CLEANUP
889AT_CLEANUP