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