]> git.proxmox.com Git - ovs.git/blob - tests/ovsdb-idl.at
ovsdb-idl: Change interface to conditional monitoring.
[ovs.git] / tests / ovsdb-idl.at
1 AT_BANNER([OVSDB -- interface description language (IDL)])
2
3 m4_divert_text([PREPARE_TESTS], [
4 # ovsdb_start_idltest [REMOTE] [SCHEMA]
5 #
6 # Creates a database using SCHEMA (default: idltest.ovsschema) and
7 # starts a database server listening on punix:socket and REMOTE (if
8 # specified).
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`'
13 }
14 ])
15
16 # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
17 # [FILTER])
18 #
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.
22 #
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.
30 #
31 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
32 m4_define([OVSDB_CHECK_IDL_C],
33 [AT_SETUP([$1 - C])
34 AT_KEYWORDS([ovsdb server idl positive $5])
35 AT_CHECK([ovsdb_start_idltest])
36 m4_if([$2], [], [],
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]]),
41 [0], [$4])
42 OVSDB_SERVER_SHUTDOWN
43 AT_CLEANUP])
44
45 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
46 m4_define([OVSDB_CHECK_IDL_PYN],
47 [AT_SETUP([$1])
48 AT_SKIP_IF([test $7 = no])
49 AT_KEYWORDS([ovsdb server idl positive Python $5])
50 AT_CHECK([ovsdb_start_idltest])
51 m4_if([$2], [], [],
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]]),
56 [0], [$4])
57 OVSDB_SERVER_SHUTDOWN
58 AT_CLEANUP])
59
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])])
65
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])
71 m4_if([$2], [], [],
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]]),
76 [0], [$4])
77 OVSDB_SERVER_SHUTDOWN
78 AT_CLEANUP])
79
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])])
85
86 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
87 m4_define([OVSDB_CHECK_IDL_TCP_PYN],
88 [AT_SETUP([$1 - tcp])
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])
93
94 m4_if([$2], [], [],
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]]),
99 [0], [$4])
100 OVSDB_SERVER_SHUTDOWN
101 AT_CLEANUP])
102
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])])
108
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"
119
120 m4_if([$2], [], [],
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]]),
125 [0], [$4])
126 OVSDB_SERVER_SHUTDOWN
127 AT_CLEANUP])
128
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])])
134
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($@)])
141
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])
147 # find free TCP port
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
151 rm -f db
152
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]]),
158 [0], [$4])
159 OVSDB_SERVER_SHUTDOWN
160 AT_CLEANUP
161 ])
162
163 OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
164 [],
165 [['["idltest",{"op":"select","table":"link1","where":[]}]']],
166 [[000: empty
167 001: {"error":null,"result":[{"rows":[]}]}
168 002: done
169 ]])
170
171 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
172 [],
173 [],
174 [000: empty
175 001: done
176 ])
177
178 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
179 [],
180 [['["idltest",
181 {"op": "insert",
182 "table": "simple",
183 "row": {"i": 1,
184 "r": 2.0,
185 "b": true,
186 "s": "mystring",
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"]]]}},
194 {"op": "insert",
195 "table": "simple",
196 "row": {}}]' \
197 '["idltest",
198 {"op": "update",
199 "table": "simple",
200 "where": [],
201 "row": {"b": true}}]' \
202 '["idltest",
203 {"op": "update",
204 "table": "simple",
205 "where": [],
206 "row": {"r": 123.5}}]' \
207 '["idltest",
208 {"op": "insert",
209 "table": "simple",
210 "row": {"i": -1,
211 "r": 125,
212 "b": false,
213 "s": "",
214 "ia": ["set", [1]],
215 "ra": ["set", [1.5]],
216 "ba": ["set", [false]],
217 "sa": ["set", []],
218 "ua": ["set", []]}}]' \
219 '["idltest",
220 {"op": "update",
221 "table": "simple",
222 "where": [["i", "<", 1]],
223 "row": {"s": "newstring"}}]' \
224 '["idltest",
225 {"op": "delete",
226 "table": "simple",
227 "where": [["i", "==", 0]]}]' \
228 'reconnect']],
229 [[000: empty
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>
250 013: reconnect
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>
253 015: done
254 ]])
255
256 OVSDB_CHECK_IDL([simple idl, initially populated],
257 [['["idltest",
258 {"op": "insert",
259 "table": "simple",
260 "row": {"i": 1,
261 "r": 2.0,
262 "b": true,
263 "s": "mystring",
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"]]]}},
271 {"op": "insert",
272 "table": "simple",
273 "row": {}}]']],
274 [['["idltest",
275 {"op": "update",
276 "table": "simple",
277 "where": [],
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>
284 003: done
285 ]])
286
287 OVSDB_CHECK_IDL([simple idl, writing via IDL],
288 [['["idltest",
289 {"op": "insert",
290 "table": "simple",
291 "row": {"i": 1,
292 "r": 2.0,
293 "b": true,
294 "s": "mystring",
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"]]]}},
302 {"op": "insert",
303 "table": "simple",
304 "row": {}}]']],
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>
315 005: done
316 ]])
317
318 OVSDB_CHECK_IDL([simple idl, handling verification failure],
319 [['["idltest",
320 {"op": "insert",
321 "table": "simple",
322 "row": {"i": 1,
323 "r": 2.0}},
324 {"op": "insert",
325 "table": "simple",
326 "row": {}}]']],
327 [['set 0 b 1' \
328 '+["idltest",
329 {"op": "update",
330 "table": "simple",
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' \
335 ]],
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>
346 007: done
347 ]])
348
349 OVSDB_CHECK_IDL([simple idl, increment operation],
350 [['["idltest",
351 {"op": "insert",
352 "table": "simple",
353 "row": {}}]']],
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>
358 003: done
359 ]])
360
361 OVSDB_CHECK_IDL([simple idl, aborting],
362 [['["idltest",
363 {"op": "insert",
364 "table": "simple",
365 "row": {}}]']],
366 [['set 0 r 2.0, abort' \
367 '+set 0 b 1']],
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>
372 004: done
373 ]])
374
375 OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
376 [['["idltest",
377 {"op": "insert",
378 "table": "simple",
379 "row": {}}]']],
380 [['set 0 r 2.0, destroy' \
381 '+set 0 b 1']],
382 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
383 001: destroy
384 002: commit, status=success
385 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
386 004: done
387 ]])
388
389 OVSDB_CHECK_IDL([simple idl, conditional, false condition],
390 [['["idltest",
391 {"op": "insert",
392 "table": "simple",
393 "row": {"i": 1,
394 "r": 2.0,
395 "b": true}}]']],
396 [['condition simple []' \
397 'condition simple [true]']],
398 [[000: change conditions
399 001: empty
400 002: change conditions
401 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
402 004: done
403 ]])
404
405 OVSDB_CHECK_IDL([simple idl, conditional, true condition],
406 [['["idltest",
407 {"op": "insert",
408 "table": "simple",
409 "row": {"i": 1,
410 "r": 2.0,
411 "b": true}}]']],
412 [['condition simple []' \
413 'condition simple [true]']],
414 [[000: change conditions
415 001: empty
416 002: change conditions
417 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
418 004: done
419 ]])
420
421 OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition],
422 [['["idltest",
423 {"op": "insert",
424 "table": "simple",
425 "row": {"i": 1,
426 "r": 2.0,
427 "b": true}},
428 {"op": "insert",
429 "table": "simple",
430 "row": {"i": 2,
431 "r": 3.0,
432 "b": true}}]']],
433 [['condition simple []' \
434 'condition simple [["i","==",1],["i","==",2]]']],
435 [[000: change conditions
436 001: empty
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>
440 004: done
441 ]])
442
443 OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition],
444 [['["idltest",
445 {"op": "insert",
446 "table": "simple",
447 "row": {"i": 1,
448 "r": 2.0,
449 "b": true}}]']],
450 [['condition simple []' \
451 'condition simple [["i","==",1]]']],
452 [[000: change conditions
453 001: empty
454 002: change conditions
455 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
456 004: done
457 ]])
458
459 OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition],
460 [['["idltest",
461 {"op": "insert",
462 "table": "simple",
463 "row": {"i": 1,
464 "r": 2.0,
465 "b": true}}]']],
466 [['condition simple []' \
467 'condition simple [["i","==",1],["i","==",2]]' \
468 'condition simple [["i","==",2]]' \
469 '["idltest",
470 {"op": "insert",
471 "table": "simple",
472 "row": {"i": 2,
473 "r": 3.0,
474 "b": true}}]']],
475 [[000: change conditions
476 001: empty
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
480 005: empty
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>
483 008: done
484 ]])
485
486 OVSDB_CHECK_IDL([simple idl, conditional, multiple tables],
487 [['["idltest",
488 {"op": "insert",
489 "table": "simple",
490 "row": {"i": 1,
491 "r": 2.0,
492 "b": true}},
493 {"op": "insert",
494 "table": "link1",
495 "row": {"i": 0, "k": ["named-uuid", "self"]},
496 "uuid-name": "self"},
497 {"op": "insert",
498 "table": "link2",
499 "row": {"i": 2},
500 "uuid-name": "row0"}]']],
501 [['condition simple [];link1 [];link2 []' \
502 'condition simple [["i","==",1]]' \
503 'condition link1 [["i","==",0]]' \
504 'condition link2 [["i","==",3]]' \
505 '+["idltest",
506 {"op": "insert",
507 "table": "link2",
508 "row": {"i": 3},
509 "uuid-name": "row0"}]']],
510 [[000: change conditions
511 001: empty
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>
522 009: done
523 ]])
524
525 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
526 [],
527 [['["idltest",
528 {"op": "insert",
529 "table": "link1",
530 "row": {"i": 0, "k": ["named-uuid", "self"]},
531 "uuid-name": "self"}]' \
532 '["idltest",
533 {"op": "insert",
534 "table": "link1",
535 "row": {"i": 1, "k": ["named-uuid", "row2"]},
536 "uuid-name": "row1"},
537 {"op": "insert",
538 "table": "link1",
539 "row": {"i": 2, "k": ["named-uuid", "row1"]},
540 "uuid-name": "row2"}]' \
541 '["idltest",
542 {"op": "update",
543 "table": "link1",
544 "where": [["i", "==", 1]],
545 "row": {"k": ["uuid", "#1#"]}}]' \
546 '["idltest",
547 {"op": "update",
548 "table": "link1",
549 "where": [],
550 "row": {"k": ["uuid", "#0#"]}}]']],
551 [[000: empty
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>
566 009: done
567 ]])
568
569 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
570 [],
571 [['["idltest",
572 {"op": "insert",
573 "table": "link1",
574 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
575 '+["idltest",
576 {"op": "insert",
577 "table": "link1",
578 "uuid-name": "one",
579 "row": {"i": 1, "k": ["named-uuid", "one"]}},
580 {"op": "insert",
581 "table": "link1",
582 "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
583 '["idltest",
584 {"op": "update",
585 "table": "link1",
586 "where": [],
587 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
588 '+["idltest",
589 {"op": "delete",
590 "table": "link1",
591 "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
592 '+["idltest",
593 {"op": "delete",
594 "table": "link1",
595 "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
596 '["idltest",
597 {"op": "delete",
598 "table": "link1",
599 "where": []}]' \
600 ]],
601 [[000: empty
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}]}
611 009: empty
612 010: done
613 ]],
614 [],
615 [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
616
617 OVSDB_CHECK_IDL([self-linking idl, sets],
618 [],
619 [['["idltest",
620 {"op": "insert",
621 "table": "link1",
622 "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
623 "uuid-name": "i0"},
624 {"op": "insert",
625 "table": "link1",
626 "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
627 "uuid-name": "i1"},
628 {"op": "insert",
629 "table": "link1",
630 "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
631 "uuid-name": "i2"},
632 {"op": "insert",
633 "table": "link1",
634 "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
635 "uuid-name": "i3"}]' \
636 '["idltest",
637 {"op": "update",
638 "table": "link1",
639 "where": [],
640 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
641 '["idltest",
642 {"op": "update",
643 "table": "link1",
644 "where": [["i", "==", 2]],
645 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
646 '+["idltest",
647 {"op": "delete",
648 "table": "link1",
649 "where": []}]']],
650 [[000: empty
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}]}
663 007: empty
664 008: done
665 ]])
666
667 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
668 [],
669 [['["idltest",
670 {"op": "insert",
671 "table": "link2",
672 "row": {"i": 0},
673 "uuid-name": "row0"},
674 {"op": "insert",
675 "table": "link1",
676 "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
677 "uuid-name": "row1"}]']],
678 [[000: empty
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>
682 003: done
683 ]])
684
685 OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
686 [],
687 [['linktest']],
688 [[000: empty
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>
692 003: done
693 ]])
694
695 OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
696 [],
697 [['getattrtest']],
698 [[000: empty
699 001: commit, status=success
700 002: i=2 k=2 ka=[] l2= uuid=<0>
701 003: done
702 ]])
703
704 OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
705 [['["idltest",
706 {"op": "insert",
707 "table": "simple",
708 "row": {"i": 1}},
709 {"op": "insert",
710 "table": "simple",
711 "row": {}}]']],
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>
718 003: done
719 ]])
720
721 AT_SETUP([idl handling of missing tables and columns - C])
722 AT_KEYWORDS([ovsdb server idl positive])
723
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",
730 {"op": "insert",
731 "table": "link1",
732 "row": {"i": 0, "k": ["named-uuid", "self"]},
733 "uuid-name": "self"}]' \
734 '["idltest",
735 {"op": "insert",
736 "table": "link1",
737 "row": {"i": 1, "k": ["named-uuid", "row2"]},
738 "uuid-name": "row1"},
739 {"op": "insert",
740 "table": "link1",
741 "row": {"i": 2, "k": ["named-uuid", "row1"]},
742 "uuid-name": "row2"}]' \
743 '["idltest",
744 {"op": "update",
745 "table": "link1",
746 "where": [["i", "==", 1]],
747 "row": {"k": ["uuid", "#1#"]}}]' \
748 '["idltest",
749 {"op": "update",
750 "table": "link1",
751 "where": [],
752 "row": {"k": ["uuid", "#0#"]}}]']],
753 [0], [stdout], [stderr])
754 AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0],
755 [[000: empty
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>
770 009: done
771 ]])
772
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?)
777 ])
778
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
781 # table and column.
782 AT_CHECK([grep -c '"monitor\|monitor_cond"' stderr], [0], [1
783 ])
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
787 ])
788 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
789 ])
790 OVSDB_SERVER_SHUTDOWN
791 AT_CLEANUP
792
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])
798 m4_if([$2], [], [],
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]]),
803 [0], [$5])
804 OVSDB_SERVER_SHUTDOWN
805 AT_CLEANUP])
806
807 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
808 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])
809
810 OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
811 [['["idltest",
812 {"op": "insert",
813 "table": "simple",
814 "row": {"i": 1,
815 "r": 2.0,
816 "b": true,
817 "s": "mystring",
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"]]]}},
825 {"op": "insert",
826 "table": "simple",
827 "row": {}}]']],
828 [?simple:i,r!],
829 ['fetch 0 r'],
830 [[000: i=0 uuid=<0>
831 000: i=1 uuid=<1>
832 001: commit, status=success
833 002: i=0 r=0 uuid=<0>
834 002: i=1 uuid=<1>
835 003: done
836 ]])
837
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
849 AT_CLEANUP])
850
851
852 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
853 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])
854
855
856 OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond],
857 [['["idltest",
858 {"op": "insert",
859 "table": "simple",
860 "row": {"i": 1,
861 "r": 2.0,
862 "b": true,
863 "s": "mystring",
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"]]]}},
871 {"op": "insert",
872 "table": "simple",
873 "row": {}}]' \
874 '["idltest",
875 {"op": "update",
876 "table": "simple",
877 "where": [],
878 "row": {"b": true}}]' \
879 '["idltest",
880 {"op": "update",
881 "table": "simple",
882 "where": [],
883 "row": {"r": 123.5}}]' \
884 '["idltest",
885 {"op": "insert",
886 "table": "simple",
887 "row": {"i": -1,
888 "r": 125,
889 "b": false,
890 "s": "",
891 "ia": ["set", [1]],
892 "ra": ["set", [1.5]],
893 "ba": ["set", [false]],
894 "sa": ["set", []],
895 "ua": ["set", []]}}]' \
896 '["idltest",
897 {"op": "update",
898 "table": "simple",
899 "where": [["i", "<", 1]],
900 "row": {"s": "newstring"}}]' \
901 '["idltest",
902 {"op": "delete",
903 "table": "simple",
904 "where": [["i", "==", 0]]}]' \
905 'reconnect']],
906 [[000: empty
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>
927 013: reconnect
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>
930 015: done
931 ]])
932
933 m4_define([OVSDB_CHECK_IDL_TRACK_C],
934 [AT_SETUP([$1 - C])
935 AT_KEYWORDS([ovsdb server idl tracking positive $5])
936 AT_CHECK([ovsdb_start_idltest])
937 m4_if([$2], [], [],
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]]),
942 [0], [$4])
943 OVSDB_SERVER_SHUTDOWN
944 AT_CLEANUP])
945
946 m4_define([OVSDB_CHECK_IDL_TRACK],
947 [OVSDB_CHECK_IDL_TRACK_C($@)])
948
949 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated],
950 [['["idltest",
951 {"op": "insert",
952 "table": "simple",
953 "row": {"i": 1,
954 "r": 2.0,
955 "b": true,
956 "s": "mystring",
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"]]]}},
964 {"op": "insert",
965 "table": "simple",
966 "row": {}}]']],
967 [['["idltest",
968 {"op": "update",
969 "table": "simple",
970 "where": [],
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
978 003: done
979 ]])
980
981 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
982 [],
983 [['["idltest",
984 {"op": "insert",
985 "table": "simple",
986 "row": {"i": 1,
987 "r": 2.0,
988 "b": true,
989 "s": "mystring",
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"]]]}},
997 {"op": "insert",
998 "table": "simple",
999 "row": {}}]' \
1000 '["idltest",
1001 {"op": "update",
1002 "table": "simple",
1003 "where": [],
1004 "row": {"b": true}}]' \
1005 '["idltest",
1006 {"op": "update",
1007 "table": "simple",
1008 "where": [],
1009 "row": {"r": 123.5}}]' \
1010 '["idltest",
1011 {"op": "insert",
1012 "table": "simple",
1013 "row": {"i": -1,
1014 "r": 125,
1015 "b": false,
1016 "s": "",
1017 "ia": ["set", [1]],
1018 "ra": ["set", [1.5]],
1019 "ba": ["set", [false]],
1020 "sa": ["set", []],
1021 "ua": ["set", []]}}]' \
1022 '["idltest",
1023 {"op": "update",
1024 "table": "simple",
1025 "where": [["i", "<", 1]],
1026 "row": {"s": "newstring"}}]' \
1027 '["idltest",
1028 {"op": "delete",
1029 "table": "simple",
1030 "where": [["i", "==", 0]]}]' \
1031 'reconnect']],
1032 [[000: empty
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>
1054 013: reconnect
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
1059 015: done
1060 ]])
1061
1062 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN],
1063 [AT_SETUP([$1 - C])
1064 AT_KEYWORDS([ovsdb server idl partial update map column positive $5])
1065 AT_CHECK([ovsdb_start_idltest])
1066 m4_if([$2], [], [],
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]]),
1071 [0], [$4])
1072 OVSDB_SERVER_SHUTDOWN
1073 AT_CLEANUP])
1074
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"]]]} }]']
1078 ],
1079 [],
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]]
1090 010: End test
1091 ]])
1092
1093 OVSDB_CHECK_IDL_PY([partial-map idl],
1094 [['["idltest", {"op":"insert", "table":"simple2",
1095 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
1096 ],
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=[]
1108 009: done
1109 ]])
1110
1111 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN],
1112 [AT_SETUP([$1 - C])
1113 AT_KEYWORDS([ovsdb server idl partial update set column positive $5])
1114 AT_CHECK([ovsdb_start_idltest])
1115 m4_if([$2], [], [],
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]]),
1120 [0], [$4])
1121 OVSDB_SERVER_SHUTDOWN
1122 AT_CLEANUP])
1123
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" ]]]} }]']
1127 ],
1128 [],
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>]]
1141 012: End test
1142 ]])
1143
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"]]]]]}]']
1150 ],
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>]
1168 015: done
1169 ]])
1170
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
1181 AT_CLEANUP])
1182
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
1188 SSL_PRESENT=$?
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 \
1195 --pidfile \
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
1209 AT_CLEANUP])
1210
1211 m4_define([OVSDB_CHECK_IDL_NOTIFY],
1212 [OVSDB_CHECK_IDL_NOTIFY_PY($@)
1213 OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])
1214
1215 OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
1216 [['track-notify' \
1217 '["idltest",
1218 {"op": "insert",
1219 "table": "simple",
1220 "row": {"i": 1,
1221 "r": 2.0,
1222 "b": true,
1223 "s": "mystring",
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"]]]}},
1231 {"op": "insert",
1232 "table": "simple",
1233 "row": {}}]' \
1234 '["idltest",
1235 {"op": "update",
1236 "table": "simple",
1237 "where": [],
1238 "row": {"b": false}}]' \
1239 '["idltest",
1240 {"op": "update",
1241 "table": "simple",
1242 "where": [],
1243 "row": {"r": 123.5}}]' \
1244 '["idltest",
1245 {"op": "insert",
1246 "table": "simple",
1247 "row": {"i": -1,
1248 "r": 125,
1249 "b": false,
1250 "s": "",
1251 "ia": ["set", [1]],
1252 "ra": ["set", [1.5]],
1253 "ba": ["set", [false]],
1254 "sa": ["set", []],
1255 "ua": ["set", []]}}]' \
1256 '["idltest",
1257 {"op": "update",
1258 "table": "simple",
1259 "where": [["i", "<", 1]],
1260 "row": {"s": "newstring"}}]' \
1261 '["idltest",
1262 {"op": "delete",
1263 "table": "simple",
1264 "where": [["i", "==", 0]]}]' \
1265 'reconnect']],
1266 [[000: empty
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>
1296 013: reconnect
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>
1301 015: done
1302 ]])