]> git.proxmox.com Git - ovs.git/blob - tests/ovsdb-monitor.at
raft: Fix the problem of stuck in candidate role forever.
[ovs.git] / tests / ovsdb-monitor.at
1 AT_BANNER([OVSDB -- ovsdb-server monitors])
2
3 OVS_START_SHELL_HELPERS
4 # ovsdb_check_monitor SCHEMA_FUNC DB TABLE OUTPUT COLUMNS
5 # PRE-MONITOR-TXN... -- TRANSACTION...
6 ovsdb_check_monitor () {
7 local schema_func=$1 db=$2 table=$3 output=$4 columns=$5
8 shift; shift; shift; shift; shift
9 $schema_func > schema
10 AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
11 while test "$1" != "--"; do
12 AT_CHECK([ovsdb-tool transact db "$1"], [0], [ignore], [ignore])
13 shift
14 done
15 shift
16 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file db > ovsdb-server.stdout 2> ovsdb-server.stderr],
17 [0], [], [])
18 on_exit 'kill `cat ovsdb-server.pid`'
19 if test "$IS_WIN32" = "yes"; then
20 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --log-file -d json monitor --format=csv unix:socket $db $table $columns > output 2> ovsdb-client.stderr &],
21 [0], [ignore], [ignore])
22 sleep 1
23 else
24 AT_CHECK([ovsdb-client -vjsonrpc --detach --no-chdir --pidfile --log-file -d json monitor --format=csv unix:socket $db $table $columns > output 2> ovsdb-client.stderr],
25 [0], [ignore], [ignore])
26 fi
27 on_exit 'kill `cat ovsdb-client.pid`'
28 for txn in ${1+"$@"} '[["'$db'"]]'; do
29 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
30 done
31 OVS_APP_EXIT_AND_WAIT_BY_TARGET([ovsdb-server], [ovsdb-server.pid])
32 OVS_WAIT_UNTIL([test ! -e ovsdb-client.pid])
33 AT_CHECK_UNQUOTED([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [$output], [ignore])
34 }
35 OVS_END_SHELL_HELPERS
36
37 # OVSDB_CHECK_MONITOR(TITLE, SCHEMA, [PRE-MONITOR-TXN], DB, TABLE,
38 # TRANSACTIONS, OUTPUT, [COLUMNS], [KEYWORDS])
39 #
40 # Creates a database with the given SCHEMA, starts an ovsdb-server on
41 # that database, and runs each of the TRANSACTIONS (which should be a
42 # quoted list of quoted strings) against it with ovsdb-client one at a
43 # time. COLUMNS, if specified, is passed to ovsdb-client as the set
44 # of columns and operations to select.
45 #
46 # Checks that the overall output is OUTPUT, but UUIDs in the output
47 # are replaced by markers of the form <N> where N is a number. The
48 # first unique UUID is replaced by <0>, the next by <1>, and so on.
49 # If a given UUID appears more than once it is always replaced by the
50 # same marker.
51 #
52 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
53 m4_define([OVSDB_CHECK_MONITOR],
54 [AT_SETUP([$1])
55 AT_KEYWORDS([ovsdb server monitor positive $9])
56 AT_CAPTURE_FILE([ovsdb-server.log])
57 AT_CAPTURE_FILE([ovsdb-server.stdout])
58 AT_CAPTURE_FILE([ovsdb-server.stderr])
59 AT_CAPTURE_FILE([ovsdb-client.log])
60 AT_CAPTURE_FILE([ovsdb-client.stderr])
61 ovsdb_check_monitor '$2' '$4' '$5' '$7' '$8' \
62 m4_foreach([txn], [$3], ['txn' ]) -- \
63 m4_foreach([txn], [$6], ['txn' ])
64 AT_CLEANUP])
65
66 # OVSDB_CHECK_MONITOR_COND(TITLE, SCHEMA, [PRE-MONITOR-TXN], DB, TABLE,
67 # TRANSACTIONS, OUTPUT, CONDITIONS, [COLUMNS], [KEYWORDS],
68 # [CONDITIONS_CHANGE])
69 #
70 # Creates a database with the given SCHEMA, starts an ovsdb-server on
71 # that database, and runs each of the TRANSACTIONS (which should be a
72 # quoted list of quoted strings) against it with ovsdb-client one at a
73 # time. COLUMNS, if specified, is passed to ovsdb-client as the set
74 # of columns and operations to select.
75 #
76 # Checks that the overall output is OUTPUT, but UUIDs in the output
77 # are replaced by markers of the form <N> where N is a number. The
78 # first unique UUID is replaced by <0>, the next by <1>, and so on.
79 # If a given UUID appears more than once it is always replaced by the
80 # same marker.
81 #
82 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
83 m4_define([OVSDB_CHECK_MONITOR_COND],
84 [AT_SETUP([$1])
85 AT_KEYWORDS([ovsdb server monitor monitor-cond positive $10])
86 $2 > schema
87 AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
88 for txn in m4_foreach([txn], [$3], ['txn' ]); do
89 AT_CHECK([ovsdb-tool transact db "$txn"], [0], [ignore], [ignore])
90 done
91 AT_CAPTURE_FILE([ovsdb-server-log])
92 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
93 on_exit 'kill `cat ovsdb-server.pid`'
94 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond --format=csv unix:socket $4 '[$8]' $5 $9 > output],
95 [0], [ignore], [ignore])
96 on_exit 'kill `cat ovsdb-client.pid`'
97 for txn in m4_foreach([txn], [$6], ['txn' ]); do
98 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0],
99 [ignore], [ignore], [kill `cat server-pid client-pid`])
100 done
101 for cond in m4_foreach([cond], [$10], ['cond' ]); do
102 AT_CHECK([ovs-appctl -t ovsdb-client ovsdb-client/cond_change $5 "$cond"], [0], [ignore], [ignore])
103 done
104 AT_CHECK([ovsdb-client transact unix:socket '[["$4"]]'], [0],
105 [ignore], [ignore])
106 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
107 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
108 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [$7], [ignore])
109 AT_CLEANUP])
110
111 OVSDB_CHECK_MONITOR([monitor insert into empty table],
112 [ordinal_schema],
113 [],
114 [ordinals], [ordinals],
115 [[[["ordinals",
116 {"op": "insert",
117 "table": "ordinals",
118 "row": {"number": 0, "name": "zero"}}]]]],
119 [[row,action,name,number,_version
120 <0>,insert,"""zero""",0,"[""uuid"",""<1>""]"
121 ]])
122
123 OVSDB_CHECK_MONITOR([monitor insert into populated table],
124 [ordinal_schema],
125 [[[["ordinals",
126 {"op": "insert",
127 "table": "ordinals",
128 "row": {"number": 10, "name": "ten"}}]]]],
129 [ordinals], [ordinals],
130 [[[["ordinals",
131 {"op": "insert",
132 "table": "ordinals",
133 "row": {"number": 0, "name": "zero"}}]]]],
134 [[row,action,name,number,_version
135 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
136
137 row,action,name,number,_version
138 <2>,insert,"""zero""",0,"[""uuid"",""<3>""]"
139 ]])
140
141 OVSDB_CHECK_MONITOR([monitor delete],
142 [ordinal_schema],
143 [[[["ordinals",
144 {"op": "insert",
145 "table": "ordinals",
146 "row": {"number": 10, "name": "ten"}}]]]],
147 [ordinals], [ordinals],
148 [[[["ordinals",
149 {"op": "delete",
150 "table": "ordinals",
151 "where": [["number", "==", 10]]}]]]],
152 [[row,action,name,number,_version
153 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
154
155 row,action,name,number,_version
156 <0>,delete,"""ten""",10,"[""uuid"",""<1>""]"
157 ]])
158
159 OVSDB_CHECK_MONITOR([monitor row update],
160 [ordinal_schema],
161 [[[["ordinals",
162 {"op": "insert",
163 "table": "ordinals",
164 "row": {"number": 10, "name": "ten"}}]]]],
165 [ordinals], [ordinals],
166 [[[["ordinals",
167 {"op": "update",
168 "table": "ordinals",
169 "where": [["number", "==", 10]],
170 "row": {"name": "five plus five"}}]]]],
171 [[row,action,name,number,_version
172 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
173
174 row,action,name,number,_version
175 <0>,old,"""ten""",,"[""uuid"",""<1>""]"
176 ,new,"""five plus five""",10,"[""uuid"",""<2>""]"
177 ]])
178
179 OVSDB_CHECK_MONITOR([monitor no-op row updates],
180 [ordinal_schema],
181 [[[["ordinals",
182 {"op": "insert",
183 "table": "ordinals",
184 "row": {"number": 10, "name": "ten"}}]]]],
185 [ordinals], [ordinals],
186 [[[["ordinals",
187 {"op": "update",
188 "table": "ordinals",
189 "where": [["number", "==", 10]],
190 "row": {"number": 10, "name": "ten"}}]]],
191 [[["ordinals",
192 {"op": "insert",
193 "table": "ordinals",
194 "row": {"number": 9, "name": "nine"}}]]]],
195 [[row,action,name,number,_version
196 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
197
198 row,action,name,number,_version
199 <2>,insert,"""nine""",9,"[""uuid"",""<3>""]"
200 ]])
201
202 OVSDB_CHECK_MONITOR([monitor insert-and-update transaction],
203 [ordinal_schema],
204 [[[["ordinals",
205 {"op": "insert",
206 "table": "ordinals",
207 "row": {"number": 10, "name": "ten"}}]]]],
208 [ordinals], [ordinals],
209 [[[["ordinals",
210 {"op": "insert",
211 "table": "ordinals",
212 "row": {"number": 9, "name": "nine"},
213 "uuid-name": "nine"},
214 {"op": "update",
215 "table": "ordinals",
216 "where": [["_uuid", "==", ["named-uuid", "nine"]]],
217 "row": {"name": "three squared"}}]]]],
218 [[row,action,name,number,_version
219 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
220
221 row,action,name,number,_version
222 <2>,insert,"""three squared""",9,"[""uuid"",""<3>""]"
223 ]])
224
225 OVSDB_CHECK_MONITOR([monitor insert-update-and-delete transaction],
226 [ordinal_schema],
227 [[[["ordinals",
228 {"op": "insert",
229 "table": "ordinals",
230 "row": {"number": 10, "name": "ten"}}]]]],
231 [ordinals], [ordinals],
232 [[[["ordinals",
233 {"op": "insert",
234 "table": "ordinals",
235 "row": {"number": 9, "name": "nine"},
236 "uuid-name": "nine"},
237 {"op": "update",
238 "table": "ordinals",
239 "where": [["_uuid", "==", ["named-uuid", "nine"]]],
240 "row": {"name": "three squared"}},
241 {"op": "delete",
242 "table": "ordinals",
243 "where": [["_uuid", "==", ["named-uuid", "nine"]]]},
244 {"op": "insert",
245 "table": "ordinals",
246 "row": {"number": 7, "name": "seven"}}]]]],
247 [[row,action,name,number,_version
248 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
249
250 row,action,name,number,_version
251 <2>,insert,"""seven""",7,"[""uuid"",""<3>""]"
252 ]])
253
254 OVSDB_CHECK_MONITOR([monitor weak reference change],
255 [weak_schema],
256 [[[["weak",
257 {"op": "insert",
258 "table": "a",
259 "row": {"a": 0,
260 "a2a1": ["named-uuid", "a0"],
261 "a2b": ["named-uuid", "b2"]},
262 "uuid-name": "a0"},
263 {"op": "insert",
264 "table": "a",
265 "row": {"a": 1,
266 "a2a": ["named-uuid", "a0"],
267 "a2a1": ["named-uuid", "a1"],
268 "a2b": ["named-uuid", "b2"]},
269 "uuid-name": "a1"},
270 {"op": "insert",
271 "table": "b",
272 "row": {"b": 2},
273 "uuid-name": "b2"}]]]],
274 [weak], [a],
275 [[[["weak",
276 {"op": "delete",
277 "table": "a",
278 "where": [["a", "==", 0]]}]]]],
279 [[row,action,a,a2a,a2a1,a2b,_version
280 <0>,initial,0,"[""set"",[]]","[""uuid"",""<0>""]","[""uuid"",""<1>""]","[""uuid"",""<2>""]"
281 <3>,initial,1,"[""uuid"",""<0>""]","[""uuid"",""<3>""]","[""uuid"",""<1>""]","[""uuid"",""<4>""]"
282
283 row,action,a,a2a,a2a1,a2b,_version
284 <0>,delete,0,"[""set"",[]]","[""uuid"",""<0>""]","[""uuid"",""<1>""]","[""uuid"",""<2>""]"
285 <3>,old,,"[""uuid"",""<0>""]",,,"[""uuid"",""<4>""]"
286 ,new,1,"[""set"",[]]","[""uuid"",""<3>""]","[""uuid"",""<1>""]","[""uuid"",""<5>""]"
287 ]])
288
289 OVSDB_CHECK_MONITOR([monitor insert-update-and-delete transaction],
290 [ordinal_schema],
291 [[[["ordinals",
292 {"op": "insert",
293 "table": "ordinals",
294 "row": {"number": 10, "name": "ten"}}]]]],
295 [ordinals], [ordinals],
296 [[[["ordinals",
297 {"op": "insert",
298 "table": "ordinals",
299 "row": {"number": 9, "name": "nine"},
300 "uuid-name": "nine"},
301 {"op": "update",
302 "table": "ordinals",
303 "where": [["_uuid", "==", ["named-uuid", "nine"]]],
304 "row": {"name": "three squared"}},
305 {"op": "delete",
306 "table": "ordinals",
307 "where": [["_uuid", "==", ["named-uuid", "nine"]]]},
308 {"op": "insert",
309 "table": "ordinals",
310 "row": {"number": 7, "name": "seven"}}]]]],
311 [[row,action,name,number,_version
312 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
313
314 row,action,name,number,_version
315 <2>,insert,"""seven""",7,"[""uuid"",""<3>""]"
316 ]])
317 \f
318 AT_BANNER([ovsdb -- ovsdb-monitor monitor only some operations])
319
320 m4_define([OVSDB_MONITOR_INITIAL],
321 [[[["ordinals",
322 {"op": "insert",
323 "table": "ordinals",
324 "row": {"number": 10, "name": "ten"}}]]]])
325 m4_define([OVSDB_MONITOR_TXNS],
326 [[[["ordinals",
327 {"op": "insert",
328 "table": "ordinals",
329 "row": {"number": 5, "name": "five"}}]]],
330 [[["ordinals",
331 {"op": "update",
332 "table": "ordinals",
333 "where": [["name", "==", "five"]],
334 "row": {"name": "FIVE"}}]]],
335 [[["ordinals",
336 {"op": "delete",
337 "table": "ordinals",
338 "where": []}]]]])
339
340 OVSDB_CHECK_MONITOR([monitor all operations],
341 [ordinal_schema], [OVSDB_MONITOR_INITIAL],
342 [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
343 [[row,action,name,number,_version
344 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
345
346 row,action,name,number,_version
347 <2>,insert,"""five""",5,"[""uuid"",""<3>""]"
348
349 row,action,name,number,_version
350 <2>,old,"""five""",,"[""uuid"",""<3>""]"
351 ,new,"""FIVE""",5,"[""uuid"",""<4>""]"
352
353 row,action,name,number,_version
354 <2>,delete,"""FIVE""",5,"[""uuid"",""<4>""]"
355 <0>,delete,"""ten""",10,"[""uuid"",""<1>""]"
356 ]])
357
358 dnl A monitor with "initial" only doesn't really make sense,
359 dnl but it's still allowed and should work.
360 OVSDB_CHECK_MONITOR([monitor initial only],
361 [ordinal_schema], [OVSDB_MONITOR_INITIAL],
362 [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
363 [[row,action,name,number,_version
364 <0>,initial,"""ten""",10,"[""uuid"",""<1>""]"
365 ]], [!insert,!delete,!modify])
366
367 OVSDB_CHECK_MONITOR([monitor insert only],
368 [ordinal_schema], [OVSDB_MONITOR_INITIAL],
369 [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
370 [[row,action,name,number,_version
371 <0>,insert,"""five""",5,"[""uuid"",""<1>""]"
372 ]], [!initial,!delete,!modify])
373
374 OVSDB_CHECK_MONITOR([monitor delete only],
375 [ordinal_schema], [OVSDB_MONITOR_INITIAL],
376 [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
377 [[row,action,name,number,_version
378 <0>,delete,"""FIVE""",5,"[""uuid"",""<1>""]"
379 <2>,delete,"""ten""",10,"[""uuid"",""<3>""]"
380 ]], [!initial,!insert,!modify])
381
382 OVSDB_CHECK_MONITOR([monitor modify only],
383 [ordinal_schema], [OVSDB_MONITOR_INITIAL],
384 [ordinals], [ordinals], [OVSDB_MONITOR_TXNS],
385 [[row,action,name,number,_version
386 <0>,old,"""five""",,"[""uuid"",""<1>""]"
387 ,new,"""FIVE""",5,"[""uuid"",""<2>""]"
388 ]], [!initial,!insert,!delete])
389
390 AT_BANNER([ovsdb -- ovsdb-monitor-cond conditional monitor only some operations])
391
392 OVSDB_CHECK_MONITOR_COND([monitor-cond empty condition],
393 [ordinal_schema],
394 [[[["ordinals",
395 {"op": "insert",
396 "table": "ordinals",
397 "row": {"number": 0, "name": "zero"}},
398 {"op": "insert",
399 "table": "ordinals",
400 "row": {"number": 1, "name": "one"}},
401 {"op": "insert",
402 "table": "ordinals",
403 "row": {"number": 2, "name": "two"}}]]]],
404 [ordinals], [ordinals],
405 [[[["ordinals",
406 {"op": "insert",
407 "table": "ordinals",
408 "row": {"number": 10, "name": "ten"}},
409 {"op": "insert",
410 "table": "ordinals",
411 "row": {"number": 11, "name": "eleven"}}]]]],
412 [[row,action,name,number,_version
413 <0>,initial,"""one""",1,"[""uuid"",""<1>""]"
414 <2>,initial,"""two""",2,"[""uuid"",""<3>""]"
415 <4>,initial,"""zero""",,"[""uuid"",""<5>""]"
416
417 row,action,name,number,_version
418 <6>,insert,"""eleven""",11,"[""uuid"",""<7>""]"
419 <8>,insert,"""ten""",10,"[""uuid"",""<9>""]"
420 ]],
421 [[]])
422
423 OVSDB_CHECK_MONITOR_COND([monitor-cond multiple conditions],
424 [ordinal_schema],
425 [[[["ordinals",
426 {"op": "insert",
427 "table": "ordinals",
428 "row": {"number": 0, "name": "zero"}},
429 {"op": "insert",
430 "table": "ordinals",
431 "row": {"number": 1, "name": "one"}},
432 {"op": "insert",
433 "table": "ordinals",
434 "row": {"number": 2, "name": "two"}}]]]],
435 [ordinals], [ordinals],
436 [[[["ordinals",
437 {"op": "insert",
438 "table": "ordinals",
439 "row": {"number": 10, "name": "ten"}},
440 {"op": "insert",
441 "table": "ordinals",
442 "row": {"number": 11, "name": "eleven"}}]]]],
443 [[row,action,name,number,_version
444 <0>,initial,"""one""",1,"[""uuid"",""<1>""]"
445
446 row,action,name,number,_version
447 <2>,insert,"""ten""",10,"[""uuid"",""<3>""]"
448 ]],
449 [[["name","==","one"],["name","==","ten"]]])
450
451 OVSDB_CHECK_MONITOR_COND([monitor-cond delete from populated table],
452 [ordinal_schema],
453 [[[["ordinals",
454 {"op": "insert",
455 "table": "ordinals",
456 "row": {"number": 0, "name": "zero"}},
457 {"op": "insert",
458 "table": "ordinals",
459 "row": {"number": 1, "name": "one"}},
460 {"op": "insert",
461 "table": "ordinals",
462 "row": {"number": 2, "name": "two"}}]]]],
463 [ordinals], [ordinals],
464 [[[["ordinals",
465 {"op": "delete",
466 "table": "ordinals",
467 "where": []}]]]],
468 [[row,action,name,number,_version
469 <0>,initial,"""one""",1,"[""uuid"",""<1>""]"
470
471 row,action,name,number,_version
472 <0>,delete,,,
473 ]],
474 [[["name","==","one"],["name","==","ten"]]])
475
476 OVSDB_CHECK_MONITOR_COND([monitor-cond insert due to modify],
477 [ordinal_schema],
478 [[[["ordinals",
479 {"op": "insert",
480 "table": "ordinals",
481 "row": {"number": 0, "name": "zero"}},
482 {"op": "insert",
483 "table": "ordinals",
484 "row": {"number": 1, "name": "one"}},
485 {"op": "insert",
486 "table": "ordinals",
487 "row": {"number": 2, "name": "two"}}]]]],
488 [ordinals], [ordinals],
489 [[[["ordinals",
490 {"op": "update",
491 "table": "ordinals",
492 "where": [["name", "==", "one"]],
493 "row": {"name": "ONE"}}]]]],
494 [[row,action,name,number,_version
495 <0>,insert,"""ONE""",1,"[""uuid"",""<1>""]"
496 ]],
497 [[["name","==","ONE"]]],
498 [!initial,!delete,!modify])
499
500 OVSDB_CHECK_MONITOR_COND([monitor-cond delete due to modify],
501 [ordinal_schema],
502 [[[["ordinals",
503 {"op": "insert",
504 "table": "ordinals",
505 "row": {"number": 0, "name": "zero"}},
506 {"op": "insert",
507 "table": "ordinals",
508 "row": {"number": 1, "name": "one"}},
509 {"op": "insert",
510 "table": "ordinals",
511 "row": {"number": 2, "name": "two"}}]]]],
512 [ordinals], [ordinals],
513 [[[["ordinals",
514 {"op": "update",
515 "table": "ordinals",
516 "where": [["name", "==", "one"]],
517 "row": {"name": "ONE"}}]]]],
518 [[row,action,name,number,_version
519 <0>,delete,,,
520 ]],
521 [[["name","==","one"]]],
522 [!initial,!insert,!modify])
523
524 OVSDB_CHECK_MONITOR_COND([monitor-cond condition non-monitored columns],
525 [ordinal_schema],
526 [[[["ordinals",
527 {"op": "insert",
528 "table": "ordinals",
529 "row": {"number": 0, "name": "zero"}},
530 {"op": "insert",
531 "table": "ordinals",
532 "row": {"number": 1, "name": "one"}},
533 {"op": "insert",
534 "table": "ordinals",
535 "row": {"number": 2, "name": "two"}}]]]],
536 [ordinals], [ordinals],
537 [[[["ordinals",
538 {"op": "insert",
539 "table": "ordinals",
540 "row": {"number": 10, "name": "ten"}},
541 {"op": "insert",
542 "table": "ordinals",
543 "row": {"number": 11, "name": "eleven"}}]]]],
544 [[row,action,number
545 <0>,initial,1
546
547 row,action,number
548 <1>,insert,10
549 ]],
550 [[["name","==","one"],["name","==","ten"]]],
551 ["number"])
552
553 OVSDB_CHECK_MONITOR_COND([monitor-cond-change],
554 [ordinal_schema],
555 [[[["ordinals",
556 {"op": "insert",
557 "table": "ordinals",
558 "row": {"number": 0, "name": "zero"}},
559 {"op": "insert",
560 "table": "ordinals",
561 "row": {"number": 1, "name": "one"}},
562 {"op": "insert",
563 "table": "ordinals",
564 "row": {"number": 2, "name": "two"}}]]]],
565 [ordinals], [ordinals],
566 [],
567 [[row,action,name,number,_version
568 <0>,initial,"""one""",1,"[""uuid"",""<1>""]"
569 <2>,initial,"""two""",2,"[""uuid"",""<3>""]"
570 <4>,initial,"""zero""",,"[""uuid"",""<5>""]"
571
572 row,action,name,number,_version
573 <4>,delete,,,
574
575 row,action,name,number,_version
576 <2>,delete,,,
577
578 row,action,name,number,_version
579 <0>,delete,,,
580
581 row,action,name,number,_version
582 <0>,insert,"""one""",1,"[""uuid"",""<1>""]"
583 <2>,insert,"""two""",2,"[""uuid"",""<3>""]"
584 <4>,insert,"""zero""",,"[""uuid"",""<5>""]"
585 ]],
586 [[]],
587 [],
588 [[[[["name","==","one"],["name","==","two"]]]],
589 [[[["name","==","one"]]]],
590 [[[false]]],
591 [[[true]]]])
592
593
594 AT_SETUP(monitor-cond-change with many sessions pending)
595 AT_KEYWORDS([ovsdb server monitor monitor-cond negative])
596 ordinal_schema > schema
597 AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
598 AT_CAPTURE_FILE([ovsdb-server-log])
599
600 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
601 on_exit 'kill `cat ovsdb-server.pid`'
602 for txn in m4_foreach([txn], [[[["ordinals",
603 {"op": "insert",
604 "table": "ordinals",
605 "row": {"number": 0, "name": "zero"}},
606 {"op": "insert",
607 "table": "ordinals",
608 "row": {"number": 1, "name": "one"}},
609 {"op": "insert",
610 "table": "ordinals",
611 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
612 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
613 done
614
615 # 1001 clients monitoring column "name" and with condition for "name" only.
616 # The clients are created in a way that the 991th client will request condition
617 # change, so that the chance is high that the condition change will be handled
618 # before some pending changes are freed.
619
620 cond='[[["name","==","ten"]]]'
621 for i in `seq 1 990`; do
622 AT_CHECK([ovsdb-client -vjsonrpc --pidfile=ovsdb-client$i.pid --detach --no-chdir -d json monitor-cond --format=csv unix:socket ordinals $cond ordinals ["name"]], [0], [ignore], [ignore])
623 done
624
625 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond --format=csv unix:socket ordinals $cond ordinals ["name"] > output],
626 [0], [ignore], [ignore])
627
628 for i in `seq 991 1000`; do
629 AT_CHECK([ovsdb-client -vjsonrpc --pidfile=ovsdb-client$i.pid --detach --no-chdir -d json monitor-cond --format=csv unix:socket ordinals $cond ordinals ["name"]], [0], [ignore], [ignore])
630 done
631
632 for txn in m4_foreach([txn], [[[["ordinals",
633 {"op": "insert",
634 "table": "ordinals",
635 "row": {"number": 10, "name": "ten"}}]]]], ['txn' ]); do
636 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0],
637 [ignore], [ignore], [kill `cat server-pid client-pid`])
638 done
639
640 # Change the condition so that a new column "number" is added to monitor table.
641 cond='[[["number","==",1]]]'
642 AT_CHECK([ovs-appctl -t ovsdb-client ovsdb-client/cond_change ordinals $cond], [0], [ignore], [ignore])
643
644 # Give some time for the server to flush and free pending changes
645 # (to crash, when n_columns is not handled properly)
646 sleep 1
647
648 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
649 [ignore], [ignore])
650 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
651 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
652 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0], [[row,action,name
653 <0>,insert,"""ten"""
654
655 row,action,name
656 <0>,delete,
657 <1>,insert,"""one"""
658 ]], [ignore])
659 AT_CLEANUP
660
661
662 # Test monitor-cond-since with zero uuid, which shouldn't
663 # be found in server and server should send all rows
664 # as initial.
665 AT_SETUP([monitor-cond-since not found])
666 AT_KEYWORDS([ovsdb server monitor monitor-cond-since positive])
667 ordinal_schema > schema
668 AT_CHECK([ovsdb-tool create-cluster db schema unix:db.raft], [0], [stdout], [ignore])
669 AT_CAPTURE_FILE([ovsdb-server-log])
670 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
671 on_exit 'kill `cat ovsdb-server.pid`'
672 for txn in m4_foreach([txn], [[[["ordinals",
673 {"op": "insert",
674 "table": "ordinals",
675 "row": {"number": 0, "name": "zero"}},
676 {"op": "insert",
677 "table": "ordinals",
678 "row": {"number": 1, "name": "one"}},
679 {"op": "insert",
680 "table": "ordinals",
681 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
682 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
683 done
684
685 # Omitting the last_id parameter in ovsdb-client monitor-cond-since command
686 # will by default using all zero uuid, which doesn't exist in any history txn.
687 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
688 [0], [ignore], [ignore])
689 on_exit 'kill `cat ovsdb-client.pid`'
690 for txn in m4_foreach([txn], [[[["ordinals",
691 {"op": "insert",
692 "table": "ordinals",
693 "row": {"number": 10, "name": "ten"}},
694 {"op": "insert",
695 "table": "ordinals",
696 "row": {"number": 11, "name": "eleven"}}]]]], ['txn' ]); do
697 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0],
698 [ignore], [ignore], [kill `cat server-pid client-pid`])
699 done
700 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
701 [ignore], [ignore])
702 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
703 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
704 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
705 [[found: false, last_id: <0>
706 row,action,name,number,_version
707 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
708
709 last_id: <3>
710 row,action,name,number,_version
711 <4>,insert,"""ten""",10,"[""uuid"",""<5>""]"
712 ]], [ignore])
713 AT_CLEANUP
714
715
716 # Test monitor-cond-since in ovsdb server restart scenario.
717 # ovsdb-client should receive only new changes after the
718 # specific transaction id.
719 AT_SETUP([monitor-cond-since db restart])
720 AT_KEYWORDS([ovsdb server monitor monitor-cond-since positive])
721 ordinal_schema > schema
722 AT_CHECK([ovsdb-tool create-cluster db schema unix:db.raft], [0], [stdout], [ignore])
723 AT_CAPTURE_FILE([ovsdb-server-log])
724 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
725 on_exit 'kill `cat ovsdb-server.pid`'
726 for txn in m4_foreach([txn], [[[["ordinals",
727 {"op": "insert",
728 "table": "ordinals",
729 "row": {"number": 0, "name": "zero"}},
730 {"op": "insert",
731 "table": "ordinals",
732 "row": {"number": 1, "name": "one"}},
733 {"op": "insert",
734 "table": "ordinals",
735 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
736 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
737 done
738
739 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
740 [0], [ignore], [ignore])
741 on_exit 'kill `cat ovsdb-client.pid`'
742 OVS_WAIT_UNTIL([grep last_id output])
743
744 kill `cat ovsdb-client.pid`
745 kill `cat ovsdb-server.pid`
746 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
747
748 # Remember the last_id, which will be used for monitor-cond-since later.
749 last_id=`grep last_id output | awk '{print $4}'`
750
751 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
752
753 # Some new changes made to db after restarting the server.
754 for txn in m4_foreach([txn], [[[["ordinals",
755 {"op": "insert",
756 "table": "ordinals",
757 "row": {"number": 10, "name": "ten"}},
758 {"op": "insert",
759 "table": "ordinals",
760 "row": {"number": 11, "name": "eleven"}}]]]], ['txn' ]); do
761 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0],
762 [ignore], [ignore], [kill `cat server-pid client-pid`])
763 done
764
765 # Use last_id to monitor and get only the new changes.
766 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals $last_id '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
767 [0], [ignore], [ignore])
768
769 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
770 [ignore], [ignore])
771 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
772 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
773 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
774 [[found: true, last_id: <0>
775 row,action,name,number,_version
776 <1>,insert,"""ten""",10,"[""uuid"",""<2>""]"
777 ]], [ignore])
778 AT_CLEANUP
779
780
781 # Test monitor-cond-since with last_id found in server
782 # but there is no new change after that transaction.
783 AT_SETUP([monitor-cond-since found but no new rows])
784 AT_KEYWORDS([ovsdb server monitor monitor-cond-since positive])
785 ordinal_schema > schema
786 AT_CHECK([ovsdb-tool create-cluster db schema unix:db.raft], [0], [stdout], [ignore])
787 AT_CAPTURE_FILE([ovsdb-server-log])
788 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
789 on_exit 'kill `cat ovsdb-server.pid`'
790 for txn in m4_foreach([txn], [[[["ordinals",
791 {"op": "insert",
792 "table": "ordinals",
793 "row": {"number": 0, "name": "zero"}},
794 {"op": "insert",
795 "table": "ordinals",
796 "row": {"number": 1, "name": "one"}},
797 {"op": "insert",
798 "table": "ordinals",
799 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
800 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
801 done
802 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
803 [0], [ignore], [ignore])
804 on_exit 'kill `cat ovsdb-client.pid`'
805 OVS_WAIT_UNTIL([grep last_id output])
806
807 kill `cat ovsdb-client.pid`
808 OVS_WAIT_UNTIL([test ! -e ovsdb-client.pid])
809 last_id=`grep last_id output | awk '{print $4}'`
810 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals $last_id '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
811 [0], [ignore], [ignore])
812
813 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
814 [ignore], [ignore])
815 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
816 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
817 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
818 [[found: true, last_id: <0>
819 ]], [ignore])
820 AT_CLEANUP
821
822
823 # Test monitor-cond-since against empty DB
824 AT_SETUP([monitor-cond-since empty db])
825 AT_KEYWORDS([ovsdb server monitor monitor-cond-since positive])
826 ordinal_schema > schema
827 AT_CHECK([ovsdb-tool create-cluster db schema unix:db.raft], [0], [stdout], [ignore])
828 AT_CAPTURE_FILE([ovsdb-server-log])
829 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
830 on_exit 'kill `cat ovsdb-server.pid`'
831 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
832 [0], [ignore], [ignore])
833 on_exit 'kill `cat ovsdb-client.pid`'
834 OVS_WAIT_UNTIL([grep last_id output])
835
836 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
837 [ignore], [ignore])
838 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
839 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
840 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
841 [[found: false, last_id: <0>
842 ]], [ignore])
843 AT_CLEANUP
844
845
846 # Test monitor-cond-since with cond-change followed.
847 AT_SETUP([monitor-cond-since condition change])
848 AT_KEYWORDS([ovsdb server monitor monitor-cond-since positive])
849 ordinal_schema > schema
850 AT_CHECK([ovsdb-tool create-cluster db schema unix:db.raft], [0], [stdout], [ignore])
851 AT_CAPTURE_FILE([ovsdb-server-log])
852 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
853 on_exit 'kill `cat ovsdb-server.pid`'
854 for txn in m4_foreach([txn], [[[["ordinals",
855 {"op": "insert",
856 "table": "ordinals",
857 "row": {"number": 0, "name": "zero"}},
858 {"op": "insert",
859 "table": "ordinals",
860 "row": {"number": 1, "name": "one"}},
861 {"op": "insert",
862 "table": "ordinals",
863 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
864 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
865 done
866 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals '[[]]' ordinals > output], [0], [ignore], [ignore])
867 on_exit 'kill `cat ovsdb-client.pid`'
868 for cond in m4_foreach([cond],
869 [[[[["name","==","one"],["name","==","two"]]]],
870 [[[["name","==","one"]]]],
871 [[[false]]],
872 [[[true]]]], ['cond' ]); do
873 AT_CHECK([ovs-appctl -t ovsdb-client ovsdb-client/cond_change ordinals "$cond"], [0], [ignore], [ignore])
874 done
875 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
876 [ignore], [ignore])
877 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
878 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
879 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
880 [[found: false, last_id: <0>
881 row,action,name,number,_version
882 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
883 <3>,initial,"""two""",2,"[""uuid"",""<4>""]"
884 <5>,initial,"""zero""",,"[""uuid"",""<6>""]"
885
886 last_id: <0>
887 row,action,name,number,_version
888 <5>,delete,,,
889
890 last_id: <0>
891 row,action,name,number,_version
892 <3>,delete,,,
893
894 last_id: <0>
895 row,action,name,number,_version
896 <1>,delete,,,
897
898 last_id: <0>
899 row,action,name,number,_version
900 <1>,insert,"""one""",1,"[""uuid"",""<2>""]"
901 <3>,insert,"""two""",2,"[""uuid"",""<4>""]"
902 <5>,insert,"""zero""",,"[""uuid"",""<6>""]"
903 ]], [ignore])
904 AT_CLEANUP
905
906
907 # Test monitor-cond-since with non-cluster mode server
908 AT_SETUP([monitor-cond-since non-cluster])
909 AT_KEYWORDS([ovsdb server monitor monitor-cond-since positive])
910 ordinal_schema > schema
911 AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
912 AT_CAPTURE_FILE([ovsdb-server-log])
913 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
914 on_exit 'kill `cat ovsdb-server.pid`'
915 for txn in m4_foreach([txn], [[[["ordinals",
916 {"op": "insert",
917 "table": "ordinals",
918 "row": {"number": 0, "name": "zero"}},
919 {"op": "insert",
920 "table": "ordinals",
921 "row": {"number": 1, "name": "one"}},
922 {"op": "insert",
923 "table": "ordinals",
924 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
925 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
926 done
927
928 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
929 [0], [ignore], [ignore])
930 on_exit 'kill `cat ovsdb-client.pid`'
931 for txn in m4_foreach([txn], [[[["ordinals",
932 {"op": "insert",
933 "table": "ordinals",
934 "row": {"number": 10, "name": "ten"}},
935 {"op": "insert",
936 "table": "ordinals",
937 "row": {"number": 11, "name": "eleven"}}]]]], ['txn' ]); do
938 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0],
939 [ignore], [ignore], [kill `cat server-pid client-pid`])
940 done
941 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
942 [ignore], [ignore])
943 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
944 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
945
946 # Transaction shouldn't be found, and last_id returned should always
947 # be the same (all zero uuid)
948 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
949 [[found: false, last_id: <0>
950 row,action,name,number,_version
951 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
952
953 last_id: <0>
954 row,action,name,number,_version
955 <3>,insert,"""ten""",10,"[""uuid"",""<4>""]"
956 ]], [ignore])
957 AT_CLEANUP
958
959
960 # Test monitor-cond-since with non-cluster mode server with non-zero last_id
961 AT_SETUP([monitor-cond-since non-cluster non-zero last_id])
962 AT_KEYWORDS([ovsdb server monitor monitor-cond-since negative])
963 ordinal_schema > schema
964 AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
965 AT_CAPTURE_FILE([ovsdb-server-log])
966 AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file="`pwd`"/ovsdb-server-log db >/dev/null 2>&1])
967 on_exit 'kill `cat ovsdb-server.pid`'
968 for txn in m4_foreach([txn], [[[["ordinals",
969 {"op": "insert",
970 "table": "ordinals",
971 "row": {"number": 0, "name": "zero"}},
972 {"op": "insert",
973 "table": "ordinals",
974 "row": {"number": 1, "name": "one"}},
975 {"op": "insert",
976 "table": "ordinals",
977 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
978 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
979 done
980
981 # A non-zero uuid
982 last_id=11111111-1111-1111-1111-111111111111
983 AT_CHECK([ovsdb-client -vjsonrpc --pidfile --detach --no-chdir -d json monitor-cond-since --format=csv unix:socket ordinals $last_id '[[["name","==","one"],["name","==","ten"]]]' ordinals > output],
984 [0], [ignore], [ignore])
985 on_exit 'kill `cat ovsdb-client.pid`'
986 for txn in m4_foreach([txn], [[[["ordinals",
987 {"op": "insert",
988 "table": "ordinals",
989 "row": {"number": 10, "name": "ten"}},
990 {"op": "insert",
991 "table": "ordinals",
992 "row": {"number": 11, "name": "eleven"}}]]]], ['txn' ]); do
993 AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0],
994 [ignore], [ignore], [kill `cat server-pid client-pid`])
995 done
996 AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
997 [ignore], [ignore])
998 AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
999 OVS_WAIT_UNTIL([test ! -e ovsdb-server.pid && test ! -e ovsdb-client.pid])
1000
1001 # Transaction shouldn't be found, and last_id returned should always
1002 # be the same (all zero uuid)
1003 AT_CHECK([$PYTHON3 $srcdir/ovsdb-monitor-sort.py < output | uuidfilt], [0],
1004 [[found: false, last_id: <0>
1005 row,action,name,number,_version
1006 <1>,initial,"""one""",1,"[""uuid"",""<2>""]"
1007
1008 last_id: <0>
1009 row,action,name,number,_version
1010 <3>,insert,"""ten""",10,"[""uuid"",""<4>""]"
1011 ]], [ignore])
1012 AT_CLEANUP
1013