]> git.proxmox.com Git - mirror_ovs.git/blob - tests/ovsdb-idl.at
775bc090442bd937526a29ddccaf6c0694d4e8b4
[mirror_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 | uuidfilt]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 | uuidfilt]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_PYTHON2], [$PYTHON2])
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?singleton:name $3],
74 [0], [stdout], [ignore])
75 AT_CHECK([sort stdout | uuidfilt]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_PYTHON2], [$PYTHON2])
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 | uuidfilt]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_PYTHON2], [$PYTHON2])
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 tcp
110 # with multiple remotes with only one remote reachable
111 m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN],
112 [AT_SETUP([$1 - tcp])
113 AT_SKIP_IF([test $7 = no])
114 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
115 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
116 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
117 WRONG_PORT_1=$((TCP_PORT + 1))
118 WRONG_PORT_2=$((TCP_PORT + 2))
119 remote=tcp:127.0.0.1:$WRONG_PORT_1,tcp:127.0.0.1:$TCP_PORT,tcp:127.0.0.1:$WRONG_PORT_2
120 m4_if([$2], [], [],
121 [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])])
122 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema $remote $3],
123 [0], [stdout], [ignore])
124 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
125 [0], [$4])
126 OVSDB_SERVER_SHUTDOWN
127 AT_CLEANUP])
128
129 m4_define([OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY],
130 [OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python2 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
131 [$HAVE_PYTHON], [$PYTHON])
132 OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PYN([$1 - Python3 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
133 [$HAVE_PYTHON3], [$PYTHON3])])
134
135 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
136 m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
137 [AT_SETUP([$1 - tcp6])
138 AT_SKIP_IF([test $7 = no])
139 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
140 AT_SKIP_IF([test $HAVE_IPV6 = no])
141 AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
142 AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
143 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
144 echo "TCP_PORT=$TCP_PORT"
145
146 m4_if([$2], [], [],
147 [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
148 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
149 [0], [stdout], [ignore])
150 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
151 [0], [$4])
152 OVSDB_SERVER_SHUTDOWN
153 AT_CLEANUP])
154
155 m4_define([OVSDB_CHECK_IDL_TCP6_PY],
156 [OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
157 [$HAVE_PYTHON2], [$PYTHON2])
158 OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
159 [$HAVE_PYTHON3], [$PYTHON3])])
160
161 m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN],
162 [AT_SETUP([$1 - tcp6])
163 AT_SKIP_IF([test $7 = no])
164 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
165 AT_SKIP_IF([test $HAVE_IPV6 = no])
166 AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
167 AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
168 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
169 WRONG_PORT_1=$((TCP_PORT + 1))
170 WRONG_PORT_2=$((TCP_PORT + 2))
171 remote="tcp:[[::1]]:$WRONG_PORT_1,tcp:[[::1]]:$TCP_PORT,tcp:[[::1]]:$WRONG_PORT_2"
172 m4_if([$2], [], [],
173 [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
174 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema $remote $3],
175 [0], [stdout], [ignore])
176 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
177 [0], [$4])
178 OVSDB_SERVER_SHUTDOWN
179 AT_CLEANUP])
180
181 m4_define([OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY],
182 [OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python2 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
183 [$HAVE_PYTHON], [$PYTHON])
184 OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PYN([$1 - Python3 (multiple remotes)], [$2], [$3], [$4], [$5], [$6],
185 [$HAVE_PYTHON3], [$PYTHON3])])
186
187 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with SSL
188 m4_define([OVSDB_CHECK_IDL_SSL_PYN],
189 [AT_SETUP([$1 - SSL])
190 AT_SKIP_IF([test "$HAVE_OPENSSL" = no])
191 AT_SKIP_IF([test $7 = no])
192 $8 -c "import OpenSSL.SSL"
193 SSL_PRESENT=$?
194 AT_SKIP_IF([test $SSL_PRESENT != 0])
195 AT_KEYWORDS([ovsdb server idl positive Python with ssl socket $5])
196 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
197 [0], [stdout], [ignore])
198 PKIDIR=$abs_top_builddir/tests
199 AT_CHECK([ovsdb-server -vconsole:warn --log-file --detach --no-chdir \
200 --pidfile \
201 --private-key=$PKIDIR/testpki-privkey2.pem \
202 --certificate=$PKIDIR/testpki-cert2.pem \
203 --ca-cert=$PKIDIR/testpki-cacert.pem \
204 --remote=pssl:0:127.0.0.1 db])
205 on_exit 'kill `cat ovsdb-server.pid`'
206 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
207 m4_if([$2], [], [],
208 [AT_CHECK([ovsdb-client \
209 --private-key=$PKIDIR/testpki-privkey2.pem \
210 --certificate=$PKIDIR/testpki-cert2.pem \
211 --ca-cert=$PKIDIR/testpki-cacert.pem \
212 transact "ssl:127.0.0.1:$TCP_PORT" $2], [0], [ignore], [ignore])])
213 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema \
214 ssl:127.0.0.1:$TCP_PORT $PKIDIR/testpki-privkey.pem \
215 $PKIDIR/testpki-cert.pem $PKIDIR/testpki-cacert.pem $3],
216 [0], [stdout], [ignore])
217 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
218 [0], [$4])
219 OVSDB_SERVER_SHUTDOWN
220 AT_CLEANUP])
221
222 m4_define([OVSDB_CHECK_IDL_SSL_PY],
223 [OVSDB_CHECK_IDL_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
224 [$HAVE_PYTHON], [$PYTHON])
225 OVSDB_CHECK_IDL_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
226 [$HAVE_PYTHON3], [$PYTHON3])])
227
228 m4_define([OVSDB_CHECK_IDL],
229 [OVSDB_CHECK_IDL_C($@)
230 OVSDB_CHECK_IDL_PY($@)
231 OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY($@)
232 OVSDB_CHECK_IDL_TCP_PY($@)
233 OVSDB_CHECK_IDL_TCP_MULTIPLE_REMOTES_PY($@)
234 OVSDB_CHECK_IDL_TCP6_PY($@)
235 OVSDB_CHECK_IDL_TCP6_MULTIPLE_REMOTES_PY($@)
236 OVSDB_CHECK_IDL_SSL_PY($@)])
237
238 # This test uses the Python IDL implementation with passive tcp
239 m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
240 [AT_SETUP([$1 ptcp])
241 AT_SKIP_IF([test $7 = no])
242 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
243 # find free TCP port
244 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
245 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
246 OVSDB_SERVER_SHUTDOWN
247 rm -f db
248
249 # start OVSDB server in passive mode
250 AT_CHECK([ovsdb_start_idltest "tcp:127.0.0.1:$TCP_PORT"])
251 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
252 [0], [stdout], [ignore])
253 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
254 [0], [$4])
255 OVSDB_SERVER_SHUTDOWN
256 AT_CLEANUP
257 ])
258
259 m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
260 [OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
261 [$HAVE_PYTHON2], [$PYTHON2])
262 OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
263 [$HAVE_PYTHON3], [$PYTHON3])])
264
265 OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
266 [],
267 [['["idltest",{"op":"select","table":"link1","where":[]}]']],
268 [[000: empty
269 001: {"error":null,"result":[{"rows":[]}]}
270 002: done
271 ]])
272
273 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
274 [],
275 [],
276 [000: empty
277 001: done
278 ])
279
280 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
281 [],
282 [['["idltest",
283 {"op": "insert",
284 "table": "simple",
285 "row": {"i": 1,
286 "r": 2.0,
287 "b": true,
288 "s": "mystring",
289 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
290 "ia": ["set", [1, 2, 3]],
291 "ra": ["set", [-0.5]],
292 "ba": ["set", [true]],
293 "sa": ["set", ["abc", "def"]],
294 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
295 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
296 {"op": "insert",
297 "table": "simple",
298 "row": {}}]' \
299 '["idltest",
300 {"op": "update",
301 "table": "simple",
302 "where": [],
303 "row": {"b": true}}]' \
304 '["idltest",
305 {"op": "update",
306 "table": "simple",
307 "where": [],
308 "row": {"r": 123.5}}]' \
309 '["idltest",
310 {"op": "insert",
311 "table": "simple",
312 "row": {"i": -1,
313 "r": 125,
314 "b": false,
315 "s": "",
316 "ia": ["set", [1]],
317 "ra": ["set", [1.5]],
318 "ba": ["set", [false]],
319 "sa": ["set", []],
320 "ua": ["set", []]}}]' \
321 '["idltest",
322 {"op": "update",
323 "table": "simple",
324 "where": [["i", "<", 1]],
325 "row": {"s": "newstring"}}]' \
326 '["idltest",
327 {"op": "delete",
328 "table": "simple",
329 "where": [["i", "==", 0]]}]' \
330 'reconnect']],
331 [[000: empty
332 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
333 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
334 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>
335 003: {"error":null,"result":[{"count":2}]}
336 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
337 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>
338 005: {"error":null,"result":[{"count":2}]}
339 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
340 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>
341 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
342 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
343 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
344 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>
345 009: {"error":null,"result":[{"count":2}]}
346 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
347 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
348 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>
349 011: {"error":null,"result":[{"count":1}]}
350 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
351 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>
352 013: reconnect
353 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
354 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>
355 015: done
356 ]])
357
358 OVSDB_CHECK_IDL([simple idl, initially populated],
359 [['["idltest",
360 {"op": "insert",
361 "table": "simple",
362 "row": {"i": 1,
363 "r": 2.0,
364 "b": true,
365 "s": "mystring",
366 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
367 "ia": ["set", [1, 2, 3]],
368 "ra": ["set", [-0.5]],
369 "ba": ["set", [true]],
370 "sa": ["set", ["abc", "def"]],
371 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
372 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
373 {"op": "insert",
374 "table": "simple",
375 "row": {}}]']],
376 [['["idltest",
377 {"op": "update",
378 "table": "simple",
379 "where": [],
380 "row": {"b": true}}]']],
381 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
382 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>
383 001: {"error":null,"result":[{"count":2}]}
384 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
385 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>
386 003: done
387 ]])
388
389 OVSDB_CHECK_IDL([simple idl, writing via IDL],
390 [['["idltest",
391 {"op": "insert",
392 "table": "simple",
393 "row": {"i": 1,
394 "r": 2.0,
395 "b": true,
396 "s": "mystring",
397 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
398 "ia": ["set", [1, 2, 3]],
399 "ra": ["set", [-0.5]],
400 "ba": ["set", [true]],
401 "sa": ["set", ["abc", "def"]],
402 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
403 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
404 {"op": "insert",
405 "table": "simple",
406 "row": {}}]']],
407 [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
408 'insert 2, verify 2 i, verify 1 b, delete 1']],
409 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
410 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>
411 001: commit, status=success
412 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
413 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>
414 003: commit, status=success
415 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
416 004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
417 005: done
418 ]])
419
420 OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode],
421 [['["idltest",
422 {"op": "insert",
423 "table": "simple",
424 "row": {"s": "(╯°□°)╯︵ ┻━┻"}}]']],
425 [['set 0 b 1, insert 1, set 1 s "¯\_(ツ)_/¯"']],
426 [[000: i=0 r=0 b=false s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
427 001: commit, status=success
428 002: i=0 r=0 b=true s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
429 002: i=1 r=0 b=false s="¯\_(ツ)_/¯" u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
430 003: done
431 ]])
432
433 m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
434 [AT_SETUP([$1])
435 AT_SKIP_IF([test $7 = no])
436 AT_KEYWORDS([ovsdb server idl positive Python $5])
437 AT_CHECK([ovsdb_start_idltest])
438 m4_if([$2], [], [],
439 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
440 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
441 [0], [stdout], [ignore])
442 echo "$4" > expout
443 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
444 [0], [expout])
445 OVSDB_SERVER_SHUTDOWN
446 AT_CLEANUP])
447
448 m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT],
449 [OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
450 [$HAVE_PYTHON2], [$PYTHON2])
451 OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
452 [$HAVE_PYTHON3], [$PYTHON3])])
453
454 OVSDB_CHECK_IDL_PY_WITH_EXPOUT([simple idl, writing large data via IDL with unicode],
455 [['["idltest",
456 {"op": "insert",
457 "table": "simple",
458 "row": {"s": "'$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50})'"}}]']],
459 [['set 0 b 1, insert 1, set 1 s '$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100})'']],
460 [[000: i=0 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
461 001: commit, status=success
462 002: i=0 r=0 b=true s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
463 002: i=1 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
464 003: done]])
465
466 OVSDB_CHECK_IDL([simple idl, handling verification failure],
467 [['["idltest",
468 {"op": "insert",
469 "table": "simple",
470 "row": {"i": 1,
471 "r": 2.0}},
472 {"op": "insert",
473 "table": "simple",
474 "row": {}}]']],
475 [['set 0 b 1' \
476 '+["idltest",
477 {"op": "update",
478 "table": "simple",
479 "where": [["i", "==", 1]],
480 "row": {"r": 5.0}}]' \
481 '+verify 1 r, set 1 r 3' \
482 'verify 1 r, set 1 r 3' \
483 ]],
484 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
485 000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
486 001: commit, status=success
487 002: {"error":null,"result":[{"count":1}]}
488 003: commit, status=try again
489 004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
490 004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
491 005: commit, status=success
492 006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
493 006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
494 007: done
495 ]])
496
497 OVSDB_CHECK_IDL([simple idl, increment operation],
498 [['["idltest",
499 {"op": "insert",
500 "table": "simple",
501 "row": {}}]']],
502 [['set 0 r 2.0, increment 0']],
503 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
504 001: commit, status=success, increment=1
505 002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
506 003: done
507 ]])
508
509 OVSDB_CHECK_IDL([simple idl, aborting],
510 [['["idltest",
511 {"op": "insert",
512 "table": "simple",
513 "row": {}}]']],
514 [['set 0 r 2.0, abort' \
515 '+set 0 b 1']],
516 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
517 001: commit, status=aborted
518 002: commit, status=success
519 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
520 004: done
521 ]])
522
523 OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
524 [['["idltest",
525 {"op": "insert",
526 "table": "simple",
527 "row": {}}]']],
528 [['set 0 r 2.0, destroy' \
529 '+set 0 b 1']],
530 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
531 001: destroy
532 002: commit, status=success
533 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
534 004: done
535 ]])
536
537 OVSDB_CHECK_IDL([simple idl, conditional, false condition],
538 [['["idltest",
539 {"op": "insert",
540 "table": "simple",
541 "row": {"i": 1,
542 "r": 2.0,
543 "b": true}}]']],
544 [['condition simple []' \
545 'condition simple [true]']],
546 [[000: change conditions
547 001: empty
548 002: change conditions
549 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
550 004: done
551 ]])
552
553 OVSDB_CHECK_IDL([simple idl, conditional, true condition],
554 [['["idltest",
555 {"op": "insert",
556 "table": "simple",
557 "row": {"i": 1,
558 "r": 2.0,
559 "b": true}}]']],
560 [['condition simple []' \
561 'condition simple [true]']],
562 [[000: change conditions
563 001: empty
564 002: change conditions
565 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
566 004: done
567 ]])
568
569 OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition],
570 [['["idltest",
571 {"op": "insert",
572 "table": "simple",
573 "row": {"i": 1,
574 "r": 2.0,
575 "b": true}},
576 {"op": "insert",
577 "table": "simple",
578 "row": {"i": 2,
579 "r": 3.0,
580 "b": true}}]']],
581 [['condition simple []' \
582 'condition simple [["i","==",1],["i","==",2]]']],
583 [[000: change conditions
584 001: empty
585 002: change conditions
586 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
587 003: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
588 004: done
589 ]])
590
591 OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition],
592 [['["idltest",
593 {"op": "insert",
594 "table": "simple",
595 "row": {"i": 1,
596 "r": 2.0,
597 "b": true}}]']],
598 [['condition simple []' \
599 'condition simple [["i","==",1]]']],
600 [[000: change conditions
601 001: empty
602 002: change conditions
603 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
604 004: done
605 ]])
606
607 OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition],
608 [['["idltest",
609 {"op": "insert",
610 "table": "simple",
611 "row": {"i": 1,
612 "r": 2.0,
613 "b": true}}]']],
614 [['condition simple []' \
615 'condition simple [["i","==",1],["i","==",2]]' \
616 'condition simple [["i","==",2]]' \
617 '["idltest",
618 {"op": "insert",
619 "table": "simple",
620 "row": {"i": 2,
621 "r": 3.0,
622 "b": true}}]']],
623 [[000: change conditions
624 001: empty
625 002: change conditions
626 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
627 004: change conditions
628 005: empty
629 006: {"error":null,"result":[{"uuid":["uuid","<2>"]}]}
630 007: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
631 008: done
632 ]])
633
634 OVSDB_CHECK_IDL([simple idl, conditional, multiple tables],
635 [['["idltest",
636 {"op": "insert",
637 "table": "simple",
638 "row": {"i": 1,
639 "r": 2.0,
640 "b": true}},
641 {"op": "insert",
642 "table": "link1",
643 "row": {"i": 0, "k": ["named-uuid", "self"]},
644 "uuid-name": "self"},
645 {"op": "insert",
646 "table": "link2",
647 "row": {"i": 2},
648 "uuid-name": "row0"}]']],
649 [['condition simple [];link1 [];link2 []' \
650 'condition simple [["i","==",1]]' \
651 'condition link1 [["i","==",0]]' \
652 'condition link2 [["i","==",3]]' \
653 '+["idltest",
654 {"op": "insert",
655 "table": "link2",
656 "row": {"i": 3},
657 "uuid-name": "row0"}]']],
658 [[000: change conditions
659 001: empty
660 002: change conditions
661 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
662 004: change conditions
663 005: i=0 k=0 ka=[] l2= uuid=<2>
664 005: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
665 006: change conditions
666 007: {"error":null,"result":[{"uuid":["uuid","<3>"]}]}
667 008: i=0 k=0 ka=[] l2= uuid=<2>
668 008: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
669 008: i=3 l1= uuid=<3>
670 009: done
671 ]])
672
673 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
674 [],
675 [['["idltest",
676 {"op": "insert",
677 "table": "link1",
678 "row": {"i": 0, "k": ["named-uuid", "self"]},
679 "uuid-name": "self"}]' \
680 '["idltest",
681 {"op": "insert",
682 "table": "link1",
683 "row": {"i": 1, "k": ["named-uuid", "row2"]},
684 "uuid-name": "row1"},
685 {"op": "insert",
686 "table": "link1",
687 "row": {"i": 2, "k": ["named-uuid", "row1"]},
688 "uuid-name": "row2"}]' \
689 '["idltest",
690 {"op": "update",
691 "table": "link1",
692 "where": [["i", "==", 1]],
693 "row": {"k": ["uuid", "#1#"]}}]' \
694 '["idltest",
695 {"op": "update",
696 "table": "link1",
697 "where": [],
698 "row": {"k": ["uuid", "#0#"]}}]']],
699 [[000: empty
700 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
701 002: i=0 k=0 ka=[] l2= uuid=<0>
702 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
703 004: i=0 k=0 ka=[] l2= uuid=<0>
704 004: i=1 k=2 ka=[] l2= uuid=<1>
705 004: i=2 k=1 ka=[] l2= uuid=<2>
706 005: {"error":null,"result":[{"count":1}]}
707 006: i=0 k=0 ka=[] l2= uuid=<0>
708 006: i=1 k=1 ka=[] l2= uuid=<1>
709 006: i=2 k=1 ka=[] l2= uuid=<2>
710 007: {"error":null,"result":[{"count":3}]}
711 008: i=0 k=0 ka=[] l2= uuid=<0>
712 008: i=1 k=0 ka=[] l2= uuid=<1>
713 008: i=2 k=0 ka=[] l2= uuid=<2>
714 009: done
715 ]])
716
717 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
718 [],
719 [['["idltest",
720 {"op": "insert",
721 "table": "link1",
722 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
723 '+["idltest",
724 {"op": "insert",
725 "table": "link1",
726 "uuid-name": "one",
727 "row": {"i": 1, "k": ["named-uuid", "one"]}},
728 {"op": "insert",
729 "table": "link1",
730 "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
731 '["idltest",
732 {"op": "update",
733 "table": "link1",
734 "where": [],
735 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
736 '+["idltest",
737 {"op": "delete",
738 "table": "link1",
739 "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
740 '+["idltest",
741 {"op": "delete",
742 "table": "link1",
743 "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
744 '["idltest",
745 {"op": "delete",
746 "table": "link1",
747 "where": []}]' \
748 ]],
749 [[000: empty
750 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"}]}
751 002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
752 003: i=1 k=1 ka=[] l2= uuid=<2>
753 003: i=2 k=1 ka=[] l2= uuid=<3>
754 004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
755 005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
756 006: {"error":null,"result":[{"count":1}]}
757 007: i=1 k=1 ka=[] l2= uuid=<2>
758 008: {"error":null,"result":[{"count":1}]}
759 009: empty
760 010: done
761 ]],
762 [],
763 [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
764
765 OVSDB_CHECK_IDL([self-linking idl, sets],
766 [],
767 [['["idltest",
768 {"op": "insert",
769 "table": "link1",
770 "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
771 "uuid-name": "i0"},
772 {"op": "insert",
773 "table": "link1",
774 "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
775 "uuid-name": "i1"},
776 {"op": "insert",
777 "table": "link1",
778 "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
779 "uuid-name": "i2"},
780 {"op": "insert",
781 "table": "link1",
782 "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
783 "uuid-name": "i3"}]' \
784 '["idltest",
785 {"op": "update",
786 "table": "link1",
787 "where": [],
788 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
789 '["idltest",
790 {"op": "update",
791 "table": "link1",
792 "where": [["i", "==", 2]],
793 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
794 '+["idltest",
795 {"op": "delete",
796 "table": "link1",
797 "where": []}]']],
798 [[000: empty
799 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
800 002: i=0 k=0 ka=[0] l2= uuid=<0>
801 002: i=1 k=0 ka=[1] l2= uuid=<1>
802 002: i=2 k=0 ka=[2] l2= uuid=<2>
803 002: i=3 k=0 ka=[3] l2= uuid=<3>
804 003: {"error":null,"result":[{"count":4}]}
805 004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
806 004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
807 004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
808 004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
809 005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
810 006: {"error":null,"result":[{"count":4}]}
811 007: empty
812 008: done
813 ]])
814
815 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
816 [],
817 [['["idltest",
818 {"op": "insert",
819 "table": "link2",
820 "row": {"i": 0},
821 "uuid-name": "row0"},
822 {"op": "insert",
823 "table": "link1",
824 "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
825 "uuid-name": "row1"}]']],
826 [[000: empty
827 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
828 002: i=0 l1= uuid=<0>
829 002: i=1 k=1 ka=[] l2=0 uuid=<1>
830 003: done
831 ]])
832
833 OVSDB_CHECK_IDL([singleton idl, constraints],
834 [],
835 [['["idltest",
836 {"op": "insert",
837 "table": "singleton",
838 "row": {"name": "foo"}}]' \
839 '["idltest",
840 {"op": "insert",
841 "table": "singleton",
842 "row": {"name": "bar"}}]' \
843 '+["idltest",
844 {"op": "delete",
845 "table": "singleton",
846 "where": [["_uuid", "==", ["uuid", "#0#"]]]},
847 {"op": "insert",
848 "table": "singleton",
849 "row": {"name": "bar"}}]']],
850 [[000: empty
851 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
852 002: name=foo uuid=<0>
853 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"details":"transaction causes \"singleton\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)","error":"constraint violation"}]}
854 004: {"error":null,"result":[{"count":1},{"uuid":["uuid","<2>"]}]}
855 005: name=bar uuid=<2>
856 006: done
857 ]])
858
859 OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
860 [],
861 [['linktest']],
862 [[000: empty
863 001: commit, status=success
864 002: i=1 k=1 ka=[1] l2= uuid=<0>
865 002: i=2 k=1 ka=[1 2] l2= uuid=<1>
866 003: done
867 ]])
868
869 OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
870 [],
871 [['getattrtest']],
872 [[000: empty
873 001: commit, status=success
874 002: i=2 k=2 ka=[] l2= uuid=<0>
875 003: done
876 ]])
877
878 OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
879 [['["idltest",
880 {"op": "insert",
881 "table": "simple",
882 "row": {"i": 1}},
883 {"op": "insert",
884 "table": "simple",
885 "row": {}}]']],
886 [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']],
887 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
888 000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
889 001: commit, status=success, events=create|2|None, delete|0|None, update|1|b
890 002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
891 002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>
892 003: done
893 ]])
894
895 AT_SETUP([idl handling of missing tables and columns - C])
896 AT_KEYWORDS([ovsdb server idl positive])
897
898 # idltest2.ovsschema is the same as idltest.ovsschema, except that
899 # table link2 and column l2 have been deleted. But the IDL still
900 # expects them to be there, so this test checks that it properly
901 # tolerates them being missing.
902 AT_CHECK([ovsdb_start_idltest "" "$abs_srcdir/idltest2.ovsschema"])
903 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest",
904 {"op": "insert",
905 "table": "link1",
906 "row": {"i": 0, "k": ["named-uuid", "self"]},
907 "uuid-name": "self"}]' \
908 '["idltest",
909 {"op": "insert",
910 "table": "link1",
911 "row": {"i": 1, "k": ["named-uuid", "row2"]},
912 "uuid-name": "row1"},
913 {"op": "insert",
914 "table": "link1",
915 "row": {"i": 2, "k": ["named-uuid", "row1"]},
916 "uuid-name": "row2"}]' \
917 '["idltest",
918 {"op": "update",
919 "table": "link1",
920 "where": [["i", "==", 1]],
921 "row": {"k": ["uuid", "#1#"]}}]' \
922 '["idltest",
923 {"op": "update",
924 "table": "link1",
925 "where": [],
926 "row": {"k": ["uuid", "#0#"]}}]']],
927 [0], [stdout], [stderr])
928 AT_CHECK([sort stdout | uuidfilt], [0],
929 [[000: empty
930 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
931 002: i=0 k=0 ka=[] l2= uuid=<0>
932 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
933 004: i=0 k=0 ka=[] l2= uuid=<0>
934 004: i=1 k=2 ka=[] l2= uuid=<1>
935 004: i=2 k=1 ka=[] l2= uuid=<2>
936 005: {"error":null,"result":[{"count":1}]}
937 006: i=0 k=0 ka=[] l2= uuid=<0>
938 006: i=1 k=1 ka=[] l2= uuid=<1>
939 006: i=2 k=1 ka=[] l2= uuid=<2>
940 007: {"error":null,"result":[{"count":3}]}
941 008: i=0 k=0 ka=[] l2= uuid=<0>
942 008: i=1 k=0 ka=[] l2= uuid=<1>
943 008: i=2 k=0 ka=[] l2= uuid=<2>
944 009: done
945 ]])
946
947 # Check that ovsdb-idl figured out that table link2 and column l2 are missing.
948 AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl
949 test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?)
950 test-ovsdb|ovsdb_idl|idltest database lacks singleton table (database needs upgrade?)
951 test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?)
952 ])
953
954 # Check that ovsdb-idl sent on "monitor" request and that it didn't
955 # mention that table or column, and (for paranoia) that it did mention another
956 # table and column.
957 AT_CHECK([grep -c '"monitor\|monitor_cond"' stderr], [0], [2
958 ])
959 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep link2], [1])
960 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep l2], [1])
961 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"link1"'], [0], [1
962 ])
963 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
964 ])
965 OVSDB_SERVER_SHUTDOWN
966 AT_CLEANUP
967
968 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN],
969 [AT_SETUP([$1 fetch])
970 AT_SKIP_IF([test $8 = no])
971 AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6])
972 AT_CHECK([ovsdb_start_idltest])
973 m4_if([$2], [], [],
974 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
975 AT_CHECK([$9 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
976 [0], [stdout], [ignore])
977 AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]),
978 [0], [$5])
979 OVSDB_SERVER_SHUTDOWN
980 AT_CLEANUP])
981
982 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
983 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6], [$7],
984 [$HAVE_PYTHON2], [$PYTHON2])
985 OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6], [$7],
986 [$HAVE_PYTHON3], [$PYTHON3])])
987
988 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
989 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])
990
991 OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
992 [['["idltest",
993 {"op": "insert",
994 "table": "simple",
995 "row": {"i": 1,
996 "r": 2.0,
997 "b": true,
998 "s": "mystring",
999 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1000 "ia": ["set", [1, 2, 3]],
1001 "ra": ["set", [-0.5]],
1002 "ba": ["set", [true]],
1003 "sa": ["set", ["abc", "def"]],
1004 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1005 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1006 {"op": "insert",
1007 "table": "simple",
1008 "row": {}}]']],
1009 [?simple:i,r!],
1010 ['fetch 0 r'],
1011 [[000: i=0 uuid=<0>
1012 000: i=1 uuid=<1>
1013 001: commit, status=success
1014 002: i=0 r=0 uuid=<0>
1015 002: i=1 uuid=<1>
1016 003: done
1017 ]])
1018
1019 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN],
1020 [AT_SETUP([$1])
1021 AT_SKIP_IF([test $6 = no])
1022 AT_KEYWORDS([ovsdb server idl Python monitor $4])
1023 AT_CHECK([ovsdb_start_idltest])
1024 AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond])
1025 AT_CHECK([$7 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
1026 [0], [stdout], [ignore])
1027 AT_CHECK([sort stdout | uuidfilt]m4_if([$5],,, [[| $5]]),
1028 [0], [$3])
1029 OVSDB_SERVER_SHUTDOWN
1030 AT_CLEANUP])
1031
1032 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
1033 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
1034 [$HAVE_PYTHON2], [$PYTHON2])
1035 OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
1036 [$HAVE_PYTHON3], [$PYTHON3])])
1037
1038
1039 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
1040 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])
1041
1042
1043 OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond],
1044 [['["idltest",
1045 {"op": "insert",
1046 "table": "simple",
1047 "row": {"i": 1,
1048 "r": 2.0,
1049 "b": true,
1050 "s": "mystring",
1051 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1052 "ia": ["set", [1, 2, 3]],
1053 "ra": ["set", [-0.5]],
1054 "ba": ["set", [true]],
1055 "sa": ["set", ["abc", "def"]],
1056 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1057 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1058 {"op": "insert",
1059 "table": "simple",
1060 "row": {}}]' \
1061 '["idltest",
1062 {"op": "update",
1063 "table": "simple",
1064 "where": [],
1065 "row": {"b": true}}]' \
1066 '["idltest",
1067 {"op": "update",
1068 "table": "simple",
1069 "where": [],
1070 "row": {"r": 123.5}}]' \
1071 '["idltest",
1072 {"op": "insert",
1073 "table": "simple",
1074 "row": {"i": -1,
1075 "r": 125,
1076 "b": false,
1077 "s": "",
1078 "ia": ["set", [1]],
1079 "ra": ["set", [1.5]],
1080 "ba": ["set", [false]],
1081 "sa": ["set", []],
1082 "ua": ["set", []]}}]' \
1083 '["idltest",
1084 {"op": "update",
1085 "table": "simple",
1086 "where": [["i", "<", 1]],
1087 "row": {"s": "newstring"}}]' \
1088 '["idltest",
1089 {"op": "delete",
1090 "table": "simple",
1091 "where": [["i", "==", 0]]}]' \
1092 'reconnect']],
1093 [[000: empty
1094 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1095 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1096 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>
1097 003: {"error":null,"result":[{"count":2}]}
1098 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1099 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>
1100 005: {"error":null,"result":[{"count":2}]}
1101 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1102 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>
1103 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1104 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1105 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1106 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>
1107 009: {"error":null,"result":[{"count":2}]}
1108 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1109 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1110 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>
1111 011: {"error":null,"result":[{"count":1}]}
1112 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1113 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>
1114 013: reconnect
1115 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1116 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>
1117 015: done
1118 ]])
1119
1120 m4_define([OVSDB_CHECK_IDL_TRACK_C],
1121 [AT_SETUP([$1 - C])
1122 AT_KEYWORDS([ovsdb server idl tracking positive $5])
1123 AT_CHECK([ovsdb_start_idltest])
1124 m4_if([$2], [], [],
1125 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1126 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3],
1127 [0], [stdout], [ignore])
1128 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
1129 [0], [$4])
1130 OVSDB_SERVER_SHUTDOWN
1131 AT_CLEANUP])
1132
1133 m4_define([OVSDB_CHECK_IDL_TRACK],
1134 [OVSDB_CHECK_IDL_TRACK_C($@)])
1135
1136 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated],
1137 [['["idltest",
1138 {"op": "insert",
1139 "table": "simple",
1140 "row": {"i": 1,
1141 "r": 2.0,
1142 "b": true,
1143 "s": "mystring",
1144 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1145 "ia": ["set", [1, 2, 3]],
1146 "ra": ["set", [-0.5]],
1147 "ba": ["set", [true]],
1148 "sa": ["set", ["abc", "def"]],
1149 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1150 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1151 {"op": "insert",
1152 "table": "simple",
1153 "row": {}}]']],
1154 [['["idltest",
1155 {"op": "update",
1156 "table": "simple",
1157 "where": [],
1158 "row": {"b": true}}]']],
1159 [[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>
1160 000: updated columns: b ba i ia r ra s sa u ua
1161 001: {"error":null,"result":[{"count":2}]}
1162 002: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5>
1163 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>
1164 002: updated columns: b
1165 003: done
1166 ]])
1167
1168 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
1169 [],
1170 [['["idltest",
1171 {"op": "insert",
1172 "table": "simple",
1173 "row": {"i": 1,
1174 "r": 2.0,
1175 "b": true,
1176 "s": "mystring",
1177 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1178 "ia": ["set", [1, 2, 3]],
1179 "ra": ["set", [-0.5]],
1180 "ba": ["set", [true]],
1181 "sa": ["set", ["abc", "def"]],
1182 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1183 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1184 {"op": "insert",
1185 "table": "simple",
1186 "row": {}}]' \
1187 '["idltest",
1188 {"op": "update",
1189 "table": "simple",
1190 "where": [],
1191 "row": {"b": true}}]' \
1192 '["idltest",
1193 {"op": "update",
1194 "table": "simple",
1195 "where": [],
1196 "row": {"r": 123.5}}]' \
1197 '["idltest",
1198 {"op": "insert",
1199 "table": "simple",
1200 "row": {"i": -1,
1201 "r": 125,
1202 "b": false,
1203 "s": "",
1204 "ia": ["set", [1]],
1205 "ra": ["set", [1.5]],
1206 "ba": ["set", [false]],
1207 "sa": ["set", []],
1208 "ua": ["set", []]}}]' \
1209 '["idltest",
1210 {"op": "update",
1211 "table": "simple",
1212 "where": [["i", "<", 1]],
1213 "row": {"s": "newstring"}}]' \
1214 '["idltest",
1215 {"op": "delete",
1216 "table": "simple",
1217 "where": [["i", "==", 0]]}]' \
1218 'reconnect']],
1219 [[000: empty
1220 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1221 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>
1222 002: updated columns: b ba i ia r ra s sa u ua
1223 003: {"error":null,"result":[{"count":2}]}
1224 004: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1225 004: updated columns: b
1226 005: {"error":null,"result":[{"count":2}]}
1227 006: i=0 r=123.5 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1228 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>
1229 006: updated columns: r
1230 006: updated columns: r
1231 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1232 008: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1233 008: updated columns: ba i ia r ra
1234 009: {"error":null,"result":[{"count":2}]}
1235 010: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1236 010: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1237 010: updated columns: s
1238 010: updated columns: s
1239 011: {"error":null,"result":[{"count":1}]}
1240 012: ##deleted## uuid=<1>
1241 013: reconnect
1242 014: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1243 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>
1244 014: updated columns: b ba i ia r ra s sa u ua
1245 014: updated columns: ba i ia r ra s
1246 015: done
1247 ]])
1248
1249 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN],
1250 [AT_SETUP([$1 - C])
1251 AT_KEYWORDS([ovsdb server idl partial update map column positive $5])
1252 AT_CHECK([ovsdb_start_idltest])
1253 m4_if([$2], [], [],
1254 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1255 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3],
1256 [0], [stdout], [ignore])
1257 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
1258 [0], [$4])
1259 OVSDB_SERVER_SHUTDOWN
1260 AT_CLEANUP])
1261
1262 OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-column, initially populated],
1263 [['["idltest", {"op":"insert", "table":"simple2",
1264 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
1265 ],
1266 [],
1267 [[000: Getting records
1268 001: name=myString1 smap=[[key1 : value1],[key2 : value2]] imap=[]
1269 002: After insert element
1270 003: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
1271 004: After insert duplicated element
1272 005: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
1273 006: After delete element
1274 007: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
1275 008: After trying to delete a deleted element
1276 009: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
1277 010: End test
1278 ]])
1279
1280 OVSDB_CHECK_IDL_PY([partial-map idl],
1281 [['["idltest", {"op":"insert", "table":"simple2",
1282 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
1283 ],
1284 [?simple2:name,smap,imap 'partialmapinsertelement' 'partialmapinsertmultipleelements' 'partialmapdelelements' 'partialmapmutatenew'],
1285 [[000: name=myString1 smap=[(key1 value1) (key2 value2)] imap=[]
1286 001: commit, status=success
1287 002: name=String2 smap=[(key1 myList1) (key2 value2)] imap=[(3 myids2)]
1288 003: commit, status=success
1289 004: name=String2 smap=[(key1 myList1) (key2 myList2) (key3 myList3) (key4 myList4)] imap=[(3 myids2)]
1290 005: commit, status=success
1291 006: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
1292 007: commit, status=success
1293 008: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
1294 008: name=String2New smap=[(key1 newList1) (key2 newList2)] imap=[]
1295 009: done
1296 ]])
1297
1298 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN],
1299 [AT_SETUP([$1 - C])
1300 AT_KEYWORDS([ovsdb server idl partial update set column positive $5])
1301 AT_CHECK([ovsdb_start_idltest])
1302 m4_if([$2], [], [],
1303 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1304 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3],
1305 [0], [stdout], [ignore])
1306 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
1307 [0], [$4])
1308 OVSDB_SERVER_SHUTDOWN
1309 AT_CLEANUP])
1310
1311 OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-column, initially populated],
1312 [['["idltest", {"op":"insert", "table":"simple3",
1313 "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ], [ "uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff" ]]]} }]']
1314 ],
1315 [],
1316 [[000: Getting records
1317 001: name=mySet1 uset=[[<0>],[<1>]] uref=[]
1318 002: After rename+add new value
1319 003: name=String2 uset=[[<0>],[<1>],[<2>]] uref=[]
1320 004: After add new value
1321 005: name=String2 uset=[[<0>],[<1>],[<2>],[<3>]] uref=[]
1322 006: After delete value
1323 007: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
1324 008: After trying to delete a deleted value
1325 009: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
1326 010: After add to other table + set of strong ref
1327 011: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[[<4>]]
1328 012: End test
1329 ]])
1330
1331 OVSDB_CHECK_IDL_PY([partial-set idl],
1332 [['["idltest", {"op":"insert", "table":"simple3", "uuid-name":"newrow",
1333 "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ]]]} },
1334 {"op":"insert", "table":"simple4", "row":{"name":"seed"}},
1335 {"op":"mutate", "table":"simple3", "where":[["_uuid", "==", ["named-uuid", "newrow"]]],
1336 "mutations": [["uset", "insert", ["set", [["uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff"]]]]]}]']
1337 ],
1338 ['partialrenamesetadd' 'partialduplicateadd' 'partialsetdel' 'partialsetref' 'partialsetoverrideops' 'partialsetadddelete' 'partialsetmutatenew'],
1339 [[000: name=mySet1 uset=[<0> <1>]
1340 001: commit, status=success
1341 002: name=String2 uset=[<0> <1> <2>]
1342 003: commit, status=success
1343 004: name=String2 uset=[<0> <1> <2> <3>]
1344 005: commit, status=success
1345 006: name=String2 uset=[<0> <1> <3>]
1346 007: commit, status=success
1347 008: name=String2 uset=[<0> <1> <3>]
1348 009: commit, status=success
1349 010: name=String2 uset=[<3>]
1350 011: commit, status=success
1351 012: name=String2 uset=[<4> <5>]
1352 013: commit, status=success
1353 014: name=String2 uset=[<4> <5>]
1354 014: name=String3 uset=[<6>]
1355 015: done
1356 ]])
1357
1358 m4_define([OVSDB_CHECK_IDL_NOTIFY_PYN],
1359 [OVSDB_CHECK_IDL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
1360
1361 m4_define([OVSDB_CHECK_IDL_NOTIFY_PY],
1362 [OVSDB_CHECK_IDL_NOTIFY_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
1363 [$HAVE_PYTHON2], [$PYTHON2])
1364 OVSDB_CHECK_IDL_NOTIFY_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
1365 [$HAVE_PYTHON3], [$PYTHON3])])
1366
1367 # This test uses the Python IDL implementation with ssl
1368 m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PYN],
1369 [OVSDB_CHECK_IDL_SSL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
1370
1371 m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PY],
1372 [OVSDB_CHECK_IDL_NOTIFY_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
1373 [$HAVE_PYTHON2], [$PYTHON2])
1374 OVSDB_CHECK_IDL_NOTIFY_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
1375 [$HAVE_PYTHON3], [$PYTHON3])])
1376
1377 m4_define([OVSDB_CHECK_IDL_NOTIFY],
1378 [OVSDB_CHECK_IDL_NOTIFY_PY($@)
1379 OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])
1380
1381 OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
1382 [['track-notify' \
1383 '["idltest",
1384 {"op": "insert",
1385 "table": "simple",
1386 "row": {"i": 1,
1387 "r": 2.0,
1388 "b": true,
1389 "s": "mystring",
1390 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1391 "ia": ["set", [1, 2, 3]],
1392 "ra": ["set", [-0.5]],
1393 "ba": ["set", [true]],
1394 "sa": ["set", ["abc", "def"]],
1395 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1396 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1397 {"op": "insert",
1398 "table": "simple",
1399 "row": {}}]' \
1400 '["idltest",
1401 {"op": "update",
1402 "table": "simple",
1403 "where": [],
1404 "row": {"b": false}}]' \
1405 '["idltest",
1406 {"op": "update",
1407 "table": "simple",
1408 "where": [],
1409 "row": {"r": 123.5}}]' \
1410 '["idltest",
1411 {"op": "insert",
1412 "table": "simple",
1413 "row": {"i": -1,
1414 "r": 125,
1415 "b": false,
1416 "s": "",
1417 "ia": ["set", [1]],
1418 "ra": ["set", [1.5]],
1419 "ba": ["set", [false]],
1420 "sa": ["set", []],
1421 "ua": ["set", []]}}]' \
1422 '["idltest",
1423 {"op": "update",
1424 "table": "simple",
1425 "where": [["i", "<", 1]],
1426 "row": {"s": "newstring"}}]' \
1427 '["idltest",
1428 {"op": "delete",
1429 "table": "simple",
1430 "where": [["i", "==", 0]]}]' \
1431 'reconnect']],
1432 [[000: empty
1433 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1434 002: event:create, row={i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
1435 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
1436 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1437 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>
1438 003: {"error":null,"result":[{"count":2}]}
1439 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>}
1440 004: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1441 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>
1442 005: {"error":null,"result":[{"count":2}]}
1443 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>}
1444 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>}
1445 006: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1446 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>
1447 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1448 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
1449 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1450 008: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1451 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>
1452 009: {"error":null,"result":[{"count":2}]}
1453 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>}
1454 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>}
1455 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1456 010: i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1457 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>
1458 011: {"error":null,"result":[{"count":1}]}
1459 012: event:delete, row={i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
1460 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1461 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>
1462 013: reconnect
1463 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
1464 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
1465 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1466 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>
1467 015: done
1468 ]])
1469
1470 # Tests to verify the functionality of the one column compound index.
1471 # It tests index for one column string and integer indexes.
1472 # The run of test-ovsdb generates the output of the display of data using the different indexes defined in
1473 # the program.
1474 # Then, some at_checks are used to verify the correctness of the corresponding index as well as the existence
1475 # of all the rows involved in the test.
1476 m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C],
1477 [AT_SETUP([$1 - C])
1478 AT_KEYWORDS([ovsdb server idl compound_index_single_column compound_index positive $5])
1479 AT_CHECK([ovsdb_start_idltest])
1480 m4_if([$2], [], [],
1481 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1482 # Generate the data to be tested.
1483 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index unix:socket $3],
1484 [0], [stdout], [ignore])
1485 # Filter the rows of data that corresponds to the string index eliminating the extra columns of data.
1486 # This is done to verifiy that the output data is in the correct and expected order.
1487 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sed -e 's/ i=.*//g']],
1488 [0], [$4])
1489 # Here, the data is filtered and sorted in order to have all the rows in the index and be
1490 # able to determined that all the involved rows are present.
1491 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
1492 [0], [$5])
1493 # Filter the rows of data that corresponds to the integer index eliminating the extra columns of data.
1494 # This is done to verifiy that the output data is in the correct and expected order.
1495 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sed -e 's/ s=.*//g']],
1496 [0], [$6])
1497 # Here again, the data is filtered and sorted in order to have all the rows in the index and be
1498 # able to determined that all the involved rows are present.
1499 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
1500 [0], [$7])
1501 OVSDB_SERVER_SHUTDOWN
1502 AT_CLEANUP])
1503
1504 OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column test ],
1505 [['["idltest",
1506 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 1, "b":true, "r":101.0}},
1507 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 2, "b":false, "r":102.0}},
1508 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 10, "b":true, "r":110.0}},
1509 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 1, "b":false, "r":110.0}},
1510 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":120.0}},
1511 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":122.0}},
1512 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 4, "b":true, "r":130.0}},
1513 {"op": "insert", "table": "simple", "row": {"s":"List005", "i": 5, "b":true, "r":130.0}},
1514 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 20, "b":true, "r":220.0}},
1515 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 19, "b":true, "r":219.0}}
1516 ]']],
1517 [idl_compound_index_single_column],
1518 [001: s=List000
1519 001: s=List000
1520 001: s=List000
1521 001: s=List001
1522 001: s=List001
1523 001: s=List001
1524 001: s=List001
1525 001: s=List005
1526 001: s=List020
1527 001: s=List020
1528 003: s=List001
1529 003: s=List001
1530 003: s=List001
1531 003: s=List001
1532 ],
1533 [001: s=List000 i=1 b=True r=101.000000
1534 001: s=List000 i=10 b=True r=110.000000
1535 001: s=List000 i=2 b=False r=102.000000
1536 001: s=List001 i=1 b=False r=110.000000
1537 001: s=List001 i=2 b=True r=120.000000
1538 001: s=List001 i=2 b=True r=122.000000
1539 001: s=List001 i=4 b=True r=130.000000
1540 001: s=List005 i=5 b=True r=130.000000
1541 001: s=List020 i=19 b=True r=219.000000
1542 001: s=List020 i=20 b=True r=220.000000
1543 003: s=List001 i=1 b=False r=110.000000
1544 003: s=List001 i=2 b=True r=120.000000
1545 003: s=List001 i=2 b=True r=122.000000
1546 003: s=List001 i=4 b=True r=130.000000
1547 ],
1548 [002: i=1
1549 002: i=1
1550 002: i=2
1551 002: i=2
1552 002: i=2
1553 002: i=4
1554 002: i=5
1555 002: i=10
1556 002: i=19
1557 002: i=20
1558 004: i=5
1559 005: i=4
1560 005: i=5
1561 006: i=5
1562 006: i=10
1563 006: i=19
1564 006: i=20
1565 006: i=54
1566 007: i=5
1567 007: i=19
1568 007: i=20
1569 007: i=30
1570 007: i=54
1571 008: i=1
1572 008: i=1
1573 008: i=2
1574 008: i=2
1575 008: i=2
1576 008: i=5
1577 008: i=19
1578 008: i=20
1579 008: i=30
1580 008: i=54
1581 ],
1582 [002: i=1 s=List000 b=True r=101.000000
1583 002: i=1 s=List001 b=False r=110.000000
1584 002: i=10 s=List000 b=True r=110.000000
1585 002: i=19 s=List020 b=True r=219.000000
1586 002: i=2 s=List000 b=False r=102.000000
1587 002: i=2 s=List001 b=True r=120.000000
1588 002: i=2 s=List001 b=True r=122.000000
1589 002: i=20 s=List020 b=True r=220.000000
1590 002: i=4 s=List001 b=True r=130.000000
1591 002: i=5 s=List005 b=True r=130.000000
1592 004: i=5 s=List005 b=True r=130.000000
1593 005: i=4 s=List001 b=True r=130.000000
1594 005: i=5 s=List005 b=True r=130.000000
1595 006: i=10 s=List000 b=True r=110.000000
1596 006: i=19 s=List020 b=True r=219.000000
1597 006: i=20 s=List020 b=True r=220.000000
1598 006: i=5 s=List005 b=True r=130.000000
1599 006: i=54 s=Lista054 b=False r=0.000000
1600 007: i=19 s=List020 b=True r=219.000000
1601 007: i=20 s=List020 b=True r=220.000000
1602 007: i=30 s=List000 b=True r=110.000000
1603 007: i=5 s=List005 b=True r=130.000000
1604 007: i=54 s=Lista054 b=False r=0.000000
1605 008: i=1 s=List000 b=True r=101.000000
1606 008: i=1 s=List001 b=False r=110.000000
1607 008: i=19 s=List020 b=True r=219.000000
1608 008: i=2 s=List000 b=False r=102.000000
1609 008: i=2 s=List001 b=True r=120.000000
1610 008: i=2 s=List001 b=True r=122.000000
1611 008: i=20 s=List020 b=True r=220.000000
1612 008: i=30 s=List000 b=True r=110.000000
1613 008: i=5 s=List005 b=True r=130.000000
1614 008: i=54 s=Lista054 b=False r=0.000000
1615 ])
1616
1617 # Tests to verify the functionality of two column compound index.
1618 # It tests index for two columns using string and integer fields.
1619 # The run of test-ovsdb generates the output of the display of data using the different indexes defined in
1620 # the program.
1621 # Then, some at_checks are used to verify the correctness of the corresponding index as well as the existence
1622 # of all the rows involved in the test.
1623 m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C],
1624 [AT_SETUP([$1 - C])
1625 AT_KEYWORDS([ovsdb server idl compound_index_double_column compound_index positive $5])
1626 AT_CHECK([ovsdb_start_idltest])
1627 m4_if([$2], [], [],
1628 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1629 # Generate the data to be tested.
1630 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index unix:socket $3],
1631 [0], [stdout], [ignore])
1632 # Filter the rows of data that corresponds to the string-integer index eliminating the extra columns of data.
1633 # This is done to verifiy that the output data is in the correct and expected order.
1634 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sed -e 's/ b=.*//g']],
1635 [0], [$4])
1636 # Here, the data is filtered and sorted in order to have all the rows in the index and be
1637 # able to determined that all the involved rows are present.
1638 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
1639 [0], [$5])
1640 # Filter the rows of data that corresponds to the integer index eliminating the extra columns of data.
1641 # This is done to verifiy that the output data is in the correct and expected order.
1642 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sed -e 's/ b=.*//g']],
1643 [0], [$6])
1644 # Here again, the data is filtered and sorted in order to have all the rows in the index and be
1645 # able to determined that all the involved rows are present.
1646 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
1647 [0], [$7])
1648 OVSDB_SERVER_SHUTDOWN
1649 AT_CLEANUP])
1650
1651 OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column test ],
1652 [['["idltest",
1653 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 1, "b":true, "r":101.0}},
1654 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 2, "b":false, "r":102.0}},
1655 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 10, "b":true, "r":110.0}},
1656 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 1, "b":false, "r":110.0}},
1657 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":120.0}},
1658 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":122.0}},
1659 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 4, "b":true, "r":130.0}},
1660 {"op": "insert", "table": "simple", "row": {"s":"List005", "i": 5, "b":true, "r":130.0}},
1661 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 20, "b":true, "r":220.0}},
1662 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 19, "b":true, "r":219.0}}
1663 ]']],
1664 [idl_compound_index_double_column],
1665 [001: s=List000 i=1
1666 001: s=List000 i=2
1667 001: s=List000 i=10
1668 001: s=List001 i=1
1669 001: s=List001 i=2
1670 001: s=List001 i=2
1671 001: s=List001 i=4
1672 001: s=List005 i=5
1673 001: s=List020 i=19
1674 001: s=List020 i=20
1675 002: s=List000 i=10
1676 002: s=List000 i=2
1677 002: s=List000 i=1
1678 002: s=List001 i=4
1679 002: s=List001 i=2
1680 002: s=List001 i=2
1681 002: s=List001 i=1
1682 002: s=List005 i=5
1683 002: s=List020 i=20
1684 002: s=List020 i=19
1685 003: s=List000 i=10
1686 004: s=List001 i=1
1687 004: s=List001 i=2
1688 004: s=List001 i=2
1689 004: s=List001 i=4
1690 004: s=List005 i=5
1691 ],
1692 [001: s=List000 i=1 b=True r=101.000000
1693 001: s=List000 i=10 b=True r=110.000000
1694 001: s=List000 i=2 b=False r=102.000000
1695 001: s=List001 i=1 b=False r=110.000000
1696 001: s=List001 i=2 b=True r=120.000000
1697 001: s=List001 i=2 b=True r=122.000000
1698 001: s=List001 i=4 b=True r=130.000000
1699 001: s=List005 i=5 b=True r=130.000000
1700 001: s=List020 i=19 b=True r=219.000000
1701 001: s=List020 i=20 b=True r=220.000000
1702 002: s=List000 i=1 b=True r=101.000000
1703 002: s=List000 i=10 b=True r=110.000000
1704 002: s=List000 i=2 b=False r=102.000000
1705 002: s=List001 i=1 b=False r=110.000000
1706 002: s=List001 i=2 b=True r=120.000000
1707 002: s=List001 i=2 b=True r=122.000000
1708 002: s=List001 i=4 b=True r=130.000000
1709 002: s=List005 i=5 b=True r=130.000000
1710 002: s=List020 i=19 b=True r=219.000000
1711 002: s=List020 i=20 b=True r=220.000000
1712 003: s=List000 i=10 b=True r=110.000000
1713 004: s=List001 i=1 b=False r=110.000000
1714 004: s=List001 i=2 b=True r=120.000000
1715 004: s=List001 i=2 b=True r=122.000000
1716 004: s=List001 i=4 b=True r=130.000000
1717 004: s=List005 i=5 b=True r=130.000000
1718 ],
1719 [005: i=1 s=List000
1720 005: i=1 s=List001
1721 005: i=2 s=List000
1722 005: i=2 s=List001
1723 005: i=2 s=List001
1724 005: i=4 s=List001
1725 005: i=5 s=List005
1726 005: i=10 s=List000
1727 005: i=19 s=List020
1728 005: i=20 s=List020
1729 006: i=20 s=List020
1730 006: i=19 s=List020
1731 006: i=10 s=List000
1732 006: i=5 s=List005
1733 006: i=4 s=List001
1734 006: i=2 s=List000
1735 006: i=2 s=List001
1736 006: i=2 s=List001
1737 006: i=1 s=List000
1738 006: i=1 s=List001
1739 ],
1740 [005: i=1 s=List000 b=True r=101.000000
1741 005: i=1 s=List001 b=False r=110.000000
1742 005: i=10 s=List000 b=True r=110.000000
1743 005: i=19 s=List020 b=True r=219.000000
1744 005: i=2 s=List000 b=False r=102.000000
1745 005: i=2 s=List001 b=True r=120.000000
1746 005: i=2 s=List001 b=True r=122.000000
1747 005: i=20 s=List020 b=True r=220.000000
1748 005: i=4 s=List001 b=True r=130.000000
1749 005: i=5 s=List005 b=True r=130.000000
1750 006: i=1 s=List000 b=True r=101.000000
1751 006: i=1 s=List001 b=False r=110.000000
1752 006: i=10 s=List000 b=True r=110.000000
1753 006: i=19 s=List020 b=True r=219.000000
1754 006: i=2 s=List000 b=False r=102.000000
1755 006: i=2 s=List001 b=True r=120.000000
1756 006: i=2 s=List001 b=True r=122.000000
1757 006: i=20 s=List020 b=True r=220.000000
1758 006: i=4 s=List001 b=True r=130.000000
1759 006: i=5 s=List005 b=True r=130.000000
1760 ])
1761
1762 m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF],
1763 [AT_SETUP([$1 - C])
1764 AT_KEYWORDS([ovsdb server idl compound_index compound_index_with_ref positive $5])
1765 AT_CHECK([ovsdb_start_idltest])
1766 m4_if([$2], [], [],
1767 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1768 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index-with-ref unix:socket $3],
1769 [0], [stdout], [ignore])
1770 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
1771 [0], [$4])
1772 OVSDB_SERVER_SHUTDOWN
1773 AT_CLEANUP])
1774
1775 OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF([set, simple3 idl-compound-index-with-ref, initially populated],
1776 [],
1777 [],
1778 [[000: After add to other table + set of strong ref
1779 001: name= uset=[] uref=[[<0>]]
1780 002: check simple4: not empty
1781 003: Query using index with reference
1782 004: name= uset=[] uref=[[<0>]]
1783 005: After delete
1784 007: check simple4: empty
1785 008: End test
1786 ]])
1787
1788 m4_define([CHECK_STREAM_OPEN_BLOCK],
1789 [AT_SETUP([Check Stream open block - C - $1])
1790 AT_SKIP_IF([test "$1" = "tcp6" && test "$IS_WIN32" = "yes"])
1791 AT_SKIP_IF([test "$1" = "tcp6" && test "$HAVE_IPV6" = "no"])
1792 AT_KEYWORDS([Check Stream open block $1])
1793 AT_CHECK([ovsdb_start_idltest "ptcp:0:$2"])
1794 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
1795 WRONG_PORT=$(($TCP_PORT+1))
1796 AT_CHECK([test-stream tcp:$2:$TCP_PORT], [0], [ignore])
1797 AT_CHECK([test-stream tcp:$2:$WRONG_PORT], [1], [ignore], [ignore])
1798 OVSDB_SERVER_SHUTDOWN
1799 AT_CHECK([test-stream tcp:$2:$TCP_PORT], [1], [ignore], [ignore])
1800 AT_CLEANUP])
1801
1802 CHECK_STREAM_OPEN_BLOCK([tcp], [127.0.0.1])
1803 CHECK_STREAM_OPEN_BLOCK([tcp6], [[[::1]]])
1804
1805 m4_define([CHECK_STREAM_OPEN_BLOCK_PY],
1806 [AT_SETUP([$1])
1807 AT_SKIP_IF([test $2 = no])
1808 AT_KEYWORDS([Check PY Stream open block - $3])
1809 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
1810 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
1811 WRONG_PORT=$(($TCP_PORT+1))
1812 AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$TCP_PORT], [0], [ignore])
1813 AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$WRONG_PORT], [1], [ignore])
1814 OVSDB_SERVER_SHUTDOWN
1815 AT_CHECK([$3 $srcdir/test-stream.py tcp:127.0.0.1:$TCP_PORT], [1], [ignore])
1816 AT_CLEANUP])
1817
1818 CHECK_STREAM_OPEN_BLOCK_PY([Check PY2 Stream open block], [$HAVE_PYTHON2], [$PYTHON2])
1819 CHECK_STREAM_OPEN_BLOCK_PY([Check PY3 Stream open block], [$HAVE_PYTHON3], [$PYTHON3])