]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ovsdb-idl.at
treewide: Convert leading tabs to spaces.
[mirror_ovs.git] / tests / ovsdb-idl.at
CommitLineData
c3bb4bd7
BP
1AT_BANNER([OVSDB -- interface description language (IDL)])
2
56120500
BP
3m4_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).
9ovsdb_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
8cdf0349
BP
16# OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
17# [FILTER])
c3bb4bd7
BP
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
254604d8
BP
28# marker. If FILTER is supplied then the output is also filtered
29# through the specified program.
c3bb4bd7
BP
30#
31# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
8cdf0349
BP
32m4_define([OVSDB_CHECK_IDL_C],
33 [AT_SETUP([$1 - C])
c3bb4bd7 34 AT_KEYWORDS([ovsdb server idl positive $5])
56120500 35 AT_CHECK([ovsdb_start_idltest])
c3bb4bd7 36 m4_if([$2], [], [],
7427f2a4 37 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
8cdf0349 38 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
7427f2a4 39 [0], [stdout], [ignore])
c724bd67 40 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 41 [0], [$4])
028cbd99 42 OVSDB_SERVER_SHUTDOWN
c3bb4bd7
BP
43 AT_CLEANUP])
44
8cdf0349 45# same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
963f66b5
RB
46m4_define([OVSDB_CHECK_IDL_PYN],
47 [AT_SETUP([$1])
48 AT_SKIP_IF([test $7 = no])
8cdf0349 49 AT_KEYWORDS([ovsdb server idl positive Python $5])
56120500 50 AT_CHECK([ovsdb_start_idltest])
8cdf0349 51 m4_if([$2], [], [],
7427f2a4 52 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
963f66b5 53 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
7427f2a4 54 [0], [stdout], [ignore])
c724bd67 55 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 56 [0], [$4])
8cdf0349
BP
57 OVSDB_SERVER_SHUTDOWN
58 AT_CLEANUP])
59
963f66b5
RB
60m4_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
66m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN],
67 [AT_SETUP([$1 - register_columns])
68 AT_SKIP_IF([test $7 = no])
01dc1516 69 AT_KEYWORDS([ovsdb server idl positive Python register_columns $5])
56120500 70 AT_CHECK([ovsdb_start_idltest])
01dc1516 71 m4_if([$2], [], [],
7427f2a4 72 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
963f66b5 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],
7427f2a4 74 [0], [stdout], [ignore])
c724bd67 75 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 76 [0], [$4])
01dc1516
SA
77 OVSDB_SERVER_SHUTDOWN
78 AT_CLEANUP])
79
963f66b5
RB
80m4_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
e06d06a7 86# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
963f66b5
RB
87m4_define([OVSDB_CHECK_IDL_TCP_PYN],
88 [AT_SETUP([$1 - tcp])
89 AT_SKIP_IF([test $7 = no])
e06d06a7 90 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
56120500 91 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
fb28ef2d 92 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
1e04fcc8 93
e06d06a7 94 m4_if([$2], [], [],
7427f2a4 95 [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])])
963f66b5 96 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
7427f2a4 97 [0], [stdout], [ignore])
c724bd67 98 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 99 [0], [$4])
e06d06a7
IY
100 OVSDB_SERVER_SHUTDOWN
101 AT_CLEANUP])
102
963f66b5
RB
103m4_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
e731d71b 109# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
963f66b5
RB
110m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
111 [AT_SETUP([$1 - tcp6])
112 AT_SKIP_IF([test $7 = no])
7b9d1b65 113 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
4819b3a5 114 AT_SKIP_IF([test $HAVE_IPV6 = no])
e731d71b 115 AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
56120500 116 AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
fb28ef2d 117 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
e731d71b
AS
118 echo "TCP_PORT=$TCP_PORT"
119
120 m4_if([$2], [], [],
7427f2a4 121 [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
963f66b5 122 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
7427f2a4 123 [0], [stdout], [ignore])
c724bd67 124 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 125 [0], [$4])
e731d71b
AS
126 OVSDB_SERVER_SHUTDOWN
127 AT_CLEANUP])
128
963f66b5
RB
129m4_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
61845323
JS
135# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with SSL
136m4_define([OVSDB_CHECK_IDL_SSL_PYN],
137 [AT_SETUP([$1 - SSL])
138 AT_SKIP_IF([test "$HAVE_OPENSSL" = no])
139 AT_SKIP_IF([test $7 = no])
140 $8 -c "import OpenSSL.SSL"
141 SSL_PRESENT=$?
142 AT_SKIP_IF([test $SSL_PRESENT != 0])
143 AT_KEYWORDS([ovsdb server idl positive Python with ssl socket $5])
144 AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
145 [0], [stdout], [ignore])
146 PKIDIR=$abs_top_builddir/tests
147 AT_CHECK([ovsdb-server -vconsole:warn --log-file --detach --no-chdir \
148 --pidfile \
149 --private-key=$PKIDIR/testpki-privkey2.pem \
150 --certificate=$PKIDIR/testpki-cert2.pem \
151 --ca-cert=$PKIDIR/testpki-cacert.pem \
152 --remote=pssl:0:127.0.0.1 db])
153 on_exit 'kill `cat ovsdb-server.pid`'
154 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
155 m4_if([$2], [], [],
156 [AT_CHECK([ovsdb-client \
157 --private-key=$PKIDIR/testpki-privkey2.pem \
158 --certificate=$PKIDIR/testpki-cert2.pem \
159 --ca-cert=$PKIDIR/testpki-cacert.pem \
160 transact "ssl:127.0.0.1:$TCP_PORT" $2], [0], [ignore], [ignore])])
161 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema \
162 ssl:127.0.0.1:$TCP_PORT $PKIDIR/testpki-privkey.pem \
163 $PKIDIR/testpki-cert.pem $PKIDIR/testpki-cacert.pem $3],
164 [0], [stdout], [ignore])
165 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
166 [0], [$4])
167 OVSDB_SERVER_SHUTDOWN
168 AT_CLEANUP])
169
170m4_define([OVSDB_CHECK_IDL_SSL_PY],
171 [OVSDB_CHECK_IDL_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
172 [$HAVE_PYTHON], [$PYTHON])
173 OVSDB_CHECK_IDL_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
174 [$HAVE_PYTHON3], [$PYTHON3])])
175
8cdf0349
BP
176m4_define([OVSDB_CHECK_IDL],
177 [OVSDB_CHECK_IDL_C($@)
e06d06a7 178 OVSDB_CHECK_IDL_PY($@)
01dc1516 179 OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY($@)
e731d71b 180 OVSDB_CHECK_IDL_TCP_PY($@)
61845323
JS
181 OVSDB_CHECK_IDL_TCP6_PY($@)
182 OVSDB_CHECK_IDL_SSL_PY($@)])
8cdf0349 183
af358237 184# This test uses the Python IDL implementation with passive tcp
f62a20d8
TR
185m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
186 [AT_SETUP([$1 ptcp])
187 AT_SKIP_IF([test $7 = no])
af358237 188 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
af358237 189 # find free TCP port
56120500 190 AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
af358237 191 PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
7427f2a4 192 OVSDB_SERVER_SHUTDOWN
56120500 193 rm -f db
af358237
OBY
194
195 # start OVSDB server in passive mode
56120500 196 AT_CHECK([ovsdb_start_idltest "tcp:127.0.0.1:$TCP_PORT"])
f62a20d8 197 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
7427f2a4 198 [0], [stdout], [ignore])
c724bd67 199 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4
DDP
200 [0], [$4])
201 OVSDB_SERVER_SHUTDOWN
af358237
OBY
202 AT_CLEANUP
203 ])
204
f62a20d8
TR
205m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
206 [OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
207 [$HAVE_PYTHON], [$PYTHON])
208 OVSDB_CHECK_IDL_PASSIVE_TCP_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
209 [$HAVE_PYTHON3], [$PYTHON3])])
210
af358237
OBY
211OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
212 [],
213 [['["idltest",{"op":"select","table":"link1","where":[]}]']],
214 [[000: empty
215001: {"error":null,"result":[{"rows":[]}]}
216002: done
217]])
218
c3bb4bd7
BP
219OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
220 [],
221 [],
222 [000: empty
223001: done
224])
225
226OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
227 [],
9cb53f26
BP
228 [['["idltest",
229 {"op": "insert",
c3bb4bd7
BP
230 "table": "simple",
231 "row": {"i": 1,
232 "r": 2.0,
233 "b": true,
234 "s": "mystring",
235 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
236 "ia": ["set", [1, 2, 3]],
237 "ra": ["set", [-0.5]],
7fae24e6 238 "ba": ["set", [true]],
8cdf0349 239 "sa": ["set", ["abc", "def"]],
c3bb4bd7
BP
240 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
241 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
242 {"op": "insert",
243 "table": "simple",
244 "row": {}}]' \
9cb53f26
BP
245 '["idltest",
246 {"op": "update",
c3bb4bd7
BP
247 "table": "simple",
248 "where": [],
249 "row": {"b": true}}]' \
9cb53f26
BP
250 '["idltest",
251 {"op": "update",
c3bb4bd7
BP
252 "table": "simple",
253 "where": [],
254 "row": {"r": 123.5}}]' \
9cb53f26
BP
255 '["idltest",
256 {"op": "insert",
c3bb4bd7
BP
257 "table": "simple",
258 "row": {"i": -1,
259 "r": 125,
260 "b": false,
261 "s": "",
262 "ia": ["set", [1]],
263 "ra": ["set", [1.5]],
264 "ba": ["set", [false]],
8cdf0349 265 "sa": ["set", []],
c3bb4bd7 266 "ua": ["set", []]}}]' \
9cb53f26
BP
267 '["idltest",
268 {"op": "update",
c3bb4bd7
BP
269 "table": "simple",
270 "where": [["i", "<", 1]],
271 "row": {"s": "newstring"}}]' \
9cb53f26
BP
272 '["idltest",
273 {"op": "delete",
c3bb4bd7
BP
274 "table": "simple",
275 "where": [["i", "==", 0]]}]' \
276 'reconnect']],
277 [[000: empty
278001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
279002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 280002: 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>
c3bb4bd7
BP
281003: {"error":null,"result":[{"count":2}]}
282004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 283004: 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>
c3bb4bd7
BP
284005: {"error":null,"result":[{"count":2}]}
285006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 286006: 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>
c3bb4bd7
BP
287007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
288008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
289008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 290008: 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>
c3bb4bd7
BP
291009: {"error":null,"result":[{"count":2}]}
292010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
293010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 294010: 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>
c3bb4bd7
BP
295011: {"error":null,"result":[{"count":1}]}
296012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
7fae24e6 297012: 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>
c3bb4bd7
BP
298013: reconnect
299014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
7fae24e6 300014: 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>
c3bb4bd7
BP
301015: done
302]])
303
304OVSDB_CHECK_IDL([simple idl, initially populated],
9cb53f26
BP
305 [['["idltest",
306 {"op": "insert",
c3bb4bd7
BP
307 "table": "simple",
308 "row": {"i": 1,
309 "r": 2.0,
310 "b": true,
311 "s": "mystring",
312 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
313 "ia": ["set", [1, 2, 3]],
314 "ra": ["set", [-0.5]],
7fae24e6 315 "ba": ["set", [true]],
8cdf0349 316 "sa": ["set", ["abc", "def"]],
c3bb4bd7
BP
317 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
318 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
319 {"op": "insert",
320 "table": "simple",
321 "row": {}}]']],
9cb53f26
BP
322 [['["idltest",
323 {"op": "update",
c3bb4bd7
BP
324 "table": "simple",
325 "where": [],
326 "row": {"b": true}}]']],
327 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 328000: 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>
c3bb4bd7
BP
329001: {"error":null,"result":[{"count":2}]}
330002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 331002: 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>
c3bb4bd7
BP
332003: done
333]])
334
475281c0 335OVSDB_CHECK_IDL([simple idl, writing via IDL],
9cb53f26
BP
336 [['["idltest",
337 {"op": "insert",
475281c0
BP
338 "table": "simple",
339 "row": {"i": 1,
340 "r": 2.0,
341 "b": true,
342 "s": "mystring",
343 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
344 "ia": ["set", [1, 2, 3]],
345 "ra": ["set", [-0.5]],
7fae24e6 346 "ba": ["set", [true]],
8cdf0349 347 "sa": ["set", ["abc", "def"]],
475281c0
BP
348 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
349 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
350 {"op": "insert",
351 "table": "simple",
352 "row": {}}]']],
a91c6104
BP
353 [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
354 'insert 2, verify 2 i, verify 1 b, delete 1']],
475281c0 355 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 356000: 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>
475281c0
BP
357001: commit, status=success
358002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
7fae24e6 359002: 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>
475281c0
BP
360003: commit, status=success
361004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
362004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
363005: done
364]])
365
e7164d96
LR
366OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode],
367 [['["idltest",
368 {"op": "insert",
369 "table": "simple",
370 "row": {"s": "(╯°□°)╯︵ ┻━┻"}}]']],
371 [['set 0 b 1, insert 1, set 1 s "¯\_(ツ)_/¯"']],
372 [[000: i=0 r=0 b=false s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
373001: commit, status=success
374002: i=0 r=0 b=true s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
375002: i=1 r=0 b=false s="¯\_(ツ)_/¯" u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
376003: done
377]])
378
980211b7
GL
379m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
380 [AT_SETUP([$1])
381 AT_SKIP_IF([test $7 = no])
382 AT_KEYWORDS([ovsdb server idl positive Python $5])
383 AT_CHECK([ovsdb_start_idltest])
384 m4_if([$2], [], [],
385 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
386 AT_CHECK([$8 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
387 [0], [stdout], [ignore])
388 echo "$4" > expout
389 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
390 [0], [expout])
391 OVSDB_SERVER_SHUTDOWN
392 AT_CLEANUP])
393
394m4_define([OVSDB_CHECK_IDL_PY_WITH_EXPOUT],
395 [OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
396 [$HAVE_PYTHON], [$PYTHON])
397 OVSDB_CHECK_IDL_PYN_WITH_EXPOUT([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
398 [$HAVE_PYTHON3], [$PYTHON3])])
399
400OVSDB_CHECK_IDL_PY_WITH_EXPOUT([simple idl, writing large data via IDL with unicode],
401 [['["idltest",
402 {"op": "insert",
403 "table": "simple",
404 "row": {"s": "'$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50})'"}}]']],
405 [['set 0 b 1, insert 1, set 1 s '$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100})'']],
406 [[000: i=0 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
407001: commit, status=success
408002: i=0 r=0 b=true s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
409002: i=1 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
410003: done]])
411
a91c6104
BP
412OVSDB_CHECK_IDL([simple idl, handling verification failure],
413 [['["idltest",
414 {"op": "insert",
415 "table": "simple",
416 "row": {"i": 1,
417 "r": 2.0}},
418 {"op": "insert",
419 "table": "simple",
420 "row": {}}]']],
421 [['set 0 b 1' \
422 '+["idltest",
423 {"op": "update",
424 "table": "simple",
425 "where": [["i", "==", 1]],
426 "row": {"r": 5.0}}]' \
427 '+verify 1 r, set 1 r 3' \
428 'verify 1 r, set 1 r 3' \
429 ]],
430 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
431000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
432001: commit, status=success
433002: {"error":null,"result":[{"count":1}]}
94fbe1aa 434003: commit, status=try again
a91c6104
BP
435004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
436004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
437005: commit, status=success
438006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
439006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
440007: done
441]])
442
b54e22e9 443OVSDB_CHECK_IDL([simple idl, increment operation],
9cb53f26
BP
444 [['["idltest",
445 {"op": "insert",
b54e22e9
BP
446 "table": "simple",
447 "row": {}}]']],
94fbe1aa 448 [['set 0 r 2.0, increment 0']],
b54e22e9
BP
449 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
450001: commit, status=success, increment=1
451002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
452003: done
453]])
454
2096903b
BP
455OVSDB_CHECK_IDL([simple idl, aborting],
456 [['["idltest",
457 {"op": "insert",
458 "table": "simple",
459 "row": {}}]']],
460 [['set 0 r 2.0, abort' \
461'+set 0 b 1']],
462 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
463001: commit, status=aborted
464002: commit, status=success
465003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
466004: done
467]])
468
469OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
470 [['["idltest",
471 {"op": "insert",
472 "table": "simple",
473 "row": {}}]']],
474 [['set 0 r 2.0, destroy' \
475'+set 0 b 1']],
476 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
477001: destroy
478002: commit, status=success
479003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
480004: done
481]])
482
16ebb90e
LS
483OVSDB_CHECK_IDL([simple idl, conditional, false condition],
484 [['["idltest",
485 {"op": "insert",
486 "table": "simple",
487 "row": {"i": 1,
488 "r": 2.0,
489 "b": true}}]']],
0164e367
BP
490 [['condition simple []' \
491 'condition simple [true]']],
16ebb90e
LS
492 [[000: change conditions
493001: empty
494002: change conditions
495003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
496004: done
497]])
498
499OVSDB_CHECK_IDL([simple idl, conditional, true condition],
500 [['["idltest",
501 {"op": "insert",
502 "table": "simple",
503 "row": {"i": 1,
504 "r": 2.0,
505 "b": true}}]']],
0164e367
BP
506 [['condition simple []' \
507 'condition simple [true]']],
16ebb90e
LS
508 [[000: change conditions
509001: empty
510002: change conditions
511003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
512004: done
513]])
514
515OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition],
516 [['["idltest",
517 {"op": "insert",
518 "table": "simple",
519 "row": {"i": 1,
520 "r": 2.0,
521 "b": true}},
522 {"op": "insert",
523 "table": "simple",
524 "row": {"i": 2,
525 "r": 3.0,
526 "b": true}}]']],
0164e367
BP
527 [['condition simple []' \
528 'condition simple [["i","==",1],["i","==",2]]']],
16ebb90e
LS
529 [[000: change conditions
530001: empty
531002: change conditions
532003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
533003: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
534004: done
535]])
536
537OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition],
538 [['["idltest",
539 {"op": "insert",
540 "table": "simple",
541 "row": {"i": 1,
542 "r": 2.0,
543 "b": true}}]']],
0164e367
BP
544 [['condition simple []' \
545 'condition simple [["i","==",1]]']],
16ebb90e
LS
546 [[000: change conditions
547001: empty
548002: change conditions
549003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
550004: done
551]])
552
553OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition],
554 [['["idltest",
555 {"op": "insert",
556 "table": "simple",
557 "row": {"i": 1,
558 "r": 2.0,
559 "b": true}}]']],
0164e367
BP
560 [['condition simple []' \
561 'condition simple [["i","==",1],["i","==",2]]' \
562 'condition simple [["i","==",2]]' \
16ebb90e
LS
563 '["idltest",
564 {"op": "insert",
565 "table": "simple",
566 "row": {"i": 2,
567 "r": 3.0,
568 "b": true}}]']],
569 [[000: change conditions
570001: empty
571002: change conditions
572003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
573004: change conditions
574005: empty
575006: {"error":null,"result":[{"uuid":["uuid","<2>"]}]}
576007: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
577008: done
578]])
579
580OVSDB_CHECK_IDL([simple idl, conditional, multiple tables],
581 [['["idltest",
582 {"op": "insert",
583 "table": "simple",
584 "row": {"i": 1,
585 "r": 2.0,
586 "b": true}},
587 {"op": "insert",
588 "table": "link1",
589 "row": {"i": 0, "k": ["named-uuid", "self"]},
590 "uuid-name": "self"},
591 {"op": "insert",
592 "table": "link2",
593 "row": {"i": 2},
594 "uuid-name": "row0"}]']],
0164e367
BP
595 [['condition simple [];link1 [];link2 []' \
596 'condition simple [["i","==",1]]' \
597 'condition link1 [["i","==",0]]' \
598 'condition link2 [["i","==",3]]' \
16ebb90e
LS
599 '+["idltest",
600 {"op": "insert",
601 "table": "link2",
602 "row": {"i": 3},
603 "uuid-name": "row0"}]']],
604 [[000: change conditions
605001: empty
606002: change conditions
607003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
608004: change conditions
609005: i=0 k=0 ka=[] l2= uuid=<2>
610005: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
611006: change conditions
612007: {"error":null,"result":[{"uuid":["uuid","<3>"]}]}
613008: i=0 k=0 ka=[] l2= uuid=<2>
614008: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
615008: i=3 l1= uuid=<3>
616009: done
617]])
618
c3bb4bd7
BP
619OVSDB_CHECK_IDL([self-linking idl, consistent ops],
620 [],
9cb53f26
BP
621 [['["idltest",
622 {"op": "insert",
e9011ac8 623 "table": "link1",
c3bb4bd7
BP
624 "row": {"i": 0, "k": ["named-uuid", "self"]},
625 "uuid-name": "self"}]' \
9cb53f26
BP
626 '["idltest",
627 {"op": "insert",
e9011ac8 628 "table": "link1",
2d2d6d4a 629 "row": {"i": 1, "k": ["named-uuid", "row2"]},
c3bb4bd7
BP
630 "uuid-name": "row1"},
631 {"op": "insert",
e9011ac8 632 "table": "link1",
c3bb4bd7 633 "row": {"i": 2, "k": ["named-uuid", "row1"]},
2d2d6d4a 634 "uuid-name": "row2"}]' \
9cb53f26
BP
635 '["idltest",
636 {"op": "update",
e9011ac8 637 "table": "link1",
c3bb4bd7
BP
638 "where": [["i", "==", 1]],
639 "row": {"k": ["uuid", "#1#"]}}]' \
9cb53f26
BP
640 '["idltest",
641 {"op": "update",
e9011ac8 642 "table": "link1",
c3bb4bd7
BP
643 "where": [],
644 "row": {"k": ["uuid", "#0#"]}}]']],
645 [[000: empty
646001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
e9011ac8 647002: i=0 k=0 ka=[] l2= uuid=<0>
fbf925e4 648003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
e9011ac8
BP
649004: i=0 k=0 ka=[] l2= uuid=<0>
650004: i=1 k=2 ka=[] l2= uuid=<1>
651004: i=2 k=1 ka=[] l2= uuid=<2>
c3bb4bd7 652005: {"error":null,"result":[{"count":1}]}
e9011ac8
BP
653006: i=0 k=0 ka=[] l2= uuid=<0>
654006: i=1 k=1 ka=[] l2= uuid=<1>
655006: i=2 k=1 ka=[] l2= uuid=<2>
c3bb4bd7 656007: {"error":null,"result":[{"count":3}]}
e9011ac8
BP
657008: i=0 k=0 ka=[] l2= uuid=<0>
658008: i=1 k=0 ka=[] l2= uuid=<1>
659008: i=2 k=0 ka=[] l2= uuid=<2>
c3bb4bd7
BP
660009: done
661]])
662
663OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
664 [],
9cb53f26
BP
665 [['["idltest",
666 {"op": "insert",
e9011ac8 667 "table": "link1",
c3bb4bd7 668 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
9cb53f26
BP
669 '+["idltest",
670 {"op": "insert",
e9011ac8 671 "table": "link1",
0d0f05b9
BP
672 "uuid-name": "one",
673 "row": {"i": 1, "k": ["named-uuid", "one"]}},
674 {"op": "insert",
675 "table": "link1",
676 "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
9cb53f26
BP
677 '["idltest",
678 {"op": "update",
e9011ac8 679 "table": "link1",
c3bb4bd7
BP
680 "where": [],
681 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
9cb53f26
BP
682 '+["idltest",
683 {"op": "delete",
e9011ac8 684 "table": "link1",
0d0f05b9 685 "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
9cb53f26
BP
686 '+["idltest",
687 {"op": "delete",
e9011ac8 688 "table": "link1",
0d0f05b9 689 "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
9cb53f26
BP
690 '["idltest",
691 {"op": "delete",
0d0f05b9
BP
692 "table": "link1",
693 "where": []}]' \
c3bb4bd7
BP
694]],
695 [[000: empty
97f7803b 696001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"details":"Table link1 column k row <0> references nonexistent row <1> in table link1.","error":"referential integrity violation"}]}
0d0f05b9
BP
697002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
698003: i=1 k=1 ka=[] l2= uuid=<2>
699003: i=2 k=1 ka=[] l2= uuid=<3>
254604d8 700004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
0d0f05b9
BP
701005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
702006: {"error":null,"result":[{"count":1}]}
703007: i=1 k=1 ka=[] l2= uuid=<2>
704008: {"error":null,"result":[{"count":1}]}
705009: empty
706010: done
254604d8
BP
707]],
708 [],
709 [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
c3bb4bd7
BP
710
711OVSDB_CHECK_IDL([self-linking idl, sets],
712 [],
9cb53f26
BP
713 [['["idltest",
714 {"op": "insert",
e9011ac8 715 "table": "link1",
0d0f05b9 716 "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
c3bb4bd7
BP
717 "uuid-name": "i0"},
718 {"op": "insert",
e9011ac8 719 "table": "link1",
0d0f05b9 720 "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
c3bb4bd7
BP
721 "uuid-name": "i1"},
722 {"op": "insert",
e9011ac8 723 "table": "link1",
0d0f05b9 724 "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
c3bb4bd7
BP
725 "uuid-name": "i2"},
726 {"op": "insert",
e9011ac8 727 "table": "link1",
0d0f05b9 728 "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
c3bb4bd7 729 "uuid-name": "i3"}]' \
9cb53f26
BP
730 '["idltest",
731 {"op": "update",
e9011ac8 732 "table": "link1",
c3bb4bd7
BP
733 "where": [],
734 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
9cb53f26
BP
735 '["idltest",
736 {"op": "update",
e9011ac8 737 "table": "link1",
97f7803b
BP
738 "where": [["i", "==", 2]],
739 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
9cb53f26
BP
740 '+["idltest",
741 {"op": "delete",
0d0f05b9
BP
742 "table": "link1",
743 "where": []}]']],
c3bb4bd7
BP
744 [[000: empty
745001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
0d0f05b9
BP
746002: i=0 k=0 ka=[0] l2= uuid=<0>
747002: i=1 k=0 ka=[1] l2= uuid=<1>
748002: i=2 k=0 ka=[2] l2= uuid=<2>
749002: i=3 k=0 ka=[3] l2= uuid=<3>
c3bb4bd7 750003: {"error":null,"result":[{"count":4}]}
0d0f05b9
BP
751004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
752004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
753004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
754004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
97f7803b 755005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
0d0f05b9
BP
756006: {"error":null,"result":[{"count":4}]}
757007: empty
758008: done
c3bb4bd7
BP
759]])
760
e9011ac8
BP
761OVSDB_CHECK_IDL([external-linking idl, consistent ops],
762 [],
9cb53f26
BP
763 [['["idltest",
764 {"op": "insert",
e9011ac8
BP
765 "table": "link2",
766 "row": {"i": 0},
767 "uuid-name": "row0"},
768 {"op": "insert",
769 "table": "link1",
0d0f05b9 770 "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
e9011ac8
BP
771 "uuid-name": "row1"}]']],
772 [[000: empty
773001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
774002: i=0 l1= uuid=<0>
0d0f05b9 775002: i=1 k=1 ka=[] l2=0 uuid=<1>
e9011ac8
BP
776003: done
777]])
225b582a
IY
778
779OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
780 [],
781 [['linktest']],
782 [[000: empty
783001: commit, status=success
784002: i=1 k=1 ka=[1] l2= uuid=<0>
785002: i=2 k=1 ka=[1 2] l2= uuid=<1>
786003: done
787]])
3b4c362f
IY
788
789OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
790 [],
791 [['getattrtest']],
792 [[000: empty
793001: commit, status=success
794002: i=2 k=2 ka=[] l2= uuid=<0>
795003: done
796]])
d18e52e3 797
d7d417fc
TW
798OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
799 [['["idltest",
800 {"op": "insert",
801 "table": "simple",
802 "row": {"i": 1}},
803 {"op": "insert",
804 "table": "simple",
805 "row": {}}]']],
806 [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']],
807 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
808000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
809001: commit, status=success, events=create|2|None, delete|0|None, update|1|b
810002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
811002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>
812003: done
813]])
814
d18e52e3
BP
815AT_SETUP([idl handling of missing tables and columns - C])
816AT_KEYWORDS([ovsdb server idl positive])
d18e52e3
BP
817
818# idltest2.ovsschema is the same as idltest.ovsschema, except that
819# table link2 and column l2 have been deleted. But the IDL still
820# expects them to be there, so this test checks that it properly
821# tolerates them being missing.
56120500 822AT_CHECK([ovsdb_start_idltest "" "$abs_srcdir/idltest2.ovsschema"])
d18e52e3
BP
823AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest",
824 {"op": "insert",
825 "table": "link1",
826 "row": {"i": 0, "k": ["named-uuid", "self"]},
827 "uuid-name": "self"}]' \
828 '["idltest",
829 {"op": "insert",
830 "table": "link1",
831 "row": {"i": 1, "k": ["named-uuid", "row2"]},
832 "uuid-name": "row1"},
833 {"op": "insert",
834 "table": "link1",
835 "row": {"i": 2, "k": ["named-uuid", "row1"]},
836 "uuid-name": "row2"}]' \
837 '["idltest",
838 {"op": "update",
839 "table": "link1",
840 "where": [["i", "==", 1]],
841 "row": {"k": ["uuid", "#1#"]}}]' \
842 '["idltest",
843 {"op": "update",
844 "table": "link1",
845 "where": [],
846 "row": {"k": ["uuid", "#0#"]}}]']],
5a0e4aec 847 [0], [stdout], [stderr])
c724bd67 848AT_CHECK([sort stdout | uuidfilt], [0],
d18e52e3
BP
849 [[000: empty
850001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
851002: i=0 k=0 ka=[] l2= uuid=<0>
852003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
853004: i=0 k=0 ka=[] l2= uuid=<0>
854004: i=1 k=2 ka=[] l2= uuid=<1>
855004: i=2 k=1 ka=[] l2= uuid=<2>
856005: {"error":null,"result":[{"count":1}]}
857006: i=0 k=0 ka=[] l2= uuid=<0>
858006: i=1 k=1 ka=[] l2= uuid=<1>
859006: i=2 k=1 ka=[] l2= uuid=<2>
860007: {"error":null,"result":[{"count":3}]}
861008: i=0 k=0 ka=[] l2= uuid=<0>
862008: i=1 k=0 ka=[] l2= uuid=<1>
863008: i=2 k=0 ka=[] l2= uuid=<2>
864009: done
7427f2a4 865]])
d18e52e3
BP
866
867# Check that ovsdb-idl figured out that table link2 and column l2 are missing.
868AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl
869test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?)
870test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?)
871])
872
873# Check that ovsdb-idl sent on "monitor" request and that it didn't
874# mention that table or column, and (for paranoia) that it did mention another
875# table and column.
1b1d2e6d 876AT_CHECK([grep -c '"monitor\|monitor_cond"' stderr], [0], [2
d18e52e3 877])
c383f3bf
LS
878AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep link2], [1])
879AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep l2], [1])
880AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"link1"'], [0], [1
d18e52e3 881])
c383f3bf 882AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
d18e52e3
BP
883])
884OVSDB_SERVER_SHUTDOWN
885AT_CLEANUP
80c12152 886
f62a20d8
TR
887m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN],
888 [AT_SETUP([$1 fetch])
889 AT_SKIP_IF([test $8 = no])
80c12152 890 AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6])
56120500 891 AT_CHECK([ovsdb_start_idltest])
80c12152 892 m4_if([$2], [], [],
7427f2a4 893 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
f62a20d8 894 AT_CHECK([$9 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
7427f2a4 895 [0], [stdout], [ignore])
c724bd67 896 AT_CHECK([sort stdout | uuidfilt]m4_if([$7],,, [[| $7]]),
7427f2a4 897 [0], [$5])
80c12152
SA
898 OVSDB_SERVER_SHUTDOWN
899 AT_CLEANUP])
900
f62a20d8
TR
901m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
902 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6], [$7],
903 [$HAVE_PYTHON], [$PYTHON])
904 OVSDB_CHECK_IDL_FETCH_COLUMNS_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6], [$7],
905 [$HAVE_PYTHON3], [$PYTHON3])])
906
80c12152
SA
907m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
908 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])
909
910OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
911 [['["idltest",
912 {"op": "insert",
913 "table": "simple",
914 "row": {"i": 1,
915 "r": 2.0,
916 "b": true,
917 "s": "mystring",
918 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
919 "ia": ["set", [1, 2, 3]],
920 "ra": ["set", [-0.5]],
921 "ba": ["set", [true]],
922 "sa": ["set", ["abc", "def"]],
923 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
924 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
925 {"op": "insert",
926 "table": "simple",
927 "row": {}}]']],
928 [?simple:i,r!],
929 ['fetch 0 r'],
930 [[000: i=0 uuid=<0>
931000: i=1 uuid=<1>
932001: commit, status=success
933002: i=0 r=0 uuid=<0>
934002: i=1 uuid=<1>
935003: done
936]])
932104f4 937
f62a20d8
TR
938m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN],
939 [AT_SETUP([$1])
940 AT_SKIP_IF([test $6 = no])
897c8064 941 AT_KEYWORDS([ovsdb server idl Python monitor $4])
56120500
BP
942 AT_CHECK([ovsdb_start_idltest])
943 AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond])
f62a20d8 944 AT_CHECK([$7 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
7ef00082 945 [0], [stdout], [ignore])
c724bd67 946 AT_CHECK([sort stdout | uuidfilt]m4_if([$5],,, [[| $5]]),
7ef00082 947 [0], [$3])
897c8064
LS
948 OVSDB_SERVER_SHUTDOWN
949 AT_CLEANUP])
950
f62a20d8
TR
951m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
952 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
953 [$HAVE_PYTHON], [$PYTHON])
954 OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
955 [$HAVE_PYTHON3], [$PYTHON3])])
956
897c8064
LS
957
958m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
959 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])
960
961
962OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond],
963 [['["idltest",
964 {"op": "insert",
965 "table": "simple",
966 "row": {"i": 1,
967 "r": 2.0,
968 "b": true,
969 "s": "mystring",
970 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
971 "ia": ["set", [1, 2, 3]],
972 "ra": ["set", [-0.5]],
973 "ba": ["set", [true]],
974 "sa": ["set", ["abc", "def"]],
975 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
976 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
977 {"op": "insert",
978 "table": "simple",
979 "row": {}}]' \
980 '["idltest",
981 {"op": "update",
982 "table": "simple",
983 "where": [],
984 "row": {"b": true}}]' \
985 '["idltest",
986 {"op": "update",
987 "table": "simple",
988 "where": [],
989 "row": {"r": 123.5}}]' \
990 '["idltest",
991 {"op": "insert",
992 "table": "simple",
993 "row": {"i": -1,
994 "r": 125,
995 "b": false,
996 "s": "",
997 "ia": ["set", [1]],
998 "ra": ["set", [1.5]],
999 "ba": ["set", [false]],
1000 "sa": ["set", []],
1001 "ua": ["set", []]}}]' \
1002 '["idltest",
1003 {"op": "update",
1004 "table": "simple",
1005 "where": [["i", "<", 1]],
1006 "row": {"s": "newstring"}}]' \
1007 '["idltest",
1008 {"op": "delete",
1009 "table": "simple",
1010 "where": [["i", "==", 0]]}]' \
1011 'reconnect']],
1012 [[000: empty
1013001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1014002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1015002: 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>
1016003: {"error":null,"result":[{"count":2}]}
1017004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1018004: 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>
1019005: {"error":null,"result":[{"count":2}]}
1020006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1021006: 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>
1022007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1023008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1024008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1025008: 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>
1026009: {"error":null,"result":[{"count":2}]}
1027010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1028010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1029010: 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>
1030011: {"error":null,"result":[{"count":1}]}
1031012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1032012: 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>
1033013: reconnect
1034014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1035014: 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>
1036015: done
1037]])
1038
932104f4
SA
1039m4_define([OVSDB_CHECK_IDL_TRACK_C],
1040 [AT_SETUP([$1 - C])
1041 AT_KEYWORDS([ovsdb server idl tracking positive $5])
56120500 1042 AT_CHECK([ovsdb_start_idltest])
932104f4 1043 m4_if([$2], [], [],
7427f2a4 1044 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
932104f4 1045 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3],
7427f2a4 1046 [0], [stdout], [ignore])
c724bd67 1047 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 1048 [0], [$4])
932104f4
SA
1049 OVSDB_SERVER_SHUTDOWN
1050 AT_CLEANUP])
1051
1052m4_define([OVSDB_CHECK_IDL_TRACK],
1053 [OVSDB_CHECK_IDL_TRACK_C($@)])
1054
1055OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated],
1056 [['["idltest",
1057 {"op": "insert",
1058 "table": "simple",
1059 "row": {"i": 1,
1060 "r": 2.0,
1061 "b": true,
1062 "s": "mystring",
1063 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1064 "ia": ["set", [1, 2, 3]],
1065 "ra": ["set", [-0.5]],
1066 "ba": ["set", [true]],
1067 "sa": ["set", ["abc", "def"]],
1068 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1069 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1070 {"op": "insert",
1071 "table": "simple",
1072 "row": {}}]']],
1073 [['["idltest",
1074 {"op": "update",
1075 "table": "simple",
1076 "where": [],
1077 "row": {"b": true}}]']],
1078 [[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>
32d37ce8 1079000: updated columns: b ba i ia r ra s sa u ua
932104f4
SA
1080001: {"error":null,"result":[{"count":2}]}
1081002: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5>
1082002: 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>
32d37ce8 1083002: updated columns: b
932104f4
SA
1084003: done
1085]])
1086
1087OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
1088 [],
1089 [['["idltest",
1090 {"op": "insert",
1091 "table": "simple",
1092 "row": {"i": 1,
1093 "r": 2.0,
1094 "b": true,
1095 "s": "mystring",
1096 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1097 "ia": ["set", [1, 2, 3]],
1098 "ra": ["set", [-0.5]],
1099 "ba": ["set", [true]],
1100 "sa": ["set", ["abc", "def"]],
1101 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1102 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1103 {"op": "insert",
1104 "table": "simple",
1105 "row": {}}]' \
1106 '["idltest",
1107 {"op": "update",
1108 "table": "simple",
1109 "where": [],
1110 "row": {"b": true}}]' \
1111 '["idltest",
1112 {"op": "update",
1113 "table": "simple",
1114 "where": [],
1115 "row": {"r": 123.5}}]' \
1116 '["idltest",
1117 {"op": "insert",
1118 "table": "simple",
1119 "row": {"i": -1,
1120 "r": 125,
1121 "b": false,
1122 "s": "",
1123 "ia": ["set", [1]],
1124 "ra": ["set", [1.5]],
1125 "ba": ["set", [false]],
1126 "sa": ["set", []],
1127 "ua": ["set", []]}}]' \
1128 '["idltest",
1129 {"op": "update",
1130 "table": "simple",
1131 "where": [["i", "<", 1]],
1132 "row": {"s": "newstring"}}]' \
1133 '["idltest",
1134 {"op": "delete",
1135 "table": "simple",
1136 "where": [["i", "==", 0]]}]' \
1137 'reconnect']],
1138 [[000: empty
1139001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1140002: 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>
32d37ce8 1141002: updated columns: b ba i ia r ra s sa u ua
932104f4
SA
1142003: {"error":null,"result":[{"count":2}]}
1143004: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
32d37ce8 1144004: updated columns: b
932104f4
SA
1145005: {"error":null,"result":[{"count":2}]}
1146006: i=0 r=123.5 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1147006: 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>
32d37ce8
SA
1148006: updated columns: r
1149006: updated columns: r
932104f4
SA
1150007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1151008: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
32d37ce8 1152008: updated columns: ba i ia r ra
932104f4
SA
1153009: {"error":null,"result":[{"count":2}]}
1154010: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1155010: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
32d37ce8
SA
1156010: updated columns: s
1157010: updated columns: s
932104f4
SA
1158011: {"error":null,"result":[{"count":1}]}
1159012: ##deleted## uuid=<1>
1160013: reconnect
1161014: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1162014: 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>
32d37ce8
SA
1163014: updated columns: b ba i ia r ra s sa u ua
1164014: updated columns: ba i ia r ra s
932104f4
SA
1165015: done
1166]])
7251075c
EA
1167
1168m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN],
1169 [AT_SETUP([$1 - C])
1170 AT_KEYWORDS([ovsdb server idl partial update map column positive $5])
56120500 1171 AT_CHECK([ovsdb_start_idltest])
7251075c 1172 m4_if([$2], [], [],
7427f2a4 1173 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
7251075c 1174 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3],
7427f2a4 1175 [0], [stdout], [ignore])
c724bd67 1176 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
7427f2a4 1177 [0], [$4])
7251075c
EA
1178 OVSDB_SERVER_SHUTDOWN
1179 AT_CLEANUP])
1180
1181OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-column, initially populated],
1182[['["idltest", {"op":"insert", "table":"simple2",
1183 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
1184],
1185[],
1186[[000: Getting records
1187001: name=myString1 smap=[[key1 : value1],[key2 : value2]] imap=[]
1188002: After insert element
1189003: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
1190004: After insert duplicated element
1191005: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
1192006: After delete element
1193007: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
1194008: After trying to delete a deleted element
1195009: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
1196010: End test
1197]])
a7261bf7 1198
a59912a0
RM
1199OVSDB_CHECK_IDL_PY([partial-map idl],
1200[['["idltest", {"op":"insert", "table":"simple2",
330b9c9c 1201 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
a59912a0 1202],
2d54d801 1203 [?simple2:name,smap,imap 'partialmapinsertelement' 'partialmapinsertmultipleelements' 'partialmapdelelements' 'partialmapmutatenew'],
330b9c9c 1204[[000: name=myString1 smap=[(key1 value1) (key2 value2)] imap=[]
a59912a0 1205001: commit, status=success
330b9c9c 1206002: name=String2 smap=[(key1 myList1) (key2 value2)] imap=[(3 myids2)]
a59912a0 1207003: commit, status=success
2d54d801 1208004: name=String2 smap=[(key1 myList1) (key2 myList2) (key3 myList3) (key4 myList4)] imap=[(3 myids2)]
330b9c9c
AB
1209005: commit, status=success
1210006: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
2d54d801
AB
1211007: commit, status=success
1212008: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
1213008: name=String2New smap=[(key1 newList1) (key2 newList2)] imap=[]
1214009: done
a59912a0
RM
1215]])
1216
f1ab6e06
RM
1217m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN],
1218 [AT_SETUP([$1 - C])
1219 AT_KEYWORDS([ovsdb server idl partial update set column positive $5])
56120500 1220 AT_CHECK([ovsdb_start_idltest])
f1ab6e06
RM
1221 m4_if([$2], [], [],
1222 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1223 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3],
1224 [0], [stdout], [ignore])
c724bd67 1225 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
f1ab6e06
RM
1226 [0], [$4])
1227 OVSDB_SERVER_SHUTDOWN
1228 AT_CLEANUP])
1229
1230OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-column, initially populated],
1231[['["idltest", {"op":"insert", "table":"simple3",
1232 "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ], [ "uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff" ]]]} }]']
1233],
1234[],
1235[[000: Getting records
1236001: name=mySet1 uset=[[<0>],[<1>]] uref=[]
1237002: After rename+add new value
1238003: name=String2 uset=[[<0>],[<1>],[<2>]] uref=[]
1239004: After add new value
1240005: name=String2 uset=[[<0>],[<1>],[<2>],[<3>]] uref=[]
1241006: After delete value
1242007: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
1243008: After trying to delete a deleted value
1244009: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
1245010: After add to other table + set of strong ref
1246011: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[[<4>]]
1247012: End test
1248]])
1249
a59912a0 1250OVSDB_CHECK_IDL_PY([partial-set idl],
b3220c67
AB
1251[['["idltest", {"op":"insert", "table":"simple3", "uuid-name":"newrow",
1252 "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ]]]} },
1253 {"op":"insert", "table":"simple4", "row":{"name":"seed"}},
1254 {"op":"mutate", "table":"simple3", "where":[["_uuid", "==", ["named-uuid", "newrow"]]],
1255 "mutations": [["uset", "insert", ["set", [["uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff"]]]]]}]']
a59912a0 1256],
2d54d801 1257 ['partialrenamesetadd' 'partialduplicateadd' 'partialsetdel' 'partialsetref' 'partialsetoverrideops' 'partialsetadddelete' 'partialsetmutatenew'],
a59912a0
RM
1258[[000: name=mySet1 uset=[<0> <1>]
1259001: commit, status=success
1260002: name=String2 uset=[<0> <1> <2>]
1261003: commit, status=success
1262004: name=String2 uset=[<0> <1> <2> <3>]
1263005: commit, status=success
1264006: name=String2 uset=[<0> <1> <3>]
1265007: commit, status=success
1266008: name=String2 uset=[<0> <1> <3>]
330b9c9c
AB
1267009: commit, status=success
1268010: name=String2 uset=[<3>]
b3220c67 1269011: commit, status=success
2d54d801
AB
1270012: name=String2 uset=[<4> <5>]
1271013: commit, status=success
1272014: name=String2 uset=[<4> <5>]
1273014: name=String3 uset=[<6>]
1274015: done
a59912a0
RM
1275]])
1276
f62a20d8 1277m4_define([OVSDB_CHECK_IDL_NOTIFY_PYN],
b4273ac9 1278 [OVSDB_CHECK_IDL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
a7261bf7 1279
f62a20d8
TR
1280m4_define([OVSDB_CHECK_IDL_NOTIFY_PY],
1281 [OVSDB_CHECK_IDL_NOTIFY_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
1282 [$HAVE_PYTHON], [$PYTHON])
1283 OVSDB_CHECK_IDL_NOTIFY_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
1284 [$HAVE_PYTHON3], [$PYTHON3])])
1285
d90ed7d6 1286# This test uses the Python IDL implementation with ssl
f62a20d8 1287m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PYN],
61845323 1288 [OVSDB_CHECK_IDL_SSL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
a7261bf7 1289
f62a20d8
TR
1290m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PY],
1291 [OVSDB_CHECK_IDL_NOTIFY_SSL_PYN([$1 - Python2], [$2], [$3], [$4], [$5],
1292 [$HAVE_PYTHON], [$PYTHON])
1293 OVSDB_CHECK_IDL_NOTIFY_SSL_PYN([$1 - Python3], [$2], [$3], [$4], [$5],
1294 [$HAVE_PYTHON3], [$PYTHON3])])
1295
a7261bf7 1296m4_define([OVSDB_CHECK_IDL_NOTIFY],
d90ed7d6
NS
1297 [OVSDB_CHECK_IDL_NOTIFY_PY($@)
1298 OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])
a7261bf7
NS
1299
1300OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
1301 [['track-notify' \
1302 '["idltest",
1303 {"op": "insert",
1304 "table": "simple",
1305 "row": {"i": 1,
1306 "r": 2.0,
1307 "b": true,
1308 "s": "mystring",
1309 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
1310 "ia": ["set", [1, 2, 3]],
1311 "ra": ["set", [-0.5]],
1312 "ba": ["set", [true]],
1313 "sa": ["set", ["abc", "def"]],
1314 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
1315 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
1316 {"op": "insert",
1317 "table": "simple",
1318 "row": {}}]' \
1319 '["idltest",
1320 {"op": "update",
1321 "table": "simple",
1322 "where": [],
1323 "row": {"b": false}}]' \
1324 '["idltest",
1325 {"op": "update",
1326 "table": "simple",
1327 "where": [],
1328 "row": {"r": 123.5}}]' \
1329 '["idltest",
1330 {"op": "insert",
1331 "table": "simple",
1332 "row": {"i": -1,
1333 "r": 125,
1334 "b": false,
1335 "s": "",
1336 "ia": ["set", [1]],
1337 "ra": ["set", [1.5]],
1338 "ba": ["set", [false]],
1339 "sa": ["set", []],
1340 "ua": ["set", []]}}]' \
1341 '["idltest",
1342 {"op": "update",
1343 "table": "simple",
1344 "where": [["i", "<", 1]],
1345 "row": {"s": "newstring"}}]' \
1346 '["idltest",
1347 {"op": "delete",
1348 "table": "simple",
1349 "where": [["i", "==", 0]]}]' \
1350 'reconnect']],
1351 [[000: empty
1352001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
1353002: event:create, row={i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
1354002: 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
1355002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1356002: 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>
1357003: {"error":null,"result":[{"count":2}]}
1358004: 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>}
1359004: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1360004: 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>
1361005: {"error":null,"result":[{"count":2}]}
1362006: 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>}
1363006: 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>}
1364006: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1365006: 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>
1366007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
1367008: 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
1368008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1369008: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1370008: 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>
1371009: {"error":null,"result":[{"count":2}]}
1372010: 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>}
1373010: 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>}
1374010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1375010: i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
1376010: 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>
1377011: {"error":null,"result":[{"count":1}]}
1378012: event:delete, row={i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
1379012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1380012: 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>
1381013: reconnect
1382014: 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
1383014: 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
1384014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
1385014: 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>
1386015: done
1387]])
0a8606ee
LR
1388
1389# Tests to verify the functionality of the one column compound index.
1390# It tests index for one column string and integer indexes.
1391# The run of test-ovsdb generates the output of the display of data using the different indexes defined in
1392# the program.
1393# Then, some at_checks are used to verify the correctness of the corresponding index as well as the existence
1394# of all the rows involved in the test.
1395m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C],
1396 [AT_SETUP([$1 - C])
1397 AT_KEYWORDS([ovsdb server idl compound_index_single_column compound_index positive $5])
1398 AT_CHECK([ovsdb_start_idltest])
1399 m4_if([$2], [], [],
7ef00082 1400 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
0a8606ee
LR
1401# Generate the data to be tested.
1402 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index unix:socket $3],
7ef00082 1403 [0], [stdout], [ignore])
0a8606ee
LR
1404# Filter the rows of data that corresponds to the string index eliminating the extra columns of data.
1405# This is done to verifiy that the output data is in the correct and expected order.
1406 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sed -e 's/ i=.*//g']],
7ef00082 1407 [0], [$4])
0a8606ee
LR
1408# Here, the data is filtered and sorted in order to have all the rows in the index and be
1409# able to determined that all the involved rows are present.
1410 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
7ef00082 1411 [0], [$5])
0a8606ee
LR
1412# Filter the rows of data that corresponds to the integer index eliminating the extra columns of data.
1413# This is done to verifiy that the output data is in the correct and expected order.
1414 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sed -e 's/ s=.*//g']],
7ef00082 1415 [0], [$6])
0a8606ee
LR
1416# Here again, the data is filtered and sorted in order to have all the rows in the index and be
1417# able to determined that all the involved rows are present.
1418 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
7ef00082 1419 [0], [$7])
0a8606ee
LR
1420 OVSDB_SERVER_SHUTDOWN
1421 AT_CLEANUP])
1422
1423OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column test ],
1424 [['["idltest",
1425 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 1, "b":true, "r":101.0}},
1426 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 2, "b":false, "r":102.0}},
1427 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 10, "b":true, "r":110.0}},
1428 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 1, "b":false, "r":110.0}},
1429 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":120.0}},
1430 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":122.0}},
1431 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 4, "b":true, "r":130.0}},
1432 {"op": "insert", "table": "simple", "row": {"s":"List005", "i": 5, "b":true, "r":130.0}},
1433 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 20, "b":true, "r":220.0}},
1434 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 19, "b":true, "r":219.0}}
1435 ]']],
1436 [idl_compound_index_single_column],
1437 [001: s=List000
1438001: s=List000
1439001: s=List000
1440001: s=List001
1441001: s=List001
1442001: s=List001
1443001: s=List001
1444001: s=List005
1445001: s=List020
1446001: s=List020
1447003: s=List001
1448003: s=List001
1449003: s=List001
1450003: s=List001
1451],
1452[001: s=List000 i=1 b=True r=101.000000
1453001: s=List000 i=10 b=True r=110.000000
1454001: s=List000 i=2 b=False r=102.000000
1455001: s=List001 i=1 b=False r=110.000000
1456001: s=List001 i=2 b=True r=120.000000
1457001: s=List001 i=2 b=True r=122.000000
1458001: s=List001 i=4 b=True r=130.000000
1459001: s=List005 i=5 b=True r=130.000000
1460001: s=List020 i=19 b=True r=219.000000
1461001: s=List020 i=20 b=True r=220.000000
1462003: s=List001 i=1 b=False r=110.000000
1463003: s=List001 i=2 b=True r=120.000000
1464003: s=List001 i=2 b=True r=122.000000
1465003: s=List001 i=4 b=True r=130.000000
1466],
1467[002: i=1
1468002: i=1
1469002: i=2
1470002: i=2
1471002: i=2
1472002: i=4
1473002: i=5
1474002: i=10
1475002: i=19
1476002: i=20
1477004: i=5
1478005: i=4
1479005: i=5
1480006: i=5
1481006: i=10
1482006: i=19
1483006: i=20
1484006: i=54
1485007: i=1
1486007: i=1
1487007: i=2
1488007: i=2
1489007: i=2
1490007: i=5
1491007: i=10
1492007: i=19
1493007: i=20
1494007: i=54
1495],
1496[002: i=1 s=List000 b=True r=101.000000
1497002: i=1 s=List001 b=False r=110.000000
1498002: i=10 s=List000 b=True r=110.000000
1499002: i=19 s=List020 b=True r=219.000000
1500002: i=2 s=List000 b=False r=102.000000
1501002: i=2 s=List001 b=True r=120.000000
1502002: i=2 s=List001 b=True r=122.000000
1503002: i=20 s=List020 b=True r=220.000000
1504002: i=4 s=List001 b=True r=130.000000
1505002: i=5 s=List005 b=True r=130.000000
1506004: i=5 s=List005 b=True r=130.000000
1507005: i=4 s=List001 b=True r=130.000000
1508005: i=5 s=List005 b=True r=130.000000
1509006: i=10 s=List000 b=True r=110.000000
1510006: i=19 s=List020 b=True r=219.000000
1511006: i=20 s=List020 b=True r=220.000000
1512006: i=5 s=List005 b=True r=130.000000
1513006: i=54 s=Lista054 b=False r=0.000000
1514007: i=1 s=List000 b=True r=101.000000
1515007: i=1 s=List001 b=False r=110.000000
1516007: i=10 s=List000 b=True r=110.000000
1517007: i=19 s=List020 b=True r=219.000000
1518007: i=2 s=List000 b=False r=102.000000
1519007: i=2 s=List001 b=True r=120.000000
1520007: i=2 s=List001 b=True r=122.000000
1521007: i=20 s=List020 b=True r=220.000000
1522007: i=5 s=List005 b=True r=130.000000
1523007: i=54 s=Lista054 b=False r=0.000000
1524])
1525
1526# Tests to verify the functionality of two column compound index.
1527# It tests index for two columns using string and integer fields.
1528# The run of test-ovsdb generates the output of the display of data using the different indexes defined in
1529# the program.
1530# Then, some at_checks are used to verify the correctness of the corresponding index as well as the existence
1531# of all the rows involved in the test.
1532m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C],
1533 [AT_SETUP([$1 - C])
1534 AT_KEYWORDS([ovsdb server idl compound_index_double_column compound_index positive $5])
1535 AT_CHECK([ovsdb_start_idltest])
1536 m4_if([$2], [], [],
7ef00082 1537 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
0a8606ee
LR
1538# Generate the data to be tested.
1539 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index unix:socket $3],
7ef00082 1540 [0], [stdout], [ignore])
0a8606ee
LR
1541# Filter the rows of data that corresponds to the string-integer index eliminating the extra columns of data.
1542# This is done to verifiy that the output data is in the correct and expected order.
1543 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sed -e 's/ b=.*//g']],
7ef00082 1544 [0], [$4])
0a8606ee
LR
1545# Here, the data is filtered and sorted in order to have all the rows in the index and be
1546# able to determined that all the involved rows are present.
1547 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: s=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
7ef00082 1548 [0], [$5])
0a8606ee
LR
1549# Filter the rows of data that corresponds to the integer index eliminating the extra columns of data.
1550# This is done to verifiy that the output data is in the correct and expected order.
1551 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sed -e 's/ b=.*//g']],
7ef00082 1552 [0], [$6])
0a8606ee
LR
1553# Here again, the data is filtered and sorted in order to have all the rows in the index and be
1554# able to determined that all the involved rows are present.
1555 AT_CHECK([[cat stdout | grep -oh '[0-9]\{3\}: i=.*' | sort -k 1,1n -k 2,2 -k 3,3]],
7ef00082 1556 [0], [$7])
0a8606ee
LR
1557 OVSDB_SERVER_SHUTDOWN
1558 AT_CLEANUP])
1559
1560OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column test ],
1561 [['["idltest",
1562 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 1, "b":true, "r":101.0}},
1563 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 2, "b":false, "r":102.0}},
1564 {"op": "insert", "table": "simple", "row": {"s":"List000", "i": 10, "b":true, "r":110.0}},
1565 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 1, "b":false, "r":110.0}},
1566 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":120.0}},
1567 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 2, "b":true, "r":122.0}},
1568 {"op": "insert", "table": "simple", "row": {"s":"List001", "i": 4, "b":true, "r":130.0}},
1569 {"op": "insert", "table": "simple", "row": {"s":"List005", "i": 5, "b":true, "r":130.0}},
1570 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 20, "b":true, "r":220.0}},
1571 {"op": "insert", "table": "simple", "row": {"s":"List020", "i": 19, "b":true, "r":219.0}}
1572 ]']],
1573 [idl_compound_index_double_column],
1574 [001: s=List000 i=1
1575001: s=List000 i=2
1576001: s=List000 i=10
1577001: s=List001 i=1
1578001: s=List001 i=2
1579001: s=List001 i=2
1580001: s=List001 i=4
1581001: s=List005 i=5
1582001: s=List020 i=19
1583001: s=List020 i=20
1584002: s=List000 i=10
1585002: s=List000 i=2
1586002: s=List000 i=1
1587002: s=List001 i=4
1588002: s=List001 i=2
1589002: s=List001 i=2
1590002: s=List001 i=1
1591002: s=List005 i=5
1592002: s=List020 i=20
1593002: s=List020 i=19
1594003: s=List000 i=10
1595004: s=List001 i=1
1596004: s=List001 i=2
1597004: s=List001 i=2
1598004: s=List001 i=4
1599004: s=List005 i=5
1600],
1601 [001: s=List000 i=1 b=True r=101.000000
1602001: s=List000 i=10 b=True r=110.000000
1603001: s=List000 i=2 b=False r=102.000000
1604001: s=List001 i=1 b=False r=110.000000
1605001: s=List001 i=2 b=True r=120.000000
1606001: s=List001 i=2 b=True r=122.000000
1607001: s=List001 i=4 b=True r=130.000000
1608001: s=List005 i=5 b=True r=130.000000
1609001: s=List020 i=19 b=True r=219.000000
1610001: s=List020 i=20 b=True r=220.000000
1611002: s=List000 i=1 b=True r=101.000000
1612002: s=List000 i=10 b=True r=110.000000
1613002: s=List000 i=2 b=False r=102.000000
1614002: s=List001 i=1 b=False r=110.000000
1615002: s=List001 i=2 b=True r=120.000000
1616002: s=List001 i=2 b=True r=122.000000
1617002: s=List001 i=4 b=True r=130.000000
1618002: s=List005 i=5 b=True r=130.000000
1619002: s=List020 i=19 b=True r=219.000000
1620002: s=List020 i=20 b=True r=220.000000
1621003: s=List000 i=10 b=True r=110.000000
1622004: s=List001 i=1 b=False r=110.000000
1623004: s=List001 i=2 b=True r=120.000000
1624004: s=List001 i=2 b=True r=122.000000
1625004: s=List001 i=4 b=True r=130.000000
1626004: s=List005 i=5 b=True r=130.000000
1627],
1628 [005: i=1 s=List000
1629005: i=1 s=List001
1630005: i=2 s=List000
1631005: i=2 s=List001
1632005: i=2 s=List001
1633005: i=4 s=List001
1634005: i=5 s=List005
1635005: i=10 s=List000
1636005: i=19 s=List020
1637005: i=20 s=List020
1638006: i=20 s=List020
1639006: i=19 s=List020
1640006: i=10 s=List000
1641006: i=5 s=List005
1642006: i=4 s=List001
1643006: i=2 s=List000
1644006: i=2 s=List001
1645006: i=2 s=List001
1646006: i=1 s=List000
1647006: i=1 s=List001
1648],
1649 [005: i=1 s=List000 b=True r=101.000000
1650005: i=1 s=List001 b=False r=110.000000
1651005: i=10 s=List000 b=True r=110.000000
1652005: i=19 s=List020 b=True r=219.000000
1653005: i=2 s=List000 b=False r=102.000000
1654005: i=2 s=List001 b=True r=120.000000
1655005: i=2 s=List001 b=True r=122.000000
1656005: i=20 s=List020 b=True r=220.000000
1657005: i=4 s=List001 b=True r=130.000000
1658005: i=5 s=List005 b=True r=130.000000
1659006: i=1 s=List000 b=True r=101.000000
1660006: i=1 s=List001 b=False r=110.000000
1661006: i=10 s=List000 b=True r=110.000000
1662006: i=19 s=List020 b=True r=219.000000
1663006: i=2 s=List000 b=False r=102.000000
1664006: i=2 s=List001 b=True r=120.000000
1665006: i=2 s=List001 b=True r=122.000000
1666006: i=20 s=List020 b=True r=220.000000
1667006: i=4 s=List001 b=True r=130.000000
1668006: i=5 s=List005 b=True r=130.000000
1669])
3cc1634f
HZ
1670
1671m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF],
1672 [AT_SETUP([$1 - C])
1673 AT_KEYWORDS([ovsdb server idl compound_index compound_index_with_ref positive $5])
1674 AT_CHECK([ovsdb_start_idltest])
1675 m4_if([$2], [], [],
1676 [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
1677 AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-compound-index-with-ref unix:socket $3],
1678 [0], [stdout], [ignore])
c724bd67 1679 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
3cc1634f
HZ
1680 [0], [$4])
1681 OVSDB_SERVER_SHUTDOWN
1682 AT_CLEANUP])
1683
1684OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF([set, simple3 idl-compound-index-with-ref, initially populated],
1685[],
1686[],
1687[[000: After add to other table + set of strong ref
1688001: name= uset=[] uref=[[<0>]]
1689002: check simple4: not empty
1690003: Query using index with reference
1691004: name= uset=[] uref=[[<0>]]
1692005: After delete
1693007: check simple4: empty
1694008: End test
1695]])