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