1 AT_BANNER([OVSDB -- interface description language (IDL)])
3 # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
6 # Creates a database with a schema derived from idltest.ovsidl, runs
7 # each PRE-IDL-TXN (if any), starts an ovsdb-server on that database,
8 # and runs "test-ovsdb idl" passing each of the TRANSACTIONS along.
10 # Checks that the overall output is OUTPUT. Before comparison, the
11 # output is sorted (using "sort") and UUIDs in the output are replaced
12 # by markers of the form <N> where N is a number. The first unique
13 # UUID is replaced by <0>, the next by <1>, and so on. If a given
14 # UUID appears more than once it is always replaced by the same
15 # marker. If FILTER is supplied then the output is also filtered
16 # through the specified program.
18 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
19 m4_define([OVSDB_CHECK_IDL_C],
21 AT_KEYWORDS([ovsdb server idl positive $5])
22 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
23 [0], [stdout], [ignore])
24 AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
26 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
27 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
28 [0], [stdout], [ignore], [kill `cat pid`])
29 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
30 [0], [$4], [], [kill `cat pid`])
34 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
35 m4_define([OVSDB_CHECK_IDL_PY],
36 [AT_SETUP([$1 - Python])
37 AT_SKIP_IF([test $HAVE_PYTHON = no])
38 AT_KEYWORDS([ovsdb server idl positive Python $5])
39 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
40 [0], [stdout], [ignore])
41 AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
43 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
44 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
45 [0], [stdout], [ignore], [kill `cat pid`])
46 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
47 [0], [$4], [], [kill `cat pid`])
51 m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY],
52 [AT_SETUP([$1 - Python register_columns])
53 AT_SKIP_IF([test $HAVE_PYTHON = no])
54 AT_KEYWORDS([ovsdb server idl positive Python register_columns $5])
55 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
56 [0], [stdout], [ignore])
57 AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
59 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
60 AT_CHECK([$PYTHON $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],
61 [0], [stdout], [ignore], [kill `cat pid`])
62 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
63 [0], [$4], [], [kill `cat pid`])
67 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
68 m4_define([OVSDB_CHECK_IDL_TCP_PY],
69 [AT_SETUP([$1 - Python tcp])
70 AT_SKIP_IF([test $HAVE_PYTHON = no])
71 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
72 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
73 [0], [stdout], [ignore])
74 AT_CHECK([ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
75 TCP_PORT=`parse_listening_port < ovsdb-server.log`
78 [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore], [kill `cat pid`])])
79 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
80 [0], [stdout], [ignore], [kill `cat pid`])
81 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
82 [0], [$4], [], [kill `cat pid`])
86 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
87 m4_define([OVSDB_CHECK_IDL_TCP6_PY],
88 [AT_SETUP([$1 - Python tcp6])
89 AT_SKIP_IF([test $HAVE_PYTHON = no])
90 AT_SKIP_IF([test $HAVE_IPV6 = no])
91 AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
92 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
93 [0], [stdout], [ignore])
94 AT_CHECK([ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[[::1]] --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
95 TCP_PORT=`parse_listening_port < ovsdb-server.log`
96 echo "TCP_PORT=$TCP_PORT"
99 [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore], [kill `cat pid`])])
100 AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
101 [0], [stdout], [ignore], [kill `cat pid`])
102 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
103 [0], [$4], [], [kill `cat pid`])
104 OVSDB_SERVER_SHUTDOWN
107 m4_define([OVSDB_CHECK_IDL],
108 [OVSDB_CHECK_IDL_C($@)
109 OVSDB_CHECK_IDL_PY($@)
110 OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY($@)
111 OVSDB_CHECK_IDL_TCP_PY($@)
112 OVSDB_CHECK_IDL_TCP6_PY($@)])
114 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
121 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
130 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
131 "ia": ["set", [1, 2, 3]],
132 "ra": ["set", [-0.5]],
133 "ba": ["set", [true]],
134 "sa": ["set", ["abc", "def"]],
135 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
136 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
144 "row": {"b": true}}]' \
149 "row": {"r": 123.5}}]' \
158 "ra": ["set", [1.5]],
159 "ba": ["set", [false]],
161 "ua": ["set", []]}}]' \
165 "where": [["i", "<", 1]],
166 "row": {"s": "newstring"}}]' \
170 "where": [["i", "==", 0]]}]' \
173 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
174 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
175 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>
176 003: {"error":null,"result":[{"count":2}]}
177 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
178 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>
179 005: {"error":null,"result":[{"count":2}]}
180 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
181 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>
182 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
183 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
184 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
185 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>
186 009: {"error":null,"result":[{"count":2}]}
187 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
188 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
189 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>
190 011: {"error":null,"result":[{"count":1}]}
191 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
192 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>
194 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
195 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>
199 OVSDB_CHECK_IDL([simple idl, initially populated],
207 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
208 "ia": ["set", [1, 2, 3]],
209 "ra": ["set", [-0.5]],
210 "ba": ["set", [true]],
211 "sa": ["set", ["abc", "def"]],
212 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
213 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
221 "row": {"b": true}}]']],
222 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
223 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>
224 001: {"error":null,"result":[{"count":2}]}
225 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
226 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>
230 OVSDB_CHECK_IDL([simple idl, writing via IDL],
238 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
239 "ia": ["set", [1, 2, 3]],
240 "ra": ["set", [-0.5]],
241 "ba": ["set", [true]],
242 "sa": ["set", ["abc", "def"]],
243 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
244 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
248 [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
249 'insert 2, verify 2 i, verify 1 b, delete 1']],
250 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
251 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>
252 001: commit, status=success
253 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
254 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>
255 003: commit, status=success
256 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
257 004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
261 OVSDB_CHECK_IDL([simple idl, handling verification failure],
274 "where": [["i", "==", 1]],
275 "row": {"r": 5.0}}]' \
276 '+verify 1 r, set 1 r 3' \
277 'verify 1 r, set 1 r 3' \
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=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
281 001: commit, status=success
282 002: {"error":null,"result":[{"count":1}]}
283 003: commit, status=try again
284 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
285 004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
286 005: commit, status=success
287 006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
288 006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
292 OVSDB_CHECK_IDL([simple idl, increment operation],
297 [['set 0 r 2.0, increment 0']],
298 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
299 001: commit, status=success, increment=1
300 002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
304 OVSDB_CHECK_IDL([simple idl, aborting],
309 [['set 0 r 2.0, abort' \
311 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
312 001: commit, status=aborted
313 002: commit, status=success
314 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
318 OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
323 [['set 0 r 2.0, destroy' \
325 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
327 002: commit, status=success
328 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
332 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
337 "row": {"i": 0, "k": ["named-uuid", "self"]},
338 "uuid-name": "self"}]' \
342 "row": {"i": 1, "k": ["named-uuid", "row2"]},
343 "uuid-name": "row1"},
346 "row": {"i": 2, "k": ["named-uuid", "row1"]},
347 "uuid-name": "row2"}]' \
351 "where": [["i", "==", 1]],
352 "row": {"k": ["uuid", "#1#"]}}]' \
357 "row": {"k": ["uuid", "#0#"]}}]']],
359 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
360 002: i=0 k=0 ka=[] l2= uuid=<0>
361 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
362 004: i=0 k=0 ka=[] l2= uuid=<0>
363 004: i=1 k=2 ka=[] l2= uuid=<1>
364 004: i=2 k=1 ka=[] l2= uuid=<2>
365 005: {"error":null,"result":[{"count":1}]}
366 006: i=0 k=0 ka=[] l2= uuid=<0>
367 006: i=1 k=1 ka=[] l2= uuid=<1>
368 006: i=2 k=1 ka=[] l2= uuid=<2>
369 007: {"error":null,"result":[{"count":3}]}
370 008: i=0 k=0 ka=[] l2= uuid=<0>
371 008: i=1 k=0 ka=[] l2= uuid=<1>
372 008: i=2 k=0 ka=[] l2= uuid=<2>
376 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
381 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
386 "row": {"i": 1, "k": ["named-uuid", "one"]}},
389 "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
394 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
398 "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
402 "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
409 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"}]}
410 002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
411 003: i=1 k=1 ka=[] l2= uuid=<2>
412 003: i=2 k=1 ka=[] l2= uuid=<3>
413 004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
414 005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
415 006: {"error":null,"result":[{"count":1}]}
416 007: i=1 k=1 ka=[] l2= uuid=<2>
417 008: {"error":null,"result":[{"count":1}]}
422 [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
424 OVSDB_CHECK_IDL([self-linking idl, sets],
429 "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
433 "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
437 "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
441 "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
442 "uuid-name": "i3"}]' \
447 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
451 "where": [["i", "==", 2]],
452 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
458 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
459 002: i=0 k=0 ka=[0] l2= uuid=<0>
460 002: i=1 k=0 ka=[1] l2= uuid=<1>
461 002: i=2 k=0 ka=[2] l2= uuid=<2>
462 002: i=3 k=0 ka=[3] l2= uuid=<3>
463 003: {"error":null,"result":[{"count":4}]}
464 004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
465 004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
466 004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
467 004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
468 005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
469 006: {"error":null,"result":[{"count":4}]}
474 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
480 "uuid-name": "row0"},
483 "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
484 "uuid-name": "row1"}]']],
486 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
487 002: i=0 l1= uuid=<0>
488 002: i=1 k=1 ka=[] l2=0 uuid=<1>
492 OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
496 001: commit, status=success
497 002: i=1 k=1 ka=[1] l2= uuid=<0>
498 002: i=2 k=1 ka=[1 2] l2= uuid=<1>
502 OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
506 001: commit, status=success
507 002: i=2 k=2 ka=[] l2= uuid=<0>
511 OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
519 [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']],
520 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
521 000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
522 001: commit, status=success, events=create|2|None, delete|0|None, update|1|b
523 002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
524 002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>
528 AT_SETUP([idl handling of missing tables and columns - C])
529 AT_KEYWORDS([ovsdb server idl positive])
531 # idltest2.ovsschema is the same as idltest.ovsschema, except that
532 # table link2 and column l2 have been deleted. But the IDL still
533 # expects them to be there, so this test checks that it properly
534 # tolerates them being missing.
535 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest2.ovsschema],
536 [0], [stdout], [ignore])
537 AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
538 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest",
541 "row": {"i": 0, "k": ["named-uuid", "self"]},
542 "uuid-name": "self"}]' \
546 "row": {"i": 1, "k": ["named-uuid", "row2"]},
547 "uuid-name": "row1"},
550 "row": {"i": 2, "k": ["named-uuid", "row1"]},
551 "uuid-name": "row2"}]' \
555 "where": [["i", "==", 1]],
556 "row": {"k": ["uuid", "#1#"]}}]' \
561 "row": {"k": ["uuid", "#0#"]}}]']],
562 [0], [stdout], [stderr], [kill `cat pid`])
563 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0],
565 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
566 002: i=0 k=0 ka=[] l2= uuid=<0>
567 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
568 004: i=0 k=0 ka=[] l2= uuid=<0>
569 004: i=1 k=2 ka=[] l2= uuid=<1>
570 004: i=2 k=1 ka=[] l2= uuid=<2>
571 005: {"error":null,"result":[{"count":1}]}
572 006: i=0 k=0 ka=[] l2= uuid=<0>
573 006: i=1 k=1 ka=[] l2= uuid=<1>
574 006: i=2 k=1 ka=[] l2= uuid=<2>
575 007: {"error":null,"result":[{"count":3}]}
576 008: i=0 k=0 ka=[] l2= uuid=<0>
577 008: i=1 k=0 ka=[] l2= uuid=<1>
578 008: i=2 k=0 ka=[] l2= uuid=<2>
580 ]], [], [kill `cat pid`])
582 # Check that ovsdb-idl figured out that table link2 and column l2 are missing.
583 AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl
584 test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?)
585 test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?)
588 # Check that ovsdb-idl sent on "monitor" request and that it didn't
589 # mention that table or column, and (for paranoia) that it did mention another
591 AT_CHECK([grep -c '"monitor"' stderr], [0], [1
593 AT_CHECK([grep '"monitor"' stderr | grep link2], [1])
594 AT_CHECK([grep '"monitor"' stderr | grep l2], [1])
595 AT_CHECK([grep '"monitor"' stderr | grep -c '"link1"'], [0], [1
597 AT_CHECK([grep '"monitor"' stderr | grep -c '"ua"'], [0], [1
599 OVSDB_SERVER_SHUTDOWN