python/ovs/stream: teach stream.py tcp socket
[cascardo/ovs.git] / tests / ovsdb-idl.at
1 AT_BANNER([OVSDB -- interface description language (IDL)])
2
3 # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
4 #                   [FILTER])
5 #
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.
9 #
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.
17 #
18 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
19 m4_define([OVSDB_CHECK_IDL_C],
20   [AT_SETUP([$1 - 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])
25    m4_if([$2], [], [],
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`])
31    OVSDB_SERVER_SHUTDOWN
32    AT_CLEANUP])
33
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])
42    m4_if([$2], [], [],
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`])
48    OVSDB_SERVER_SHUTDOWN
49    AT_CLEANUP])
50
51 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
52 m4_define([OVSDB_CHECK_IDL_TCP_PY],
53   [AT_SETUP([$1 - Python tcp])
54    AT_SKIP_IF([test $HAVE_PYTHON = no])
55    AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
56    AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
57                   [0], [stdout], [ignore])
58    AT_CHECK([perl $srcdir/choose-port.pl], [0], [stdout])
59    TCP_PORT=`cat stdout`
60    AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:$TCP_PORT:127.0.0.1 --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
61    m4_if([$2], [], [],
62      [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore], [kill `cat pid`])])
63    AT_CHECK([$PYTHON $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
64             [0], [stdout], [ignore], [kill `cat pid`])
65    AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
66             [0], [$4], [], [kill `cat pid`])
67    OVSDB_SERVER_SHUTDOWN
68    AT_CLEANUP])
69
70 m4_define([OVSDB_CHECK_IDL],
71   [OVSDB_CHECK_IDL_C($@)
72    OVSDB_CHECK_IDL_PY($@)
73    OVSDB_CHECK_IDL_TCP_PY($@)])
74
75 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
76   [],
77   [],
78   [000: empty
79 001: done
80 ])
81
82 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
83   [],
84   [['["idltest",
85       {"op": "insert",
86        "table": "simple",
87        "row": {"i": 1,
88                "r": 2.0,
89                "b": true,
90                "s": "mystring",
91                "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
92                "ia": ["set", [1, 2, 3]],
93                "ra": ["set", [-0.5]],
94                "ba": ["set", [true]],
95                "sa": ["set", ["abc", "def"]],
96                "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
97                               ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
98       {"op": "insert",
99        "table": "simple",
100        "row": {}}]' \
101     '["idltest",
102       {"op": "update",
103        "table": "simple",
104        "where": [],
105        "row": {"b": true}}]' \
106     '["idltest",
107       {"op": "update",
108        "table": "simple",
109        "where": [],
110        "row": {"r": 123.5}}]' \
111     '["idltest",
112       {"op": "insert",
113        "table": "simple",
114        "row": {"i": -1,
115                "r": 125,
116                "b": false,
117                "s": "",
118                "ia": ["set", [1]],
119                "ra": ["set", [1.5]],
120                "ba": ["set", [false]],
121                "sa": ["set", []],
122                "ua": ["set", []]}}]' \
123     '["idltest",
124       {"op": "update",
125        "table": "simple",
126        "where": [["i", "<", 1]],
127        "row": {"s": "newstring"}}]' \
128     '["idltest",
129       {"op": "delete",
130        "table": "simple",
131        "where": [["i", "==", 0]]}]' \
132     'reconnect']],
133   [[000: empty
134 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
135 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
136 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>
137 003: {"error":null,"result":[{"count":2}]}
138 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
139 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>
140 005: {"error":null,"result":[{"count":2}]}
141 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
142 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>
143 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
144 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
145 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
146 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>
147 009: {"error":null,"result":[{"count":2}]}
148 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
149 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
150 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>
151 011: {"error":null,"result":[{"count":1}]}
152 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
153 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>
154 013: reconnect
155 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
156 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>
157 015: done
158 ]])
159
160 OVSDB_CHECK_IDL([simple idl, initially populated],
161   [['["idltest",
162       {"op": "insert",
163        "table": "simple",
164        "row": {"i": 1,
165                "r": 2.0,
166                "b": true,
167                "s": "mystring",
168                "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
169                "ia": ["set", [1, 2, 3]],
170                "ra": ["set", [-0.5]],
171                "ba": ["set", [true]],
172                "sa": ["set", ["abc", "def"]],
173                "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
174                               ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
175       {"op": "insert",
176        "table": "simple",
177        "row": {}}]']],
178   [['["idltest",
179       {"op": "update",
180        "table": "simple",
181        "where": [],
182        "row": {"b": true}}]']],
183   [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
184 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>
185 001: {"error":null,"result":[{"count":2}]}
186 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
187 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>
188 003: done
189 ]])
190
191 OVSDB_CHECK_IDL([simple idl, writing via IDL],
192   [['["idltest",
193       {"op": "insert",
194        "table": "simple",
195        "row": {"i": 1,
196                "r": 2.0,
197                "b": true,
198                "s": "mystring",
199                "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
200                "ia": ["set", [1, 2, 3]],
201                "ra": ["set", [-0.5]],
202                "ba": ["set", [true]],
203                "sa": ["set", ["abc", "def"]],
204                "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
205                               ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
206       {"op": "insert",
207        "table": "simple",
208        "row": {}}]']],
209   [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
210     'insert 2, verify 2 i, verify 1 b, delete 1']],
211   [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
212 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>
213 001: commit, status=success
214 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
215 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>
216 003: commit, status=success
217 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
218 004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
219 005: done
220 ]])
221
222 OVSDB_CHECK_IDL([simple idl, handling verification failure],
223   [['["idltest",
224       {"op": "insert",
225        "table": "simple",
226        "row": {"i": 1,
227                "r": 2.0}},
228       {"op": "insert",
229        "table": "simple",
230        "row": {}}]']],
231   [['set 0 b 1' \
232     '+["idltest",
233        {"op": "update",
234         "table": "simple",
235         "where": [["i", "==", 1]],
236         "row": {"r": 5.0}}]' \
237     '+verify 1 r, set 1 r 3' \
238     'verify 1 r, set 1 r 3' \
239     ]],
240   [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
241 000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
242 001: commit, status=success
243 002: {"error":null,"result":[{"count":1}]}
244 003: commit, status=try again
245 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
246 004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
247 005: commit, status=success
248 006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
249 006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
250 007: done
251 ]])
252
253 OVSDB_CHECK_IDL([simple idl, increment operation],
254   [['["idltest",
255       {"op": "insert",
256        "table": "simple",
257        "row": {}}]']],
258   [['set 0 r 2.0, increment 0']],
259   [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
260 001: commit, status=success, increment=1
261 002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
262 003: done
263 ]])
264
265 OVSDB_CHECK_IDL([simple idl, aborting],
266   [['["idltest",
267       {"op": "insert",
268        "table": "simple",
269        "row": {}}]']],
270   [['set 0 r 2.0, abort' \
271 '+set 0 b 1']],
272   [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
273 001: commit, status=aborted
274 002: commit, status=success
275 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
276 004: done
277 ]])
278
279 OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
280   [['["idltest",
281       {"op": "insert",
282        "table": "simple",
283        "row": {}}]']],
284   [['set 0 r 2.0, destroy' \
285 '+set 0 b 1']],
286   [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
287 001: destroy
288 002: commit, status=success
289 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
290 004: done
291 ]])
292
293 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
294   [],
295   [['["idltest",
296       {"op": "insert",
297        "table": "link1",
298        "row": {"i": 0, "k": ["named-uuid", "self"]},
299        "uuid-name": "self"}]' \
300     '["idltest",
301       {"op": "insert",
302        "table": "link1",
303        "row": {"i": 1, "k": ["named-uuid", "row2"]},
304        "uuid-name": "row1"},
305       {"op": "insert",
306        "table": "link1",
307        "row": {"i": 2, "k": ["named-uuid", "row1"]},
308        "uuid-name": "row2"}]' \
309     '["idltest",
310       {"op": "update",
311        "table": "link1",
312        "where": [["i", "==", 1]],
313        "row": {"k": ["uuid", "#1#"]}}]' \
314     '["idltest",
315       {"op": "update",
316        "table": "link1",
317        "where": [],
318        "row": {"k": ["uuid", "#0#"]}}]']],
319   [[000: empty
320 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
321 002: i=0 k=0 ka=[] l2= uuid=<0>
322 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
323 004: i=0 k=0 ka=[] l2= uuid=<0>
324 004: i=1 k=2 ka=[] l2= uuid=<1>
325 004: i=2 k=1 ka=[] l2= uuid=<2>
326 005: {"error":null,"result":[{"count":1}]}
327 006: i=0 k=0 ka=[] l2= uuid=<0>
328 006: i=1 k=1 ka=[] l2= uuid=<1>
329 006: i=2 k=1 ka=[] l2= uuid=<2>
330 007: {"error":null,"result":[{"count":3}]}
331 008: i=0 k=0 ka=[] l2= uuid=<0>
332 008: i=1 k=0 ka=[] l2= uuid=<1>
333 008: i=2 k=0 ka=[] l2= uuid=<2>
334 009: done
335 ]])
336
337 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
338   [],
339   [['["idltest",
340       {"op": "insert",
341        "table": "link1",
342        "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
343     '+["idltest",
344       {"op": "insert",
345        "table": "link1",
346        "uuid-name": "one",
347        "row": {"i": 1, "k": ["named-uuid", "one"]}},
348       {"op": "insert",
349        "table": "link1",
350        "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
351      '["idltest",
352       {"op": "update",
353        "table": "link1",
354        "where": [],
355        "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
356      '+["idltest",
357       {"op": "delete",
358        "table": "link1",
359        "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
360      '+["idltest",
361       {"op": "delete",
362        "table": "link1",
363        "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
364      '["idltest",
365       {"op": "delete",
366        "table": "link1",
367        "where": []}]' \
368 ]],
369   [[000: empty
370 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"}]}
371 002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
372 003: i=1 k=1 ka=[] l2= uuid=<2>
373 003: i=2 k=1 ka=[] l2= uuid=<3>
374 004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
375 005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
376 006: {"error":null,"result":[{"count":1}]}
377 007: i=1 k=1 ka=[] l2= uuid=<2>
378 008: {"error":null,"result":[{"count":1}]}
379 009: empty
380 010: done
381 ]],
382   [],
383   [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
384
385 OVSDB_CHECK_IDL([self-linking idl, sets],
386   [],
387   [['["idltest",
388       {"op": "insert",
389        "table": "link1",
390        "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
391        "uuid-name": "i0"},
392       {"op": "insert",
393        "table": "link1",
394        "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
395        "uuid-name": "i1"},
396       {"op": "insert",
397        "table": "link1",
398        "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
399        "uuid-name": "i2"},
400       {"op": "insert",
401        "table": "link1",
402        "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
403        "uuid-name": "i3"}]' \
404     '["idltest",
405       {"op": "update",
406        "table": "link1",
407        "where": [],
408        "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
409     '["idltest",
410       {"op": "update",
411        "table": "link1",
412        "where": [["i", "==", 2]],
413        "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
414     '+["idltest",
415       {"op": "delete",
416        "table": "link1",
417        "where": []}]']],
418   [[000: empty
419 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
420 002: i=0 k=0 ka=[0] l2= uuid=<0>
421 002: i=1 k=0 ka=[1] l2= uuid=<1>
422 002: i=2 k=0 ka=[2] l2= uuid=<2>
423 002: i=3 k=0 ka=[3] l2= uuid=<3>
424 003: {"error":null,"result":[{"count":4}]}
425 004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
426 004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
427 004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
428 004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
429 005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
430 006: {"error":null,"result":[{"count":4}]}
431 007: empty
432 008: done
433 ]])
434
435 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
436   [],
437   [['["idltest",
438       {"op": "insert",
439        "table": "link2",
440        "row": {"i": 0},
441        "uuid-name": "row0"},
442       {"op": "insert",
443        "table": "link1",
444        "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
445        "uuid-name": "row1"}]']],
446   [[000: empty
447 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
448 002: i=0 l1= uuid=<0>
449 002: i=1 k=1 ka=[] l2=0 uuid=<1>
450 003: done
451 ]])
452
453 OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
454   [],
455   [['linktest']],
456   [[000: empty
457 001: commit, status=success
458 002: i=1 k=1 ka=[1] l2= uuid=<0>
459 002: i=2 k=1 ka=[1 2] l2= uuid=<1>
460 003: done
461 ]])
462
463 OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
464   [],
465   [['getattrtest']],
466   [[000: empty
467 001: commit, status=success
468 002: i=2 k=2 ka=[] l2= uuid=<0>
469 003: done
470 ]])