]>
Commit | Line | Data |
---|---|---|
ffc759c6 JP |
1 | dnl VTEP_OVSDB_INIT([$1]) |
2 | dnl | |
3 | dnl Creates an empty database named $1. | |
4 | m4_define([VTEP_OVSDB_INIT], | |
6132b241 | 5 | [AT_CHECK( |
ffc759c6 JP |
6 | [ovsdb-tool create $1 $abs_top_srcdir/vtep/vtep.ovsschema], |
7 | [0], [stdout], [ignore]) | |
8 | AT_CHECK( | |
9 | [[ovsdb-tool transact $1 \ | |
10 | '["hardware_vtep", | |
11 | {"op": "insert", | |
12 | "table": "Global", | |
13 | "row": {}}]']], | |
14 | [0], [ignore], [ignore])]) | |
15 | ||
16 | dnl VTEP_CTL_SETUP | |
17 | dnl | |
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]) | |
56120500 | 22 | AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db >/dev/null 2>&1], [0], [ignore], [ignore])]) |
ffc759c6 JP |
23 | |
24 | dnl VTEP_CTL_CLEANUP | |
25 | dnl | |
26 | dnl Kills off the database server. | |
27 | m4_define([VTEP_CTL_CLEANUP], [OVSDB_SERVER_SHUTDOWN]) | |
28 | ||
29 | dnl RUN_VTEP_CTL(COMMAND, ...) | |
30 | dnl | |
31 | dnl Executes each vtep-ctl COMMAND. | |
32 | m4_define([RUN_VTEP_CTL], | |
15394e0f | 33 | [m4_foreach([command], [$@], [vtep-ctl -vreconnect:emer --db=unix:socket command |
ffc759c6 JP |
34 | ])]) |
35 | m4_define([RUN_VTEP_CTL_ONELINE], | |
15394e0f | 36 | [m4_foreach([command], [$@], [vtep-ctl -vreconnect:emer --db=unix:socket --oneline -- command |
ffc759c6 JP |
37 | ])]) |
38 | ||
39 | dnl RUN_VTEP_CTL_TOGETHER(COMMAND, ...) | |
40 | dnl | |
41 | dnl Executes each vtep-ctl COMMAND in a single run of vtep-ctl. | |
42 | m4_define([RUN_VTEP_CTL_TOGETHER], | |
15394e0f | 43 | [vtep-ctl -vreconnect:emer --db=unix:socket --oneline dnl |
ffc759c6 JP |
44 | m4_foreach([command], [$@], [ -- command])]) |
45 | ||
46 | dnl CHECK_PSWITCHES([PSWITCH], ...) | |
47 | dnl | |
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. | |
52 | AT_CHECK( | |
53 | [RUN_VTEP_CTL([list-ps])], | |
54 | [0], | |
55 | [m4_foreach([psinfo], [$@], [m4_car(psinfo) | |
56 | ])], | |
57 | [], | |
58 | [VTEP_CTL_CLEANUP]) | |
59 | ||
60 | dnl Check that the pswitches appear on list-ps, with --oneline. | |
61 | AT_CHECK( | |
62 | [RUN_VTEP_CTL_ONELINE([list-ps])], | |
63 | [0], | |
64 | [m4_join([\n], m4_foreach([psinfo], [$@], [m4_car(psinfo),])) | |
65 | ], | |
66 | [], | |
67 | [VTEP_CTL_CLEANUP]) | |
68 | ||
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], [], [], | |
75 | [VTEP_CTL_CLEANUP])]) | |
76 | ||
77 | dnl CHECK_PORTS(PSWITCH, PORT[, PORT...]) | |
78 | dnl | |
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. | |
83 | AT_CHECK( | |
84 | [RUN_VTEP_CTL([list-ports $1])], | |
85 | [0], | |
86 | [m4_foreach([port], m4_cdr($@), [port | |
87 | ])], | |
88 | [], | |
89 | [VTEP_CTL_CLEANUP]) | |
90 | ||
91 | dnl Check ports with --oneline. | |
92 | AT_CHECK( | |
93 | [RUN_VTEP_CTL_ONELINE([list-ports $1])], | |
94 | [0], | |
95 | [m4_join([\n], m4_shift($@)) | |
96 | ], | |
97 | [], | |
98 | [VTEP_CTL_CLEANUP])]) | |
99 | ||
100 | ||
101 | dnl CHECK_LSWITCHES([LSWITCH], ...) | |
102 | dnl | |
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. | |
107 | AT_CHECK( | |
108 | [RUN_VTEP_CTL([list-ls])], | |
109 | [0], | |
110 | [m4_foreach([lsinfo], [$@], [m4_car(lsinfo) | |
111 | ])], | |
112 | [], | |
113 | [VTEP_CTL_CLEANUP]) | |
114 | ||
115 | dnl Check that the lswitches appear on list-ls, with --oneline. | |
116 | AT_CHECK( | |
117 | [RUN_VTEP_CTL_ONELINE([list-ls])], | |
118 | [0], | |
119 | [m4_join([\n], m4_foreach([lsinfo], [$@], [m4_car(lsinfo),])) | |
120 | ], | |
121 | [], | |
122 | [VTEP_CTL_CLEANUP]) | |
123 | ||
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])]) | |
131 | ||
c3428f43 DS |
132 | |
133 | dnl CHECK_LROUTERS([LROUTER], ...) | |
134 | dnl | |
135 | dnl Verifies that "vtep-ctl list-lr" prints the specified list of | |
136 | dnl logical routers, which must be in alphabetical order. | |
137 | m4_define([CHECK_LROUTERS], | |
138 | [dnl Check that the lrouters appear on list-lr, without --oneline. | |
139 | AT_CHECK( | |
140 | [RUN_VTEP_CTL([list-lr])], | |
141 | [0], | |
142 | [m4_foreach([lrinfo], [$@], [m4_car(lrinfo) | |
143 | ])], | |
144 | [], | |
145 | [VTEP_CTL_CLEANUP]) | |
146 | ||
147 | dnl Check that the lswitches appear on list-lr, with --oneline. | |
148 | AT_CHECK( | |
149 | [RUN_VTEP_CTL_ONELINE([list-lr])], | |
150 | [0], | |
151 | [m4_join([\n], m4_foreach([lrinfo], [$@], [m4_car(lrinfo),])) | |
152 | ], | |
153 | [], | |
154 | [VTEP_CTL_CLEANUP]) | |
155 | ||
156 | dnl Check that each lrouter exists according to lr-exists and that | |
157 | dnl a prouter that should not exist does not. | |
158 | m4_foreach([lrinfo], [$@], | |
159 | [AT_CHECK([RUN_VTEP_CTL([lr-exists m4_car(lrinfo)])], [0], [], | |
160 | [], [VTEP_CTL_CLEANUP])]) | |
161 | AT_CHECK([RUN_VTEP_CTL([lr-exists nonexistent])], [2], [], [], | |
162 | [VTEP_CTL_CLEANUP])]) | |
163 | ||
164 | ||
ffc759c6 JP |
165 | dnl ---------------------------------------------------------------------- |
166 | AT_BANNER([vtep-ctl unit tests -- physical switch tests]) | |
167 | ||
168 | AT_SETUP([add-ps a]) | |
169 | AT_KEYWORDS([vtep-ctl]) | |
170 | VTEP_CTL_SETUP | |
171 | AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
172 | CHECK_PSWITCHES([a]) | |
173 | VTEP_CTL_CLEANUP | |
174 | AT_CLEANUP | |
175 | ||
176 | AT_SETUP([add-ps a, add-ps a]) | |
177 | AT_KEYWORDS([vtep-ctl]) | |
178 | VTEP_CTL_SETUP | |
179 | AT_CHECK([RUN_VTEP_CTL([add-ps a])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
180 | AT_CHECK([RUN_VTEP_CTL([add-ps a])], [1], [], | |
181 | [vtep-ctl: cannot create physical switch a because it already exists | |
182 | ], [VTEP_CTL_CLEANUP]) | |
183 | VTEP_CTL_CLEANUP | |
184 | AT_CLEANUP | |
185 | ||
186 | AT_SETUP([add-ps a, add-ps b]) | |
187 | AT_KEYWORDS([vtep-ctl]) | |
188 | VTEP_CTL_SETUP | |
189 | AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b])], [0], [], [], | |
190 | [VTEP_CTL_CLEANUP]) | |
191 | CHECK_PSWITCHES([a], [b]) | |
192 | VTEP_CTL_CLEANUP | |
193 | AT_CLEANUP | |
194 | ||
195 | AT_SETUP([add-ps a, add-ps b, del-ps a]) | |
196 | AT_KEYWORDS([vtep-ctl]) | |
197 | VTEP_CTL_SETUP | |
198 | AT_CHECK([RUN_VTEP_CTL([add-ps a], [add-ps b], [del-ps a])], [0], [], [], | |
199 | [VTEP_CTL_CLEANUP]) | |
200 | CHECK_PSWITCHES([b]) | |
201 | VTEP_CTL_CLEANUP | |
202 | AT_CLEANUP | |
203 | ||
204 | AT_SETUP([add-ps a, del-ps a, add-ps a]) | |
205 | AT_KEYWORDS([vtep-ctl]) | |
206 | VTEP_CTL_SETUP | |
207 | AT_CHECK([RUN_VTEP_CTL_TOGETHER( | |
208 | [add-ps a], | |
209 | [del-ps a], | |
210 | [add-ps a])], [0], [ | |
211 | ||
212 | ||
213 | ], [], [VTEP_CTL_CLEANUP]) | |
214 | CHECK_PSWITCHES([a]) | |
215 | VTEP_CTL_CLEANUP | |
216 | AT_CLEANUP | |
217 | ||
218 | AT_SETUP([add-ps a, add-port a a1, add-port a a2]) | |
219 | AT_KEYWORDS([vtep-ctl]) | |
220 | VTEP_CTL_SETUP | |
221 | AT_CHECK([RUN_VTEP_CTL( | |
222 | [add-ps a], | |
223 | [--if-exists del-ps b], | |
224 | [add-port a a1], | |
225 | [add-port a a2])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
226 | CHECK_PSWITCHES([a]) | |
227 | CHECK_PORTS([a], [a1], [a2]) | |
228 | VTEP_CTL_CLEANUP | |
229 | AT_CLEANUP | |
230 | ||
231 | AT_SETUP([add-ps a, add-port a a1, add-port a a1]) | |
232 | AT_KEYWORDS([vtep-ctl]) | |
233 | VTEP_CTL_SETUP | |
234 | AT_CHECK([RUN_VTEP_CTL( | |
235 | [add-ps a], | |
236 | [add-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
237 | AT_CHECK([RUN_VTEP_CTL([add-port a a1])], [1], [], | |
238 | [vtep-ctl: cannot create a port named a1 on a because a port with that name already exists | |
239 | ], [VTEP_CTL_CLEANUP]) | |
240 | VTEP_CTL_CLEANUP | |
241 | AT_CLEANUP | |
242 | ||
243 | AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-ps a]) | |
244 | AT_KEYWORDS([vtep-ctl]) | |
245 | VTEP_CTL_SETUP | |
246 | AT_CHECK([RUN_VTEP_CTL_TOGETHER( | |
247 | [add-ps a], | |
248 | [add-ps b], | |
249 | [add-port a a1], | |
250 | [add-port b b1], | |
251 | [--if-exists del-port b b2], | |
252 | [del-ps a])], [0], [ | |
253 | ||
254 | ||
255 | ||
256 | ||
257 | ||
258 | ], [], [VTEP_CTL_CLEANUP]) | |
259 | CHECK_PSWITCHES([b]) | |
260 | CHECK_PORTS([b], [b1]) | |
261 | VTEP_CTL_CLEANUP | |
262 | AT_CLEANUP | |
263 | ||
264 | AT_SETUP([add-ps a b, add-port a a1, add-port b b1, del-port a a1]) | |
265 | AT_KEYWORDS([vtep-ctl]) | |
266 | VTEP_CTL_SETUP | |
267 | AT_CHECK([RUN_VTEP_CTL( | |
268 | [add-ps a], | |
269 | [add-ps b], | |
270 | [add-port a a1], | |
271 | [--may-exist add-port b b1], | |
272 | [del-port a a1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
273 | AT_CHECK([RUN_VTEP_CTL([--may-exist add-port b b1])], [0], [], [], | |
274 | [VTEP_CTL_CLEANUP]) | |
275 | CHECK_PSWITCHES([a], [b]) | |
276 | CHECK_PORTS([a]) | |
277 | CHECK_PORTS([b], [b1]) | |
278 | VTEP_CTL_CLEANUP | |
279 | AT_CLEANUP | |
280 | ||
281 | AT_SETUP([add-ps a b, add-port a p1, add-port b p1, del-port a p1]) | |
282 | AT_KEYWORDS([vtep-ctl]) | |
283 | VTEP_CTL_SETUP | |
284 | AT_CHECK([RUN_VTEP_CTL( | |
285 | [add-ps a], | |
286 | [add-ps b], | |
287 | [add-port a p1], | |
288 | [add-port b p1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
289 | CHECK_PSWITCHES([a], [b]) | |
290 | CHECK_PORTS([a], [p1]) | |
291 | CHECK_PORTS([b], [p1]) | |
292 | AT_CHECK([RUN_VTEP_CTL([del-port a p1])], [0], [], [], | |
293 | [VTEP_CTL_CLEANUP]) | |
294 | CHECK_PSWITCHES([a], [b]) | |
295 | CHECK_PORTS([a]) | |
296 | CHECK_PORTS([b], [p1]) | |
297 | VTEP_CTL_CLEANUP | |
298 | AT_CLEANUP | |
299 | ||
300 | ||
301 | dnl ---------------------------------------------------------------------- | |
302 | AT_BANNER([vtep-ctl unit tests -- logical switch tests]) | |
303 | ||
304 | AT_SETUP([add-ls a]) | |
305 | AT_KEYWORDS([vtep-ctl]) | |
306 | VTEP_CTL_SETUP | |
307 | AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
308 | CHECK_LSWITCHES([a]) | |
309 | VTEP_CTL_CLEANUP | |
310 | AT_CLEANUP | |
311 | ||
312 | AT_SETUP([add-ls a, add-ls a]) | |
313 | AT_KEYWORDS([vtep-ctl]) | |
314 | VTEP_CTL_SETUP | |
315 | AT_CHECK([RUN_VTEP_CTL([add-ls a])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
316 | AT_CHECK([RUN_VTEP_CTL([add-ls a])], [1], [], | |
317 | [vtep-ctl: cannot create logical switch a because it already exists | |
318 | ], [VTEP_CTL_CLEANUP]) | |
319 | VTEP_CTL_CLEANUP | |
320 | AT_CLEANUP | |
321 | ||
322 | AT_SETUP([add-ls a, add-ls b]) | |
323 | AT_KEYWORDS([vtep-ctl]) | |
324 | VTEP_CTL_SETUP | |
325 | AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b])], [0], [], [], | |
326 | [VTEP_CTL_CLEANUP]) | |
327 | CHECK_LSWITCHES([a], [b]) | |
328 | VTEP_CTL_CLEANUP | |
329 | AT_CLEANUP | |
330 | ||
331 | AT_SETUP([add-ls a, add-ls b, del-ls a]) | |
332 | AT_KEYWORDS([vtep-ctl]) | |
333 | VTEP_CTL_SETUP | |
334 | AT_CHECK([RUN_VTEP_CTL([add-ls a], [add-ls b], [del-ls a])], [0], [], [], | |
335 | [VTEP_CTL_CLEANUP]) | |
336 | CHECK_LSWITCHES([b]) | |
337 | VTEP_CTL_CLEANUP | |
338 | AT_CLEANUP | |
339 | ||
340 | AT_SETUP([add-ls a, del-ls a, add-ls a]) | |
341 | AT_KEYWORDS([vtep-ctl]) | |
342 | VTEP_CTL_SETUP | |
343 | AT_CHECK([RUN_VTEP_CTL_TOGETHER( | |
344 | [add-ls a], | |
345 | [del-ls a], | |
346 | [add-ls a])], [0], [ | |
347 | ||
348 | ||
349 | ], [], [VTEP_CTL_CLEANUP]) | |
350 | CHECK_LSWITCHES([a]) | |
351 | VTEP_CTL_CLEANUP | |
352 | AT_CLEANUP | |
353 | ||
b351ac0c DB |
354 | AT_SETUP([add-ls a, get-replication-mode a]) |
355 | AT_KEYWORDS([vtep-ctl]) | |
356 | VTEP_CTL_SETUP | |
357 | AT_CHECK([RUN_VTEP_CTL( | |
358 | [add-ls a], | |
359 | [get-replication-mode a])], | |
360 | [0], [[(null)] | |
361 | ], [], [VTEP_CTL_CLEANUP]) | |
362 | VTEP_CTL_CLEANUP | |
363 | AT_CLEANUP | |
364 | ||
365 | AT_SETUP([add-ls a, set-replication-mode a source_node]) | |
366 | AT_KEYWORDS([vtep-ctl]) | |
367 | VTEP_CTL_SETUP | |
368 | AT_CHECK([RUN_VTEP_CTL( | |
369 | [add-ls a],[set-replication-mode a source_node], | |
370 | [get-replication-mode a])], | |
371 | [0], [source_node | |
372 | ], [], [VTEP_CTL_CLEANUP]) | |
373 | VTEP_CTL_CLEANUP | |
374 | AT_CLEANUP | |
375 | ||
376 | AT_SETUP([add-ls a, set-replication-mode a service_node]) | |
377 | AT_KEYWORDS([vtep-ctl]) | |
378 | VTEP_CTL_SETUP | |
379 | AT_CHECK([RUN_VTEP_CTL( | |
380 | [add-ls a],[set-replication-mode a service_node], | |
381 | [get-replication-mode a])], | |
382 | [0], [service_node | |
383 | ], [], [VTEP_CTL_CLEANUP]) | |
384 | VTEP_CTL_CLEANUP | |
385 | AT_CLEANUP | |
ffc759c6 | 386 | |
c3428f43 DS |
387 | |
388 | dnl ---------------------------------------------------------------------- | |
389 | AT_BANNER([vtep-ctl unit tests -- logical router tests]) | |
390 | ||
391 | AT_SETUP([add-lr a]) | |
392 | AT_KEYWORDS([vtep-ctl]) | |
393 | VTEP_CTL_SETUP | |
394 | AT_CHECK([RUN_VTEP_CTL([add-lr a])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
395 | CHECK_LROUTERS([a]) | |
396 | VTEP_CTL_CLEANUP | |
397 | AT_CLEANUP | |
398 | ||
399 | AT_SETUP([add-lr a, add-lr a]) | |
400 | AT_KEYWORDS([vtep-ctl]) | |
401 | VTEP_CTL_SETUP | |
402 | AT_CHECK([RUN_VTEP_CTL([add-lr a])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
403 | AT_CHECK([RUN_VTEP_CTL([add-lr a])], [1], [], | |
404 | [vtep-ctl: cannot create logical router a because it already exists | |
405 | ], [VTEP_CTL_CLEANUP]) | |
406 | VTEP_CTL_CLEANUP | |
407 | AT_CLEANUP | |
408 | ||
409 | AT_SETUP([add-lr a, add-lr b]) | |
410 | AT_KEYWORDS([vtep-ctl]) | |
411 | VTEP_CTL_SETUP | |
412 | AT_CHECK([RUN_VTEP_CTL([add-lr a], [add-lr b])], [0], [], [], | |
413 | [VTEP_CTL_CLEANUP]) | |
414 | CHECK_LROUTERS([a], [b]) | |
415 | VTEP_CTL_CLEANUP | |
416 | AT_CLEANUP | |
417 | ||
418 | AT_SETUP([add-lr a, add-lr b, del-lr a]) | |
419 | AT_KEYWORDS([vtep-ctl]) | |
420 | VTEP_CTL_SETUP | |
421 | AT_CHECK([RUN_VTEP_CTL([add-lr a], [add-lr b], [del-lr a])], [0], [], [], | |
422 | [VTEP_CTL_CLEANUP]) | |
423 | CHECK_LROUTERS([b]) | |
424 | VTEP_CTL_CLEANUP | |
425 | AT_CLEANUP | |
426 | ||
427 | AT_SETUP([add-lr a, del-lr a, add-lr a]) | |
428 | AT_KEYWORDS([vtep-ctl]) | |
429 | VTEP_CTL_SETUP | |
430 | AT_CHECK([RUN_VTEP_CTL_TOGETHER( | |
431 | [add-lr a], | |
432 | [del-lr a], | |
433 | [add-lr a])], [0], [ | |
434 | ||
435 | ||
436 | ], [], [VTEP_CTL_CLEANUP]) | |
437 | CHECK_LROUTERS([a]) | |
438 | VTEP_CTL_CLEANUP | |
439 | AT_CLEANUP | |
440 | ||
ffc759c6 JP |
441 | dnl ---------------------------------------------------------------------- |
442 | AT_BANNER([vtep-ctl unit tests -- logical binding tests]) | |
443 | ||
444 | AT_SETUP([bind-ls ps1 pp1 300 ls1]) | |
445 | AT_KEYWORDS([vtep-ctl]) | |
446 | VTEP_CTL_SETUP | |
447 | AT_CHECK([RUN_VTEP_CTL( | |
448 | [add-ps ps1], | |
449 | [add-port ps1 pp1], | |
450 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
451 | CHECK_PSWITCHES([ps1]) | |
452 | CHECK_PORTS([ps1], [pp1]) | |
453 | CHECK_LSWITCHES([ls1]) | |
454 | AT_CHECK([RUN_VTEP_CTL( | |
455 | [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
456 | AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0], | |
457 | [0300 ls1 | |
458 | ], [], [VTEP_CTL_CLEANUP]) | |
459 | VTEP_CTL_CLEANUP | |
460 | AT_CLEANUP | |
461 | ||
462 | AT_SETUP([bind-ls ps1 pp1 300 ls1, bind-ls ps1 pp1 400 ls2]) | |
463 | AT_KEYWORDS([vtep-ctl]) | |
464 | VTEP_CTL_SETUP | |
465 | AT_CHECK([RUN_VTEP_CTL( | |
466 | [add-ps ps1], | |
467 | [add-port ps1 pp1], | |
468 | [add-ls ls1], | |
469 | [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
470 | CHECK_PSWITCHES([ps1]) | |
471 | CHECK_PORTS([ps1], [pp1]) | |
472 | CHECK_LSWITCHES([ls1], [ls2]) | |
473 | AT_CHECK([RUN_VTEP_CTL( | |
474 | [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
475 | AT_CHECK([RUN_VTEP_CTL( | |
476 | [bind-ls ps1 pp1 400 ls2])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
477 | AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0], | |
478 | [0300 ls1 | |
479 | 0400 ls2 | |
480 | ], [], [VTEP_CTL_CLEANUP]) | |
481 | VTEP_CTL_CLEANUP | |
482 | AT_CLEANUP | |
483 | ||
484 | AT_SETUP([bind-ls ps1 pp1 300, bind-ls ps2 pp2 300 ls2]) | |
485 | AT_KEYWORDS([vtep-ctl]) | |
486 | VTEP_CTL_SETUP | |
487 | AT_CHECK([RUN_VTEP_CTL( | |
488 | [add-ps ps1], | |
489 | [add-ps ps2], | |
490 | [add-port ps1 pp1], | |
491 | [add-port ps2 pp2], | |
492 | [add-ls ls1], | |
493 | [add-ls ls2])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
494 | CHECK_PSWITCHES([ps1], [ps2]) | |
495 | CHECK_PORTS([ps1], [pp1]) | |
496 | CHECK_PORTS([ps2], [pp2]) | |
497 | CHECK_LSWITCHES([ls1], [ls2]) | |
498 | AT_CHECK([RUN_VTEP_CTL( | |
499 | [bind-ls ps1 pp1 300 ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
500 | AT_CHECK([RUN_VTEP_CTL( | |
501 | [bind-ls ps2 pp2 300 ls2])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
502 | AT_CHECK([RUN_VTEP_CTL([list-bindings ps1 pp1])], [0], | |
503 | [0300 ls1 | |
504 | ], [], [VTEP_CTL_CLEANUP]) | |
505 | AT_CHECK([RUN_VTEP_CTL([list-bindings ps2 pp2])], [0], | |
506 | [0300 ls2 | |
507 | ], [], [VTEP_CTL_CLEANUP]) | |
508 | VTEP_CTL_CLEANUP | |
509 | AT_CLEANUP | |
510 | ||
511 | ||
512 | dnl ---------------------------------------------------------------------- | |
513 | AT_BANNER([vtep-ctl unit tests -- MAC binding tests]) | |
514 | ||
515 | AT_SETUP([add-ucast-local ls1]) | |
516 | AT_KEYWORDS([vtep-ctl]) | |
517 | VTEP_CTL_SETUP | |
518 | AT_CHECK([RUN_VTEP_CTL( | |
519 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
520 | CHECK_LSWITCHES([ls1]) | |
521 | AT_CHECK([RUN_VTEP_CTL( | |
522 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10], | |
523 | [add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11]) | |
524 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
525 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
526 | [ucast-mac-local | |
527 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
528 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
529 | ||
530 | mcast-mac-local | |
531 | ||
532 | ], [], [VTEP_CTL_CLEANUP]) | |
533 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
534 | [ucast-mac-remote | |
535 | ||
536 | mcast-mac-remote | |
537 | ||
538 | ], [], [VTEP_CTL_CLEANUP]) | |
539 | VTEP_CTL_CLEANUP | |
540 | AT_CLEANUP | |
541 | ||
542 | AT_SETUP([add-ucast-local ls1, overwrite]) | |
543 | AT_KEYWORDS([vtep-ctl]) | |
544 | VTEP_CTL_SETUP | |
545 | AT_CHECK([RUN_VTEP_CTL( | |
546 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
547 | CHECK_LSWITCHES([ls1]) | |
548 | AT_CHECK([RUN_VTEP_CTL( | |
549 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10], | |
550 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.11]) | |
551 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
552 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
553 | [ucast-mac-local | |
554 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11 | |
555 | ||
556 | mcast-mac-local | |
557 | ||
558 | ], [], [VTEP_CTL_CLEANUP]) | |
559 | VTEP_CTL_CLEANUP | |
560 | AT_CLEANUP | |
561 | ||
562 | AT_SETUP([add-ucast-local ls1, del-ucast-local ls1]) | |
563 | AT_KEYWORDS([vtep-ctl]) | |
564 | VTEP_CTL_SETUP | |
565 | AT_CHECK([RUN_VTEP_CTL( | |
566 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
567 | CHECK_LSWITCHES([ls1]) | |
568 | AT_CHECK([RUN_VTEP_CTL( | |
569 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10], | |
570 | [add-ucast-local ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11]) | |
571 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
572 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
573 | [ucast-mac-local | |
574 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
575 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
576 | ||
577 | mcast-mac-local | |
578 | ||
579 | ], [], [VTEP_CTL_CLEANUP]) | |
580 | AT_CHECK([RUN_VTEP_CTL( | |
581 | [del-ucast-local ls1 00:11:22:33:44:55]) | |
582 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
583 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
584 | [ucast-mac-local | |
585 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
586 | ||
587 | mcast-mac-local | |
588 | ||
589 | ], [], [VTEP_CTL_CLEANUP]) | |
590 | VTEP_CTL_CLEANUP | |
591 | AT_CLEANUP | |
592 | ||
593 | AT_SETUP([add-ucast-remote ls1]) | |
594 | AT_KEYWORDS([vtep-ctl]) | |
595 | VTEP_CTL_SETUP | |
596 | AT_CHECK([RUN_VTEP_CTL( | |
597 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
598 | CHECK_LSWITCHES([ls1]) | |
599 | AT_CHECK([RUN_VTEP_CTL( | |
600 | [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10], | |
601 | [add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11]) | |
602 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
603 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
604 | [ucast-mac-remote | |
605 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
606 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
607 | ||
608 | mcast-mac-remote | |
609 | ||
610 | ], [], [VTEP_CTL_CLEANUP]) | |
611 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
612 | [ucast-mac-local | |
613 | ||
614 | mcast-mac-local | |
615 | ||
616 | ], [], [VTEP_CTL_CLEANUP]) | |
617 | VTEP_CTL_CLEANUP | |
618 | AT_CLEANUP | |
619 | ||
620 | AT_SETUP([add-ucast-remote ls1, overwrite]) | |
621 | AT_KEYWORDS([vtep-ctl]) | |
622 | VTEP_CTL_SETUP | |
623 | AT_CHECK([RUN_VTEP_CTL( | |
624 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
625 | CHECK_LSWITCHES([ls1]) | |
626 | AT_CHECK([RUN_VTEP_CTL( | |
627 | [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10], | |
628 | [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.11]) | |
629 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
630 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
631 | [ucast-mac-remote | |
632 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.11 | |
633 | ||
634 | mcast-mac-remote | |
635 | ||
636 | ], [], [VTEP_CTL_CLEANUP]) | |
637 | VTEP_CTL_CLEANUP | |
638 | AT_CLEANUP | |
639 | ||
640 | AT_SETUP([add-ucast-remote ls1, del-ucast-remote ls1]) | |
641 | AT_KEYWORDS([vtep-ctl]) | |
642 | VTEP_CTL_SETUP | |
643 | AT_CHECK([RUN_VTEP_CTL( | |
644 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
645 | CHECK_LSWITCHES([ls1]) | |
646 | AT_CHECK([RUN_VTEP_CTL( | |
647 | [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10], | |
648 | [add-ucast-remote ls1 00:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11]) | |
649 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
650 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
651 | [ucast-mac-remote | |
652 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
653 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
654 | ||
655 | mcast-mac-remote | |
656 | ||
657 | ], [], [VTEP_CTL_CLEANUP]) | |
658 | AT_CHECK([RUN_VTEP_CTL( | |
659 | [del-ucast-remote ls1 00:11:22:33:44:55]) | |
660 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
661 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
662 | [ucast-mac-remote | |
663 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
664 | ||
665 | mcast-mac-remote | |
666 | ||
667 | ], [], [VTEP_CTL_CLEANUP]) | |
668 | VTEP_CTL_CLEANUP | |
669 | AT_CLEANUP | |
670 | ||
671 | AT_SETUP([add-ucast-local ls1, add-ucast-remote ls1]) | |
672 | AT_KEYWORDS([vtep-ctl]) | |
673 | VTEP_CTL_SETUP | |
674 | AT_CHECK([RUN_VTEP_CTL( | |
675 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
676 | CHECK_LSWITCHES([ls1]) | |
677 | AT_CHECK([RUN_VTEP_CTL( | |
678 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10], | |
679 | [add-ucast-local ls1 00:11:22:33:44:66 10.0.0.11], | |
680 | [add-ucast-remote ls1 02:11:22:33:44:55 10.0.0.10], | |
681 | [add-ucast-remote ls1 02:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11]) | |
682 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
683 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
684 | [ucast-mac-local | |
685 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
686 | 00:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
687 | ||
688 | mcast-mac-local | |
689 | ||
690 | ], [], [VTEP_CTL_CLEANUP]) | |
691 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
692 | [ucast-mac-remote | |
693 | 02:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
694 | 02:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
695 | ||
696 | mcast-mac-remote | |
697 | ||
698 | ], [], [VTEP_CTL_CLEANUP]) | |
699 | VTEP_CTL_CLEANUP | |
700 | AT_CLEANUP | |
701 | ||
702 | AT_SETUP([add-mcast-local ls1]) | |
703 | AT_KEYWORDS([vtep-ctl]) | |
704 | VTEP_CTL_SETUP | |
705 | AT_CHECK([RUN_VTEP_CTL( | |
706 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
707 | CHECK_LSWITCHES([ls1]) | |
708 | AT_CHECK([RUN_VTEP_CTL( | |
709 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10], | |
710 | [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
711 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12]) | |
712 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
713 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
714 | [ucast-mac-local | |
715 | ||
716 | mcast-mac-local | |
717 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
718 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
719 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
720 | ||
721 | ], [], [VTEP_CTL_CLEANUP]) | |
722 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
723 | [ucast-mac-remote | |
724 | ||
725 | mcast-mac-remote | |
726 | ||
727 | ], [], [VTEP_CTL_CLEANUP]) | |
728 | VTEP_CTL_CLEANUP | |
729 | AT_CLEANUP | |
730 | ||
731 | AT_SETUP([add-mcast-local ls1, del-mcast-local ls1]) | |
732 | AT_KEYWORDS([vtep-ctl]) | |
733 | VTEP_CTL_SETUP | |
734 | AT_CHECK([RUN_VTEP_CTL( | |
735 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
736 | CHECK_LSWITCHES([ls1]) | |
737 | AT_CHECK([RUN_VTEP_CTL( | |
738 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10], | |
739 | [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
740 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12], | |
741 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.13]) | |
742 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
743 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
744 | [ucast-mac-local | |
745 | ||
746 | mcast-mac-local | |
747 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
748 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
749 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 | |
750 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
751 | ||
752 | ], [], [VTEP_CTL_CLEANUP]) | |
753 | AT_CHECK([RUN_VTEP_CTL( | |
754 | [del-mcast-local ls1 01:11:22:33:44:55 10.0.0.12]) | |
755 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
756 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
757 | [ucast-mac-local | |
758 | ||
759 | mcast-mac-local | |
760 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
761 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 | |
762 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
763 | ||
764 | ], [], [VTEP_CTL_CLEANUP]) | |
765 | VTEP_CTL_CLEANUP | |
766 | AT_CLEANUP | |
767 | ||
768 | AT_SETUP([add-mcast-remote ls1]) | |
769 | AT_KEYWORDS([vtep-ctl]) | |
770 | VTEP_CTL_SETUP | |
771 | AT_CHECK([RUN_VTEP_CTL( | |
772 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
773 | CHECK_LSWITCHES([ls1]) | |
774 | AT_CHECK([RUN_VTEP_CTL( | |
775 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10], | |
776 | [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
777 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12]) | |
778 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
779 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
780 | [ucast-mac-remote | |
781 | ||
782 | mcast-mac-remote | |
783 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
784 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
785 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
786 | ||
787 | ], [], [VTEP_CTL_CLEANUP]) | |
788 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
789 | [ucast-mac-local | |
790 | ||
791 | mcast-mac-local | |
792 | ||
793 | ], [], [VTEP_CTL_CLEANUP]) | |
794 | VTEP_CTL_CLEANUP | |
795 | AT_CLEANUP | |
796 | ||
797 | AT_SETUP([add-mcast-remote ls1, del-mcast-remote ls1]) | |
798 | AT_KEYWORDS([vtep-ctl]) | |
799 | VTEP_CTL_SETUP | |
800 | AT_CHECK([RUN_VTEP_CTL( | |
801 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
802 | CHECK_LSWITCHES([ls1]) | |
803 | AT_CHECK([RUN_VTEP_CTL( | |
804 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10], | |
805 | [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
806 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12], | |
807 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.13]) | |
808 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
809 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
810 | [ucast-mac-remote | |
811 | ||
812 | mcast-mac-remote | |
813 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
814 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
815 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 | |
816 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
817 | ||
818 | ], [], [VTEP_CTL_CLEANUP]) | |
819 | AT_CHECK([RUN_VTEP_CTL( | |
820 | [del-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12]) | |
821 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
822 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
823 | [ucast-mac-remote | |
824 | ||
825 | mcast-mac-remote | |
826 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
827 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.13 | |
828 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
829 | ||
830 | ], [], [VTEP_CTL_CLEANUP]) | |
831 | VTEP_CTL_CLEANUP | |
832 | AT_CLEANUP | |
833 | ||
834 | AT_SETUP([add-mcast-local ls1, add-mcast-remote ls1]) | |
835 | AT_KEYWORDS([vtep-ctl]) | |
836 | VTEP_CTL_SETUP | |
837 | AT_CHECK([RUN_VTEP_CTL( | |
838 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
839 | CHECK_LSWITCHES([ls1]) | |
840 | AT_CHECK([RUN_VTEP_CTL( | |
841 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10], | |
842 | [add-mcast-local ls1 01:11:22:33:44:66 10.0.0.11], | |
843 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12], | |
844 | [add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.10], | |
845 | [add-mcast-remote ls1 03:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
846 | [add-mcast-remote ls1 03:11:22:33:44:55 10.0.0.12]) | |
847 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
848 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
849 | [ucast-mac-local | |
850 | ||
851 | mcast-mac-local | |
852 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
853 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
854 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
855 | ||
856 | ], [], [VTEP_CTL_CLEANUP]) | |
857 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
858 | [ucast-mac-remote | |
859 | ||
860 | mcast-mac-remote | |
861 | 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
862 | 03:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
863 | 03:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
864 | ||
865 | ], [], [VTEP_CTL_CLEANUP]) | |
866 | VTEP_CTL_CLEANUP | |
867 | AT_CLEANUP | |
868 | ||
869 | AT_SETUP([add local and remote macs, clear-local-macs]) | |
870 | AT_KEYWORDS([vtep-ctl]) | |
871 | VTEP_CTL_SETUP | |
872 | AT_CHECK([RUN_VTEP_CTL( | |
873 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
874 | CHECK_LSWITCHES([ls1]) | |
875 | AT_CHECK([RUN_VTEP_CTL( | |
876 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10], | |
877 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10], | |
878 | [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
879 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12], | |
880 | [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10], | |
881 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10], | |
882 | [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
883 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12]) | |
884 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
885 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
886 | [ucast-mac-local | |
887 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
888 | ||
889 | mcast-mac-local | |
890 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
891 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
892 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
893 | ||
894 | ], [], [VTEP_CTL_CLEANUP]) | |
895 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
896 | [ucast-mac-remote | |
897 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
898 | ||
899 | mcast-mac-remote | |
900 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
901 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
902 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
903 | ||
904 | ], [], [VTEP_CTL_CLEANUP]) | |
905 | AT_CHECK([RUN_VTEP_CTL( | |
906 | [clear-local-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
907 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
908 | [ucast-mac-local | |
909 | ||
910 | mcast-mac-local | |
911 | ||
912 | ], [], [VTEP_CTL_CLEANUP]) | |
913 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
914 | [ucast-mac-remote | |
915 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
916 | ||
917 | mcast-mac-remote | |
918 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
919 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
920 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
921 | ||
922 | ], [], [VTEP_CTL_CLEANUP]) | |
923 | VTEP_CTL_CLEANUP | |
924 | AT_CLEANUP | |
925 | ||
926 | AT_SETUP([add local and remote macs, clear-remote-macs]) | |
927 | AT_KEYWORDS([vtep-ctl]) | |
928 | VTEP_CTL_SETUP | |
929 | AT_CHECK([RUN_VTEP_CTL( | |
930 | [add-ls ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
931 | CHECK_LSWITCHES([ls1]) | |
932 | AT_CHECK([RUN_VTEP_CTL( | |
933 | [add-ucast-local ls1 00:11:22:33:44:55 10.0.0.10], | |
934 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.10], | |
935 | [add-mcast-local ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
936 | [add-mcast-local ls1 01:11:22:33:44:55 10.0.0.12], | |
937 | [add-ucast-remote ls1 00:11:22:33:44:55 10.0.0.10], | |
938 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.10], | |
939 | [add-mcast-remote ls1 01:11:22:33:44:66 vxlan_over_ipv4 10.0.0.11], | |
940 | [add-mcast-remote ls1 01:11:22:33:44:55 10.0.0.12]) | |
941 | ], [0], [], [], [VTEP_CTL_CLEANUP]) | |
942 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
943 | [ucast-mac-local | |
944 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
945 | ||
946 | mcast-mac-local | |
947 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
948 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
949 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
950 | ||
951 | ], [], [VTEP_CTL_CLEANUP]) | |
952 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
953 | [ucast-mac-remote | |
954 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
955 | ||
956 | mcast-mac-remote | |
957 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
958 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
959 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
960 | ||
961 | ], [], [VTEP_CTL_CLEANUP]) | |
962 | AT_CHECK([RUN_VTEP_CTL( | |
963 | [clear-remote-macs ls1])], [0], [], [], [VTEP_CTL_CLEANUP]) | |
964 | AT_CHECK([RUN_VTEP_CTL([list-local-macs ls1])], [0], | |
965 | [ucast-mac-local | |
966 | 00:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
967 | ||
968 | mcast-mac-local | |
969 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.10 | |
970 | 01:11:22:33:44:55 -> vxlan_over_ipv4/10.0.0.12 | |
971 | 01:11:22:33:44:66 -> vxlan_over_ipv4/10.0.0.11 | |
972 | ||
973 | ], [], [VTEP_CTL_CLEANUP]) | |
974 | AT_CHECK([RUN_VTEP_CTL([list-remote-macs ls1])], [0], | |
975 | [ucast-mac-remote | |
976 | ||
977 | mcast-mac-remote | |
978 | ||
979 | ], [], [VTEP_CTL_CLEANUP]) | |
980 | VTEP_CTL_CLEANUP | |
981 | AT_CLEANUP | |
982 | ||
983 | dnl ---------------------------------------------------------------------- | |
984 | AT_BANNER([vtep-ctl unit tests -- manager commands]) | |
985 | ||
986 | AT_SETUP([managers]) | |
987 | AT_KEYWORDS([manager vtep-ctl]) | |
988 | VTEP_CTL_SETUP | |
989 | AT_CHECK([RUN_VTEP_CTL_TOGETHER( | |
990 | [del-manager], | |
991 | [get-manager], | |
992 | [set-manager tcp:4.5.6.7], | |
993 | [get-manager], | |
994 | [set-manager tcp:8.9.10.11 tcp:5.4.3.2], | |
995 | [get-manager], | |
3ffed5cb GL |
996 | [--inactivity-probe=30000 set-manager tcp:1.2.3.4], |
997 | [get-manager], | |
ffc759c6 JP |
998 | [del-manager], |
999 | [get-manager])], [0], [ | |
1000 | ||
1001 | ||
1002 | tcp:4.5.6.7 | |
1003 | ||
1004 | tcp:5.4.3.2\ntcp:8.9.10.11 | |
1005 | ||
3ffed5cb GL |
1006 | tcp:1.2.3.4 |
1007 | ||
ffc759c6 JP |
1008 | |
1009 | ], [], [VTEP_CTL_CLEANUP]) | |
1010 | VTEP_CTL_CLEANUP | |
1011 | AT_CLEANUP | |
3935f67d AW |
1012 | |
1013 | AT_SETUP([show command]) | |
1014 | AT_KEYWORDS([vtep-ctl show]) | |
1015 | VTEP_CTL_SETUP | |
1016 | AT_CHECK([RUN_VTEP_CTL( | |
1017 | [set-manager tcp:4.5.6.7], | |
1018 | [add-ps a], | |
1019 | [add-port a a1], | |
1020 | [add-ls ls1], | |
1021 | [bind-ls a a1 100 ls1], | |
31d2b7c0 | 1022 | [set Physical_Switch a management_ips=[[4.3.2.1]] tunnel_ips=[[1.2.3.4]]])], [0], [ignore], [], [VTEP_CTL_CLEANUP]) |
3935f67d | 1023 | |
15394e0f | 1024 | AT_CHECK([vtep-ctl -vreconnect:emer --db=unix:socket show | tail -n+2 | sed 's/=[[a-f0-9-]][[a-f0-9-]]*}/=<ls>}/' ], [0], [dnl |
3935f67d AW |
1025 | Manager "tcp:4.5.6.7" |
1026 | Physical_Switch a | |
31d2b7c0 | 1027 | management_ips: [["4.3.2.1"]] |
3935f67d | 1028 | tunnel_ips: [["1.2.3.4"]] |
29004db2 | 1029 | Physical_Port a1 |
31d2b7c0 | 1030 | vlan_bindings: |
29004db2 | 1031 | 100=ls1 |
3935f67d AW |
1032 | ], [], [VTEP_CTL_CLEANUP]) |
1033 | ||
1034 | VTEP_CTL_CLEANUP | |
1035 | AT_CLEANUP |