1 AT_BANNER([OVSDB -- interface description language (IDL)])
3 m4_divert_text([PREPARE_TESTS], [
4 # ovsdb_start_idltest [REMOTE] [SCHEMA]
6 # Creates a database using SCHEMA (default: idltest.ovsschema) and
7 # starts a database server listening on punix:socket and REMOTE (if
9 ovsdb_start_idltest () {
10 ovsdb-tool create db ${2:-$abs_srcdir/idltest.ovsschema} || return $?
11 ovsdb-server -vconsole:warn --log-file --detach --no-chdir --pidfile --remote=punix:socket ${1:+--remote=$1} db || return $?
12 on_exit 'kill `cat ovsdb-server.pid`'
16 # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
19 # Creates a database with a schema derived from idltest.ovsidl, runs
20 # each PRE-IDL-TXN (if any), starts an ovsdb-server on that database,
21 # and runs "test-ovsdb idl" passing each of the TRANSACTIONS along.
23 # Checks that the overall output is OUTPUT. Before comparison, the
24 # output is sorted (using "sort") and UUIDs in the output are replaced
25 # by markers of the form <N> where N is a number. The first unique
26 # UUID is replaced by <0>, the next by <1>, and so on. If a given
27 # UUID appears more than once it is always replaced by the same
28 # marker. If FILTER is supplied then the output is also filtered
29 # through the specified program.
31 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
32 m4_define([OVSDB_CHECK_IDL_C],
34 AT_KEYWORDS([ovsdb server idl positive $5])
35 AT_CHECK([ovsdb_start_idltest])
37 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
38 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
39 [0], [stdout], [ignore])
40 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
45 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
46 m4_define([OVSDB_CHECK_IDL_PYN],
48 AT_SKIP_IF([test $7 = no])
49 AT_KEYWORDS([ovsdb server idl positive Python $5])
50 AT_CHECK([ovsdb_start_idltest])
52 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
53 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
54 [0], [stdout], [ignore])
55 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
60 m4_define([OVSDB_CHECK_IDL_PY],
61 [OVSDB_CHECK_IDL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
62 [$HAVE_PYTHON], [$PYTHON])
63 OVSDB_CHECK_IDL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
64 [$HAVE_PYTHON3], [$PYTHON3])])
66 m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN],
67 [AT_SETUP([$1 - register_columns])
68 AT_SKIP_IF([test $7 = no])
69 AT_KEYWORDS([ovsdb server idl positive Python register_columns $5])
70 AT_CHECK([ovsdb_start_idltest])
72 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
73 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?link1:i,k,ka,l2?link2:i,l1 $3],
74 [0], [stdout], [ignore])
75 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
80 m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY],
81 [OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
82 [$HAVE_PYTHON], [$PYTHON])
83 OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
84 [$HAVE_PYTHON3], [$PYTHON3])])
86 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
87 m4_define([OVSDB_CHECK_IDL_TCP_PYN],
89 AT_SKIP_IF([test $7 = no])
90 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
91 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
92 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
95 [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])])
96 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
97 [0], [stdout], [ignore])
98 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
100 OVSDB_SERVER_SHUTDOWN
103 m4_define([OVSDB_CHECK_IDL_TCP_PY],
104 [OVSDB_CHECK_IDL_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
105 [$HAVE_PYTHON], [$PYTHON])
106 OVSDB_CHECK_IDL_TCP_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
107 [$HAVE_PYTHON3], [$PYTHON3])])
109 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
110 m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
111 [AT_SETUP([$1 - tcp6])
112 AT_SKIP_IF([test $7 = no])
113 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
114 AT_SKIP_IF([test $HAVE_IPV6 = no])
115 AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
116 AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
117 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
118 echo "TCP_PORT=$TCP_PORT"
121 [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
122 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
123 [0], [stdout], [ignore])
124 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
126 OVSDB_SERVER_SHUTDOWN
129 m4_define([OVSDB_CHECK_IDL_TCP6_PY],
130 [OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
131 [$HAVE_PYTHON], [$PYTHON])
132 OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
133 [$HAVE_PYTHON3], [$PYTHON3])])
135 m4_define([OVSDB_CHECK_IDL],
136 [OVSDB_CHECK_IDL_C($@)
137 OVSDB_CHECK_IDL_PY($@)
138 OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY($@)
139 OVSDB_CHECK_IDL_TCP_PY($@)
140 OVSDB_CHECK_IDL_TCP6_PY($@)])
142 # This test uses the Python IDL implementation with passive tcp
143 m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
144 [AT_SETUP([$1 - Python ptcp])
145 AT_SKIP_IF([test $HAVE_PYTHON = no])
146 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
148 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
149 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
150 OVSDB_SERVER_SHUTDOWN
153 # start OVSDB server in passive mode
154 AT_CHECK([ovsdb_start_idltest "tcp:127.0.0.1:$TCP_PORT"])
155 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
156 [0], [stdout], [ignore])
157 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
159 OVSDB_SERVER_SHUTDOWN
163 OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
165 [['["idltest",{"op":"select","table":"link1","where":[]}]']],
167 001: {"error":null,"result":[{"rows":[]}]}
171 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
178 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
187 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
188 "ia": ["set", [1, 2, 3]],
189 "ra": ["set", [-0.5]],
190 "ba": ["set", [true]],
191 "sa": ["set", ["abc", "def"]],
192 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
193 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
201 "row": {"b": true}}]' \
206 "row": {"r": 123.5}}]' \
215 "ra": ["set", [1.5]],
216 "ba": ["set", [false]],
218 "ua": ["set", []]}}]' \
222 "where": [["i", "<", 1]],
223 "row": {"s": "newstring"}}]' \
227 "where": [["i", "==", 0]]}]' \
230 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
231 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
232 002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
233 003: {"error":null,"result":[{"count":2}]}
234 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
235 004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
236 005: {"error":null,"result":[{"count":2}]}
237 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
238 006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
239 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
240 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
241 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
242 008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
243 009: {"error":null,"result":[{"count":2}]}
244 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
245 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
246 010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
247 011: {"error":null,"result":[{"count":1}]}
248 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
249 012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
251 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
252 014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
256 OVSDB_CHECK_IDL([simple idl, initially populated],
264 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
265 "ia": ["set", [1, 2, 3]],
266 "ra": ["set", [-0.5]],
267 "ba": ["set", [true]],
268 "sa": ["set", ["abc", "def"]],
269 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
270 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
278 "row": {"b": true}}]']],
279 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
280 000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
281 001: {"error":null,"result":[{"count":2}]}
282 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
283 002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
287 OVSDB_CHECK_IDL([simple idl, writing via IDL],
295 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
296 "ia": ["set", [1, 2, 3]],
297 "ra": ["set", [-0.5]],
298 "ba": ["set", [true]],
299 "sa": ["set", ["abc", "def"]],
300 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
301 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
305 [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
306 'insert 2, verify 2 i, verify 1 b, delete 1']],
307 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
308 000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
309 001: commit, status=success
310 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
311 002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
312 003: commit, status=success
313 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
314 004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
318 OVSDB_CHECK_IDL([simple idl, handling verification failure],
331 "where": [["i", "==", 1]],
332 "row": {"r": 5.0}}]' \
333 '+verify 1 r, set 1 r 3' \
334 'verify 1 r, set 1 r 3' \
336 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
337 000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
338 001: commit, status=success
339 002: {"error":null,"result":[{"count":1}]}
340 003: commit, status=try again
341 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
342 004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
343 005: commit, status=success
344 006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
345 006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
349 OVSDB_CHECK_IDL([simple idl, increment operation],
354 [['set 0 r 2.0, increment 0']],
355 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
356 001: commit, status=success, increment=1
357 002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
361 OVSDB_CHECK_IDL([simple idl, aborting],
366 [['set 0 r 2.0, abort' \
368 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
369 001: commit, status=aborted
370 002: commit, status=success
371 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
375 OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
380 [['set 0 r 2.0, destroy' \
382 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
384 002: commit, status=success
385 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
389 OVSDB_CHECK_IDL([simple idl, conditional, false condition],
396 [['condition simple []' \
397 'condition simple [true]']],
398 [[000: change conditions
400 002: change conditions
401 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
405 OVSDB_CHECK_IDL([simple idl, conditional, true condition],
412 [['condition simple []' \
413 'condition simple [true]']],
414 [[000: change conditions
416 002: change conditions
417 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
421 OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition],
433 [['condition simple []' \
434 'condition simple [["i","==",1],["i","==",2]]']],
435 [[000: change conditions
437 002: change conditions
438 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
439 003: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
443 OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition],
450 [['condition simple []' \
451 'condition simple [["i","==",1]]']],
452 [[000: change conditions
454 002: change conditions
455 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
459 OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition],
466 [['condition simple []' \
467 'condition simple [["i","==",1],["i","==",2]]' \
468 'condition simple [["i","==",2]]' \
475 [[000: change conditions
477 002: change conditions
478 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
479 004: change conditions
481 006: {"error":null,"result":[{"uuid":["uuid","<2>"]}]}
482 007: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
486 OVSDB_CHECK_IDL([simple idl, conditional, multiple tables],
495 "row": {"i": 0, "k": ["named-uuid", "self"]},
496 "uuid-name": "self"},
500 "uuid-name": "row0"}]']],
501 [['condition simple [];link1 [];link2 []' \
502 'condition simple [["i","==",1]]' \
503 'condition link1 [["i","==",0]]' \
504 'condition link2 [["i","==",3]]' \
509 "uuid-name": "row0"}]']],
510 [[000: change conditions
512 002: change conditions
513 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
514 004: change conditions
515 005: i=0 k=0 ka=[] l2= uuid=<2>
516 005: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
517 006: change conditions
518 007: {"error":null,"result":[{"uuid":["uuid","<3>"]}]}
519 008: i=0 k=0 ka=[] l2= uuid=<2>
520 008: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
521 008: i=3 l1= uuid=<3>
525 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
530 "row": {"i": 0, "k": ["named-uuid", "self"]},
531 "uuid-name": "self"}]' \
535 "row": {"i": 1, "k": ["named-uuid", "row2"]},
536 "uuid-name": "row1"},
539 "row": {"i": 2, "k": ["named-uuid", "row1"]},
540 "uuid-name": "row2"}]' \
544 "where": [["i", "==", 1]],
545 "row": {"k": ["uuid", "#1#"]}}]' \
550 "row": {"k": ["uuid", "#0#"]}}]']],
552 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
553 002: i=0 k=0 ka=[] l2= uuid=<0>
554 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
555 004: i=0 k=0 ka=[] l2= uuid=<0>
556 004: i=1 k=2 ka=[] l2= uuid=<1>
557 004: i=2 k=1 ka=[] l2= uuid=<2>
558 005: {"error":null,"result":[{"count":1}]}
559 006: i=0 k=0 ka=[] l2= uuid=<0>
560 006: i=1 k=1 ka=[] l2= uuid=<1>
561 006: i=2 k=1 ka=[] l2= uuid=<2>
562 007: {"error":null,"result":[{"count":3}]}
563 008: i=0 k=0 ka=[] l2= uuid=<0>
564 008: i=1 k=0 ka=[] l2= uuid=<1>
565 008: i=2 k=0 ka=[] l2= uuid=<2>
569 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
574 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
579 "row": {"i": 1, "k": ["named-uuid", "one"]}},
582 "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
587 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
591 "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
595 "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
602 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"details":"Table link1 column k row <0> references nonexistent row <1> in table link1.","error":"referential integrity violation"}]}
603 002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
604 003: i=1 k=1 ka=[] l2= uuid=<2>
605 003: i=2 k=1 ka=[] l2= uuid=<3>
606 004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
607 005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
608 006: {"error":null,"result":[{"count":1}]}
609 007: i=1 k=1 ka=[] l2= uuid=<2>
610 008: {"error":null,"result":[{"count":1}]}
615 [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
617 OVSDB_CHECK_IDL([self-linking idl, sets],
622 "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
626 "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
630 "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
634 "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
635 "uuid-name": "i3"}]' \
640 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
644 "where": [["i", "==", 2]],
645 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
651 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
652 002: i=0 k=0 ka=[0] l2= uuid=<0>
653 002: i=1 k=0 ka=[1] l2= uuid=<1>
654 002: i=2 k=0 ka=[2] l2= uuid=<2>
655 002: i=3 k=0 ka=[3] l2= uuid=<3>
656 003: {"error":null,"result":[{"count":4}]}
657 004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
658 004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
659 004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
660 004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
661 005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
662 006: {"error":null,"result":[{"count":4}]}
667 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
673 "uuid-name": "row0"},
676 "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
677 "uuid-name": "row1"}]']],
679 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
680 002: i=0 l1= uuid=<0>
681 002: i=1 k=1 ka=[] l2=0 uuid=<1>
685 OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
689 001: commit, status=success
690 002: i=1 k=1 ka=[1] l2= uuid=<0>
691 002: i=2 k=1 ka=[1 2] l2= uuid=<1>
695 OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
699 001: commit, status=success
700 002: i=2 k=2 ka=[] l2= uuid=<0>
704 OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
712 [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']],
713 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
714 000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
715 001: commit, status=success, events=create|2|None, delete|0|None, update|1|b
716 002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
717 002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>
721 AT_SETUP([idl handling of missing tables and columns - C])
722 AT_KEYWORDS([ovsdb server idl positive])
724 # idltest2.ovsschema is the same as idltest.ovsschema, except that
725 # table link2 and column l2 have been deleted. But the IDL still
726 # expects them to be there, so this test checks that it properly
727 # tolerates them being missing.
728 AT_CHECK([ovsdb_start_idltest "" "$abs_srcdir/idltest2.ovsschema"])
729 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest",
732 "row": {"i": 0, "k": ["named-uuid", "self"]},
733 "uuid-name": "self"}]' \
737 "row": {"i": 1, "k": ["named-uuid", "row2"]},
738 "uuid-name": "row1"},
741 "row": {"i": 2, "k": ["named-uuid", "row1"]},
742 "uuid-name": "row2"}]' \
746 "where": [["i", "==", 1]],
747 "row": {"k": ["uuid", "#1#"]}}]' \
752 "row": {"k": ["uuid", "#0#"]}}]']],
753 [0], [stdout], [stderr])
754 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0],
756 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
757 002: i=0 k=0 ka=[] l2= uuid=<0>
758 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
759 004: i=0 k=0 ka=[] l2= uuid=<0>
760 004: i=1 k=2 ka=[] l2= uuid=<1>
761 004: i=2 k=1 ka=[] l2= uuid=<2>
762 005: {"error":null,"result":[{"count":1}]}
763 006: i=0 k=0 ka=[] l2= uuid=<0>
764 006: i=1 k=1 ka=[] l2= uuid=<1>
765 006: i=2 k=1 ka=[] l2= uuid=<2>
766 007: {"error":null,"result":[{"count":3}]}
767 008: i=0 k=0 ka=[] l2= uuid=<0>
768 008: i=1 k=0 ka=[] l2= uuid=<1>
769 008: i=2 k=0 ka=[] l2= uuid=<2>
773 # Check that ovsdb-idl figured out that table link2 and column l2 are missing.
774 AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl
775 test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?)
776 test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?)
779 # Check that ovsdb-idl sent on "monitor" request and that it didn't
780 # mention that table or column, and (for paranoia) that it did mention another
782 AT_CHECK([grep -c '"monitor\|monitor_cond"' stderr], [0], [1
784 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep link2], [1])
785 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep l2], [1])
786 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"link1"'], [0], [1
788 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
790 OVSDB_SERVER_SHUTDOWN
793 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
794 [AT_SETUP([$1 - Python fetch])
795 AT_SKIP_IF([test $HAVE_PYTHON = no])
796 AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6])
797 AT_CHECK([ovsdb_start_idltest])
799 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
800 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
801 [0], [stdout], [ignore])
802 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$7],,, [[| $7]]),
804 OVSDB_SERVER_SHUTDOWN
807 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
808 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])
810 OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
818 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
819 "ia": ["set", [1, 2, 3]],
820 "ra": ["set", [-0.5]],
821 "ba": ["set", [true]],
822 "sa": ["set", ["abc", "def"]],
823 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
824 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
832 001: commit, status=success
833 002: i=0 r=0 uuid=<0>
838 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
839 [AT_SETUP([$1 - Python])
840 AT_SKIP_IF([test $HAVE_PYTHON = no])
841 AT_KEYWORDS([ovsdb server idl Python monitor $4])
842 AT_CHECK([ovsdb_start_idltest])
843 AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond])
844 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
845 [0], [stdout], [ignore], [kill `cat pid`])
846 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]),
847 [0], [$3], [], [kill `cat pid`])
848 OVSDB_SERVER_SHUTDOWN
852 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
853 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])
856 OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond],
864 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
865 "ia": ["set", [1, 2, 3]],
866 "ra": ["set", [-0.5]],
867 "ba": ["set", [true]],
868 "sa": ["set", ["abc", "def"]],
869 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
870 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
878 "row": {"b": true}}]' \
883 "row": {"r": 123.5}}]' \
892 "ra": ["set", [1.5]],
893 "ba": ["set", [false]],
895 "ua": ["set", []]}}]' \
899 "where": [["i", "<", 1]],
900 "row": {"s": "newstring"}}]' \
904 "where": [["i", "==", 0]]}]' \
907 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
908 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
909 002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
910 003: {"error":null,"result":[{"count":2}]}
911 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
912 004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
913 005: {"error":null,"result":[{"count":2}]}
914 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
915 006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
916 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
917 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
918 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
919 008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
920 009: {"error":null,"result":[{"count":2}]}
921 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
922 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
923 010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
924 011: {"error":null,"result":[{"count":1}]}
925 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
926 012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
928 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
929 014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
933 m4_define([OVSDB_CHECK_IDL_TRACK_C],
935 AT_KEYWORDS([ovsdb server idl tracking positive $5])
936 AT_CHECK([ovsdb_start_idltest])
938 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
939 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3],
940 [0], [stdout], [ignore])
941 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
943 OVSDB_SERVER_SHUTDOWN
946 m4_define([OVSDB_CHECK_IDL_TRACK],
947 [OVSDB_CHECK_IDL_TRACK_C($@)])
949 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated],
957 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
958 "ia": ["set", [1, 2, 3]],
959 "ra": ["set", [-0.5]],
960 "ba": ["set", [true]],
961 "sa": ["set", ["abc", "def"]],
962 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
963 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
971 "row": {"b": true}}]']],
972 [[000: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3>
973 000: updated columns: b ba i ia r ra s sa u ua
974 001: {"error":null,"result":[{"count":2}]}
975 002: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5>
976 002: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3>
977 002: updated columns: b
981 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
990 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
991 "ia": ["set", [1, 2, 3]],
992 "ra": ["set", [-0.5]],
993 "ba": ["set", [true]],
994 "sa": ["set", ["abc", "def"]],
995 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
996 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1004 "row": {"b": true}}]' \
1009 "row": {"r": 123.5}}]' \
1018 "ra": ["set", [1.5]],
1019 "ba": ["set", [false]],
1021 "ua": ["set", []]}}]' \
1025 "where": [["i", "<", 1]],
1026 "row": {"s": "newstring"}}]' \
1030 "where": [["i", "==", 0]]}]' \
1033 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1034 002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0>
1035 002: updated columns: b ba i ia r ra s sa u ua
1036 003: {"error":null,"result":[{"count":2}]}
1037 004: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1038 004: updated columns: b
1039 005: {"error":null,"result":[{"count":2}]}
1040 006: i=0 r=123.5 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1041 006: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0>
1042 006: updated columns: r
1043 006: updated columns: r
1044 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1045 008: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1046 008: updated columns: ba i ia r ra
1047 009: {"error":null,"result":[{"count":2}]}
1048 010: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1049 010: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1050 010: updated columns: s
1051 010: updated columns: s
1052 011: {"error":null,"result":[{"count":1}]}
1053 012: ##deleted## uuid=<1>
1055 014: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1056 014: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0>
1057 014: updated columns: b ba i ia r ra s sa u ua
1058 014: updated columns: ba i ia r ra s
1062 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN],
1064 AT_KEYWORDS([ovsdb server idl partial update map column positive $5])
1065 AT_CHECK([ovsdb_start_idltest])
1067 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1068 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3],
1069 [0], [stdout], [ignore])
1070 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
1072 OVSDB_SERVER_SHUTDOWN
1075 OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-column, initially populated],
1076 [['["idltest", {"op":"insert", "table":"simple2",
1077 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
1080 [[000: Getting records
1081 001: name=myString1 smap=[[key1 : value1],[key2 : value2]] imap=[]
1082 002: After insert element
1083 003: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
1084 004: After insert duplicated element
1085 005: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
1086 006: After delete element
1087 007: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
1088 008: After trying to delete a deleted element
1089 009: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
1093 OVSDB_CHECK_IDL_PY([partial-map idl],
1094 [['["idltest", {"op":"insert", "table":"simple2",
1095 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
1097 [?simple2:name,smap,imap 'partialmapinsertelement' 'partialmapinsertmultipleelements' 'partialmapdelelements' 'partialmapmutatenew'],
1098 [[000: name=myString1 smap=[(key1 value1) (key2 value2)] imap=[]
1099 001: commit, status=success
1100 002: name=String2 smap=[(key1 myList1) (key2 value2)] imap=[(3 myids2)]
1101 003: commit, status=success
1102 004: name=String2 smap=[(key1 myList1) (key2 myList2) (key3 myList3) (key4 myList4)] imap=[(3 myids2)]
1103 005: commit, status=success
1104 006: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
1105 007: commit, status=success
1106 008: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
1107 008: name=String2New smap=[(key1 newList1) (key2 newList2)] imap=[]
1111 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN],
1113 AT_KEYWORDS([ovsdb server idl partial update set column positive $5])
1114 AT_CHECK([ovsdb_start_idltest])
1116 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1117 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3],
1118 [0], [stdout], [ignore])
1119 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
1121 OVSDB_SERVER_SHUTDOWN
1124 OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-column, initially populated],
1125 [['["idltest", {"op":"insert", "table":"simple3",
1126 "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ], [ "uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff" ]]]} }]']
1129 [[000: Getting records
1130 001: name=mySet1 uset=[[<0>],[<1>]] uref=[]
1131 002: After rename+add new value
1132 003: name=String2 uset=[[<0>],[<1>],[<2>]] uref=[]
1133 004: After add new value
1134 005: name=String2 uset=[[<0>],[<1>],[<2>],[<3>]] uref=[]
1135 006: After delete value
1136 007: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
1137 008: After trying to delete a deleted value
1138 009: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
1139 010: After add to other table + set of strong ref
1140 011: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[[<4>]]
1144 OVSDB_CHECK_IDL_PY([partial-set idl],
1145 [['["idltest", {"op":"insert", "table":"simple3", "uuid-name":"newrow",
1146 "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ]]]} },
1147 {"op":"insert", "table":"simple4", "row":{"name":"seed"}},
1148 {"op":"mutate", "table":"simple3", "where":[["_uuid", "==", ["named-uuid", "newrow"]]],
1149 "mutations": [["uset", "insert", ["set", [["uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff"]]]]]}]']
1151 ['partialrenamesetadd' 'partialduplicateadd' 'partialsetdel' 'partialsetref' 'partialsetoverrideops' 'partialsetadddelete' 'partialsetmutatenew'],
1152 [[000: name=mySet1 uset=[<0> <1>]
1153 001: commit, status=success
1154 002: name=String2 uset=[<0> <1> <2>]
1155 003: commit, status=success
1156 004: name=String2 uset=[<0> <1> <2> <3>]
1157 005: commit, status=success
1158 006: name=String2 uset=[<0> <1> <3>]
1159 007: commit, status=success
1160 008: name=String2 uset=[<0> <1> <3>]
1161 009: commit, status=success
1162 010: name=String2 uset=[<3>]
1163 011: commit, status=success
1164 012: name=String2 uset=[<4> <5>]
1165 013: commit, status=success
1166 014: name=String2 uset=[<4> <5>]
1167 014: name=String3 uset=[<6>]
1171 m4_define([OVSDB_CHECK_IDL_NOTIFY_PY],
1172 [AT_SETUP([$1 - Python])
1173 AT_SKIP_IF([test $HAVE_PYTHON = no])
1174 AT_KEYWORDS([ovsdb server idl Python notify $4])
1175 AT_CHECK([ovsdb_start_idltest])
1176 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
1177 [0], [stdout], [ignore], [kill `cat pid`])
1178 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]),
1179 [0], [$3], [], [kill `cat pid`])
1180 OVSDB_SERVER_SHUTDOWN
1183 # This test uses the Python IDL implementation with ssl
1184 m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PY],
1185 [AT_SETUP([$1 - SSL])
1186 AT_SKIP_IF([test $HAVE_PYTHON = no])
1187 $PYTHON -m OpenSSL.SSL
1189 AT_SKIP_IF([test $SSL_PRESENT != 0])
1190 AT_KEYWORDS([ovsdb server idl Python notify - ssl socket])
1191 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
1192 [0], [stdout], [ignore])
1193 PKIDIR=$abs_top_builddir/tests
1194 AT_CHECK([ovsdb-server -vconsole:warn --log-file --detach --no-chdir \
1196 --private-key=$PKIDIR/testpki-privkey2.pem \
1197 --certificate=$PKIDIR/testpki-cert2.pem \
1198 --ca-cert=$PKIDIR/testpki-cacert.pem \
1199 --remote=pssl:0:127.0.0.1 db])
1200 on_exit 'kill `cat ovsdb-server.pid`'
1201 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
1202 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema \
1203 ssl:127.0.0.1:$TCP_PORT $PKIDIR/testpki-privkey.pem \
1204 $PKIDIR/testpki-cert.pem $PKIDIR/testpki-cacert.pem $2],
1205 [0], [stdout], [ignore], [kill `cat pid`])
1206 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]),
1207 [0], [$3], [], [kill `cat pid`])
1208 OVSDB_SERVER_SHUTDOWN
1211 m4_define([OVSDB_CHECK_IDL_NOTIFY],
1212 [OVSDB_CHECK_IDL_NOTIFY_PY($@)
1213 OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])
1215 OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
1224 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1225 "ia": ["set", [1, 2, 3]],
1226 "ra": ["set", [-0.5]],
1227 "ba": ["set", [true]],
1228 "sa": ["set", ["abc", "def"]],
1229 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1230 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1238 "row": {"b": false}}]' \
1243 "row": {"r": 123.5}}]' \
1252 "ra": ["set", [1.5]],
1253 "ba": ["set", [false]],
1255 "ua": ["set", []]}}]' \
1259 "where": [["i", "<", 1]],
1260 "row": {"s": "newstring"}}]' \
1264 "where": [["i", "==", 0]]}]' \
1267 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1268 002: event:create, row={i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
1269 002: event:create, row={i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates=None
1270 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1271 002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
1272 003: {"error":null,"result":[{"count":2}]}
1273 004: event:update, row={i=1 r=2 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates={b=true uuid=<0>}
1274 004: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1275 004: i=1 r=2 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
1276 005: {"error":null,"result":[{"count":2}]}
1277 006: event:update, row={i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates={r=0 uuid=<1>}
1278 006: event:update, row={i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates={r=2 uuid=<0>}
1279 006: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1280 006: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
1281 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1282 008: event:create, row={i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>}, updates=None
1283 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1284 008: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1285 008: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
1286 009: {"error":null,"result":[{"count":2}]}
1287 010: event:update, row={i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>}, updates={s= uuid=<6>}
1288 010: event:update, row={i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates={s= uuid=<1>}
1289 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1290 010: i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1291 010: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
1292 011: {"error":null,"result":[{"count":1}]}
1293 012: event:delete, row={i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
1294 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1295 012: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
1297 014: event:create, row={i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>}, updates=None
1298 014: event:create, row={i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates=None
1299 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1300 014: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>