1 AT_BANNER([OVSDB -- interface description language (IDL)])
3 m4_divert_text([PREPARE_TESTS], [
4 # ovsdb_start_idltest [REMOTE] [SCHEMA]
6 # Creates a database using SCHEMA (default: idltest.ovsschema) and
7 # starts a database server listening on punix:socket and REMOTE (if
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`'
16 # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
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.
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.
31 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
32 m4_define([OVSDB_CHECK_IDL_C],
34 AT_KEYWORDS([ovsdb server idl positive $5])
35 AT_CHECK([ovsdb_start_idltest])
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]]),
45 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
46 m4_define([OVSDB_CHECK_IDL_PYN],
48 AT_SKIP_IF([test $7 = no])
49 AT_KEYWORDS([ovsdb server idl positive Python $5])
50 AT_CHECK([ovsdb_start_idltest])
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]]),
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])])
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])
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]]),
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])])
86 # same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
87 m4_define([OVSDB_CHECK_IDL_TCP_PYN],
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])
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]]),
100 OVSDB_SERVER_SHUTDOWN
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])])
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
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]]),
126 OVSDB_SERVER_SHUTDOWN
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])])
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"
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]]),
152 OVSDB_SERVER_SHUTDOWN
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])])
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"
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]]),
178 OVSDB_SERVER_SHUTDOWN
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])])
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"
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 \
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])
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]]),
219 OVSDB_SERVER_SHUTDOWN
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])])
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($@)])
238 # This test uses the Python IDL implementation with passive tcp
239 m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PYN],
241 AT_SKIP_IF([test $7 = no])
242 AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
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
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]]),
255 OVSDB_SERVER_SHUTDOWN
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])])
265 OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
267 [['["idltest",{"op":"select","table":"link1","where":[]}]']],
269 001: {"error":null,"result":[{"rows":[]}]}
273 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
280 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
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"]]]}},
303 "row": {"b": true}}]' \
308 "row": {"r": 123.5}}]' \
317 "ra": ["set", [1.5]],
318 "ba": ["set", [false]],
320 "ua": ["set", []]}}]' \
324 "where": [["i", "<", 1]],
325 "row": {"s": "newstring"}}]' \
329 "where": [["i", "==", 0]]}]' \
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>
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>
358 OVSDB_CHECK_IDL([simple idl, initially populated],
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"]]]}},
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>
389 OVSDB_CHECK_IDL([simple idl, writing via IDL],
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"]]]}},
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>
420 OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode],
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>
433 m4_define([OVSDB_CHECK_IDL_PYN_WITH_EXPOUT],
435 AT_SKIP_IF([test $7 = no])
436 AT_KEYWORDS([ovsdb server idl positive Python $5])
437 AT_CHECK([ovsdb_start_idltest])
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])
443 AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]),
445 OVSDB_SERVER_SHUTDOWN
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])])
454 OVSDB_CHECK_IDL_PY_WITH_EXPOUT([simple idl, writing large data via IDL with unicode],
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>
466 OVSDB_CHECK_IDL([simple idl, handling verification failure],
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' \
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>
497 OVSDB_CHECK_IDL([simple idl, increment operation],
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>
509 OVSDB_CHECK_IDL([simple idl, aborting],
514 [['set 0 r 2.0, abort' \
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>
523 OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
528 [['set 0 r 2.0, destroy' \
530 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
532 002: commit, status=success
533 003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
537 OVSDB_CHECK_IDL([simple idl, conditional, false condition],
544 [['condition simple []' \
545 'condition simple [true]']],
546 [[000: change conditions
548 002: change conditions
549 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
553 OVSDB_CHECK_IDL([simple idl, conditional, true condition],
560 [['condition simple []' \
561 'condition simple [true]']],
562 [[000: change conditions
564 002: change conditions
565 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
569 OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition],
581 [['condition simple []' \
582 'condition simple [["i","==",1],["i","==",2]]']],
583 [[000: change conditions
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>
591 OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition],
598 [['condition simple []' \
599 'condition simple [["i","==",1]]']],
600 [[000: change conditions
602 002: change conditions
603 003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
607 OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition],
614 [['condition simple []' \
615 'condition simple [["i","==",1],["i","==",2]]' \
616 'condition simple [["i","==",2]]' \
623 [[000: change conditions
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
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>
634 OVSDB_CHECK_IDL([simple idl, conditional, multiple tables],
643 "row": {"i": 0, "k": ["named-uuid", "self"]},
644 "uuid-name": "self"},
648 "uuid-name": "row0"}]']],
649 [['condition simple [];link1 [];link2 []' \
650 'condition simple [["i","==",1]]' \
651 'condition link1 [["i","==",0]]' \
652 'condition link2 [["i","==",3]]' \
657 "uuid-name": "row0"}]']],
658 [[000: change conditions
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>
673 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
678 "row": {"i": 0, "k": ["named-uuid", "self"]},
679 "uuid-name": "self"}]' \
683 "row": {"i": 1, "k": ["named-uuid", "row2"]},
684 "uuid-name": "row1"},
687 "row": {"i": 2, "k": ["named-uuid", "row1"]},
688 "uuid-name": "row2"}]' \
692 "where": [["i", "==", 1]],
693 "row": {"k": ["uuid", "#1#"]}}]' \
698 "row": {"k": ["uuid", "#0#"]}}]']],
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>
717 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
722 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
727 "row": {"i": 1, "k": ["named-uuid", "one"]}},
730 "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
735 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
739 "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
743 "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
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}]}
763 [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
765 OVSDB_CHECK_IDL([self-linking idl, sets],
770 "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
774 "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
778 "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
782 "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
783 "uuid-name": "i3"}]' \
788 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
792 "where": [["i", "==", 2]],
793 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
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}]}
815 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
821 "uuid-name": "row0"},
824 "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
825 "uuid-name": "row1"}]']],
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>
833 OVSDB_CHECK_IDL([singleton idl, constraints],
837 "table": "singleton",
838 "row": {"name": "foo"}}]' \
841 "table": "singleton",
842 "row": {"name": "bar"}}]' \
845 "table": "singleton",
846 "where": [["_uuid", "==", ["uuid", "#0#"]]]},
848 "table": "singleton",
849 "row": {"name": "bar"}}]']],
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>
859 OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
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>
869 OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
873 001: commit, status=success
874 002: i=2 k=2 ka=[] l2= uuid=<0>
878 OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
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>
895 AT_SETUP([idl handling of missing tables and columns - C])
896 AT_KEYWORDS([ovsdb server idl positive])
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",
906 "row": {"i": 0, "k": ["named-uuid", "self"]},
907 "uuid-name": "self"}]' \
911 "row": {"i": 1, "k": ["named-uuid", "row2"]},
912 "uuid-name": "row1"},
915 "row": {"i": 2, "k": ["named-uuid", "row1"]},
916 "uuid-name": "row2"}]' \
920 "where": [["i", "==", 1]],
921 "row": {"k": ["uuid", "#1#"]}}]' \
926 "row": {"k": ["uuid", "#0#"]}}]']],
927 [0], [stdout], [stderr])
928 AT_CHECK([sort stdout | uuidfilt], [0],
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>
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?)
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
957 AT_CHECK([grep -c '"monitor\|monitor_cond"' stderr], [0], [2
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
963 AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
965 OVSDB_SERVER_SHUTDOWN
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])
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]]),
979 OVSDB_SERVER_SHUTDOWN
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])])
988 m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
989 [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])
991 OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
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"]]]}},
1013 001: commit, status=success
1014 002: i=0 r=0 uuid=<0>
1019 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PYN],
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]]),
1029 OVSDB_SERVER_SHUTDOWN
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])])
1039 m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
1040 [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])
1043 OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond],
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"]]]}},
1065 "row": {"b": true}}]' \
1070 "row": {"r": 123.5}}]' \
1079 "ra": ["set", [1.5]],
1080 "ba": ["set", [false]],
1082 "ua": ["set", []]}}]' \
1086 "where": [["i", "<", 1]],
1087 "row": {"s": "newstring"}}]' \
1091 "where": [["i", "==", 0]]}]' \
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>
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>
1120 m4_define([OVSDB_CHECK_IDL_TRACK_C],
1122 AT_KEYWORDS([ovsdb server idl tracking positive $5])
1123 AT_CHECK([ovsdb_start_idltest])
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]]),
1130 OVSDB_SERVER_SHUTDOWN
1133 m4_define([OVSDB_CHECK_IDL_TRACK],
1134 [OVSDB_CHECK_IDL_TRACK_C($@)])
1136 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated],
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"]]]}},
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
1168 OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
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"]]]}},
1191 "row": {"b": true}}]' \
1196 "row": {"r": 123.5}}]' \
1205 "ra": ["set", [1.5]],
1206 "ba": ["set", [false]],
1208 "ua": ["set", []]}}]' \
1212 "where": [["i", "<", 1]],
1213 "row": {"s": "newstring"}}]' \
1217 "where": [["i", "==", 0]]}]' \
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>
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
1249 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN],
1251 AT_KEYWORDS([ovsdb server idl partial update map column positive $5])
1252 AT_CHECK([ovsdb_start_idltest])
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]]),
1259 OVSDB_SERVER_SHUTDOWN
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"]]]} }]']
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]]
1280 OVSDB_CHECK_IDL_PY([partial-map idl],
1281 [['["idltest", {"op":"insert", "table":"simple2",
1282 "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
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=[]
1298 m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN],
1300 AT_KEYWORDS([ovsdb server idl partial update set column positive $5])
1301 AT_CHECK([ovsdb_start_idltest])
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]]),
1308 OVSDB_SERVER_SHUTDOWN
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" ]]]} }]']
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>]]
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"]]]]]}]']
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>]
1358 m4_define([OVSDB_CHECK_IDL_NOTIFY_PYN],
1359 [OVSDB_CHECK_IDL_PYN([$1], [], [$2], [$3], [notify $4], [$5], [$6], [$7])])
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])])
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])])
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])])
1377 m4_define([OVSDB_CHECK_IDL_NOTIFY],
1378 [OVSDB_CHECK_IDL_NOTIFY_PY($@)
1379 OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])
1381 OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
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"]]]}},
1404 "row": {"b": false}}]' \
1409 "row": {"r": 123.5}}]' \
1418 "ra": ["set", [1.5]],
1419 "ba": ["set", [false]],
1421 "ua": ["set", []]}}]' \
1425 "where": [["i", "<", 1]],
1426 "row": {"s": "newstring"}}]' \
1430 "where": [["i", "==", 0]]}]' \
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>
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>
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
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],
1478 AT_KEYWORDS([ovsdb server idl compound_index_single_column compound_index positive $5])
1479 AT_CHECK([ovsdb_start_idltest])
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']],
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]],
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']],
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]],
1501 OVSDB_SERVER_SHUTDOWN
1504 OVSDB_CHECK_IDL_COMPOUND_INDEX_SINGLE_COLUMN_C([Compound_index, single column test ],
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}}
1517 [idl_compound_index_single_column],
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
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
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
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],
1625 AT_KEYWORDS([ovsdb server idl compound_index_double_column compound_index positive $5])
1626 AT_CHECK([ovsdb_start_idltest])
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']],
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]],
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']],
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]],
1648 OVSDB_SERVER_SHUTDOWN
1651 OVSDB_CHECK_IDL_COMPOUND_INDEX_DOUBLE_COLUMN_C([Compound_index, double column test ],
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}}
1664 [idl_compound_index_double_column],
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
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
1762 m4_define([OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF],
1764 AT_KEYWORDS([ovsdb server idl compound_index compound_index_with_ref positive $5])
1765 AT_CHECK([ovsdb_start_idltest])
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]]),
1772 OVSDB_SERVER_SHUTDOWN
1775 OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF([set, simple3 idl-compound-index-with-ref, initially populated],
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>]]
1784 007: check simple4: empty
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])
1802 CHECK_STREAM_OPEN_BLOCK([tcp], [127.0.0.1])
1803 CHECK_STREAM_OPEN_BLOCK([tcp6], [[[::1]]])
1805 m4_define([CHECK_STREAM_OPEN_BLOCK_PY],
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])
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])