]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ovsdb-data.at
ofp-print: Abbreviate lists of fields in table features output.
[mirror_ovs.git] / tests / ovsdb-data.at
CommitLineData
958ac03a
BP
1AT_BANNER([OVSDB -- default values])
2
99155935 3OVSDB_CHECK_POSITIVE_CPY([default atoms],
958ac03a
BP
4 [default-atoms],
5 [[integer: OK
6real: OK
7boolean: OK
8string: OK
9uuid: OK]])
10
99155935 11OVSDB_CHECK_POSITIVE_CPY([default data],
958ac03a
BP
12 [default-data],
13 [[key integer, value void, n_min 0: OK
14key integer, value integer, n_min 0: OK
15key integer, value real, n_min 0: OK
16key integer, value boolean, n_min 0: OK
17key integer, value string, n_min 0: OK
18key integer, value uuid, n_min 0: OK
19key real, value void, n_min 0: OK
20key real, value integer, n_min 0: OK
21key real, value real, n_min 0: OK
22key real, value boolean, n_min 0: OK
23key real, value string, n_min 0: OK
24key real, value uuid, n_min 0: OK
25key boolean, value void, n_min 0: OK
26key boolean, value integer, n_min 0: OK
27key boolean, value real, n_min 0: OK
28key boolean, value boolean, n_min 0: OK
29key boolean, value string, n_min 0: OK
30key boolean, value uuid, n_min 0: OK
31key string, value void, n_min 0: OK
32key string, value integer, n_min 0: OK
33key string, value real, n_min 0: OK
34key string, value boolean, n_min 0: OK
35key string, value string, n_min 0: OK
36key string, value uuid, n_min 0: OK
37key uuid, value void, n_min 0: OK
38key uuid, value integer, n_min 0: OK
39key uuid, value real, n_min 0: OK
40key uuid, value boolean, n_min 0: OK
41key uuid, value string, n_min 0: OK
42key uuid, value uuid, n_min 0: OK
43key integer, value void, n_min 1: OK
44key integer, value integer, n_min 1: OK
45key integer, value real, n_min 1: OK
46key integer, value boolean, n_min 1: OK
47key integer, value string, n_min 1: OK
48key integer, value uuid, n_min 1: OK
49key real, value void, n_min 1: OK
50key real, value integer, n_min 1: OK
51key real, value real, n_min 1: OK
52key real, value boolean, n_min 1: OK
53key real, value string, n_min 1: OK
54key real, value uuid, n_min 1: OK
55key boolean, value void, n_min 1: OK
56key boolean, value integer, n_min 1: OK
57key boolean, value real, n_min 1: OK
58key boolean, value boolean, n_min 1: OK
59key boolean, value string, n_min 1: OK
60key boolean, value uuid, n_min 1: OK
61key string, value void, n_min 1: OK
62key string, value integer, n_min 1: OK
63key string, value real, n_min 1: OK
64key string, value boolean, n_min 1: OK
65key string, value string, n_min 1: OK
66key string, value uuid, n_min 1: OK
67key uuid, value void, n_min 1: OK
68key uuid, value integer, n_min 1: OK
69key uuid, value real, n_min 1: OK
70key uuid, value boolean, n_min 1: OK
71key uuid, value string, n_min 1: OK
72key uuid, value uuid, n_min 1: OK]])
73
bd76d25d 74AT_BANNER([OVSDB -- atoms without constraints])
f85f8ebb 75
99155935 76OVSDB_CHECK_POSITIVE_CPY([integer atom from JSON],
f85f8ebb
BP
77 [[parse-atoms '["integer"]' \
78 '[0]' \
79 '[-1]' \
80 '[1e3]' \
81 '[9223372036854775807]' \
82 '[-9223372036854775808]' ]],
83 [0
84-1
851000
869223372036854775807
87-9223372036854775808])
88
5c414a2e
BP
89OVSDB_CHECK_POSITIVE([integer atom from string],
90 [[parse-atom-strings -- '["integer"]' \
91 '0' \
92 '-1' \
93 '+1000' \
94 '9223372036854775807' \
1ab39058
LR
95 '-9223372036854775808' \
96 '0-1000' \
97 '-1000-+1000' \
98 '-1000--10' \
99 '+10-+1000' \
100 '1-4096' \
101 '-4096--1' \
102 '-2000-2095']],
5c414a2e
BP
103 [0
104-1
1051000
1069223372036854775807
1ab39058
LR
107-9223372036854775808
1080-1000
109-1000-1000
110-1000--10
11110-1000
1121-4096
113-4096--1
114-2000-2095])
5c414a2e 115
99155935 116OVSDB_CHECK_POSITIVE_CPY([real atom from JSON],
f85f8ebb
BP
117 [[parse-atoms '["real"]' \
118 '[0]' \
119 '[0.0]' \
120 '[-0.0]' \
121 '[-1.25]' \
122 '[1e3]' \
123 '[1e37]' \
124 '[0.00390625]' ]],
125 [0
1260
1270
128-1.25
1291000
1301e+37
1310.00390625])
132
5c414a2e
BP
133OVSDB_CHECK_POSITIVE([real atom from string],
134 [[parse-atom-strings -- '["real"]' \
135 '0' \
136 '0.0' \
137 '-0.0' \
138 '-1.25' \
139 '1e3' \
140 '1e37' \
141 '0.00390625' ]],
142 [0
1430
1440
145-1.25
1461000
1471e+37
1480.00390625])
149
99155935 150OVSDB_CHECK_POSITIVE_CPY([boolean atom from JSON],
f85f8ebb
BP
151 [[parse-atoms '["boolean"]' '[true]' '[false]' ]],
152 [true
153false])
154
5c414a2e
BP
155OVSDB_CHECK_POSITIVE([boolean atom from string],
156 [[parse-atom-strings '["boolean"]' 'true' 'false' ]],
157 [true
158false])
159
99155935 160OVSDB_CHECK_POSITIVE_CPY([string atom from JSON],
f85f8ebb
BP
161 [[parse-atoms '["string"]' '[""]' '["true"]' '["\"\\\/\b\f\n\r\t"]']],
162 [""
163"true"
164"\"\\/\b\f\n\r\t"])
165
5c414a2e
BP
166OVSDB_CHECK_POSITIVE([string atom from string],
167 [[parse-atom-strings '["string"]' \
168 'unquoted' \
169 '"quoted-string"' \
170 '"needs quotes"' \
171 '""' \
172 '"true"' \
173 '"\"\\\/\b\f\n\r\t"']],
174 [unquoted
175quoted-string
176"needs quotes"
177""
178"true"
179"\"\\/\b\f\n\r\t"])
180
99155935 181OVSDB_CHECK_POSITIVE_CPY([uuid atom from JSON],
f85f8ebb
BP
182 [[parse-atoms '["uuid"]' '["uuid", "550e8400-e29b-41d4-a716-446655440000"]']],
183 [[["uuid","550e8400-e29b-41d4-a716-446655440000"]]])
184
5c414a2e
BP
185OVSDB_CHECK_POSITIVE([uuid atom from string],
186 [[parse-atom-strings '["uuid"]' '550e8400-e29b-41d4-a716-446655440000']],
187 [550e8400-e29b-41d4-a716-446655440000])
188
99155935 189OVSDB_CHECK_POSITIVE_CPY([integer atom sorting],
f85f8ebb
BP
190 [[sort-atoms '["integer"]' '[55,0,-1,2,1]']],
191 [[[-1,0,1,2,55]]])
192
99155935 193OVSDB_CHECK_POSITIVE_CPY([real atom sorting],
f85f8ebb
BP
194 [[sort-atoms '["real"]' '[1.25,1.23,0.0,-0.0,-1e99]']],
195 [[[-1e+99,0,0,1.23,1.25]]])
196
99155935 197OVSDB_CHECK_POSITIVE_CPY([boolean atom sorting],
f85f8ebb
BP
198 [[sort-atoms '["boolean"]' '[true,false,true,false,false]']],
199 [[[false,false,false,true,true]]])
200
99155935 201OVSDB_CHECK_POSITIVE_CPY([string atom sorting],
f85f8ebb
BP
202 [[sort-atoms '["string"]' '["abd","abc","\b","xxx"]']],
203 [[["\b","abc","abd","xxx"]]])
204
99155935 205OVSDB_CHECK_POSITIVE_CPY([uuid atom sorting],
f85f8ebb
BP
206 [[sort-atoms '["uuid"]' '[
207 ["uuid", "00000000-0000-0000-0000-000000000001"],
208 ["uuid", "00000000-1000-0000-0000-000000000000"],
209 ["uuid", "00000000-0000-1000-0000-000000000000"],
210 ["uuid", "00010000-0000-0000-0000-000000000000"],
211 ["uuid", "00000000-0000-0000-0000-000000000100"],
212 ["uuid", "00000000-0000-0000-0000-000100000000"],
213 ["uuid", "00000000-0000-0010-0000-000000000000"],
214 ["uuid", "00000100-0000-0000-0000-000000000000"],
215 ["uuid", "00000000-0000-0001-0000-000000000000"],
216 ["uuid", "00000000-0000-0000-0000-000001000000"],
217 ["uuid", "01000000-0000-0000-0000-000000000000"],
218 ["uuid", "00000000-0000-0000-0000-000000001000"],
219 ["uuid", "00000000-0000-0000-0000-000010000000"],
220 ["uuid", "00000000-0000-0000-0000-010000000000"],
221 ["uuid", "00000000-0000-0100-0000-000000000000"],
222 ["uuid", "10000000-0000-0000-0000-000000000000"],
223 ["uuid", "00000000-0000-0000-0000-000000000010"],
224 ["uuid", "00000000-0100-0000-0000-000000000000"],
225 ["uuid", "00000000-0000-0000-0100-000000000000"],
226 ["uuid", "00000000-0000-0000-0001-000000000000"],
227 ["uuid", "00000010-0000-0000-0000-000000000000"],
228 ["uuid", "00000000-0000-0000-0010-000000000000"],
229 ["uuid", "00000000-0000-0000-0000-000000010000"],
230 ["uuid", "00000000-0000-0000-1000-000000000000"],
231 ["uuid", "00000000-0000-0000-0000-100000000000"],
232 ["uuid", "00000000-0000-0000-0000-001000000000"],
233 ["uuid", "00000000-0000-0000-0000-000000100000"],
234 ["uuid", "00000000-0000-0000-0000-000000000000"],
235 ["uuid", "00000000-0010-0000-0000-000000000000"],
236 ["uuid", "00100000-0000-0000-0000-000000000000"],
237 ["uuid", "00000000-0001-0000-0000-000000000000"],
238 ["uuid", "00000001-0000-0000-0000-000000000000"],
239 ["uuid", "00001000-0000-0000-0000-000000000000"]]']],
240 [[[["uuid","00000000-0000-0000-0000-000000000000"],["uuid","00000000-0000-0000-0000-000000000001"],["uuid","00000000-0000-0000-0000-000000000010"],["uuid","00000000-0000-0000-0000-000000000100"],["uuid","00000000-0000-0000-0000-000000001000"],["uuid","00000000-0000-0000-0000-000000010000"],["uuid","00000000-0000-0000-0000-000000100000"],["uuid","00000000-0000-0000-0000-000001000000"],["uuid","00000000-0000-0000-0000-000010000000"],["uuid","00000000-0000-0000-0000-000100000000"],["uuid","00000000-0000-0000-0000-001000000000"],["uuid","00000000-0000-0000-0000-010000000000"],["uuid","00000000-0000-0000-0000-100000000000"],["uuid","00000000-0000-0000-0001-000000000000"],["uuid","00000000-0000-0000-0010-000000000000"],["uuid","00000000-0000-0000-0100-000000000000"],["uuid","00000000-0000-0000-1000-000000000000"],["uuid","00000000-0000-0001-0000-000000000000"],["uuid","00000000-0000-0010-0000-000000000000"],["uuid","00000000-0000-0100-0000-000000000000"],["uuid","00000000-0000-1000-0000-000000000000"],["uuid","00000000-0001-0000-0000-000000000000"],["uuid","00000000-0010-0000-0000-000000000000"],["uuid","00000000-0100-0000-0000-000000000000"],["uuid","00000000-1000-0000-0000-000000000000"],["uuid","00000001-0000-0000-0000-000000000000"],["uuid","00000010-0000-0000-0000-000000000000"],["uuid","00000100-0000-0000-0000-000000000000"],["uuid","00001000-0000-0000-0000-000000000000"],["uuid","00010000-0000-0000-0000-000000000000"],["uuid","00100000-0000-0000-0000-000000000000"],["uuid","01000000-0000-0000-0000-000000000000"],["uuid","10000000-0000-0000-0000-000000000000"]]]])
241
99155935 242OVSDB_CHECK_POSITIVE_CPY([real not acceptable integer JSON atom],
f85f8ebb 243 [[parse-atoms '["integer"]' '[0.5]' ]],
bd76d25d
BP
244 [syntax "0.5": syntax error: expected integer])
245
246dnl <C0> is not allowed anywhere in a UTF-8 string.
247dnl <ED A0 80> is a surrogate and not allowed in UTF-8.
be44585c 248OVSDB_CHECK_POSITIVE([no invalid UTF-8 sequences in strings],
bd76d25d 249 [parse-atoms '[["string"]]' \
a238d75e
BP
250 '@<:@"m4_esyscmd([printf "\300"])"@:>@' \
251 '@<:@"m4_esyscmd([printf "\355\240\200"])"@:>@' \
bd76d25d 252],
be44585c
BP
253 [constraint violation: not a valid UTF-8 string: invalid UTF-8 sequence 0xc0
254constraint violation: not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0xa0])
255
256dnl Python won't let invalid UTF-8 (its idea of invalid UTF-8, anyway) into it
257dnl at all, so this test never gets as far as a constraint violation. It's
258dnl just a JSON parse error.
259dnl
260dnl <C0> is not allowed anywhere in a UTF-8 string.
261dnl (<ED A0 80> is not allowed in UTF-8 but Python doesn't care.)
262dnl <ED 80 7F> is not allowed in UTF-8.
1ca0323e 263OVSDB_CHECK_POSITIVE_PY3([no invalid UTF-8 sequences in strings - Python],
be44585c
BP
264 [parse-atoms '[["string"]]' \
265 '@<:@"m4_esyscmd([printf "\300"])"@:>@' \
266 '@<:@"m4_esyscmd([printf "\355\200\177"])"@:>@' \
267],
268 ["not a valid UTF-8 string: invalid UTF-8 sequence 0xc0"
269"not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0x80"])
f85f8ebb 270
5c414a2e
BP
271OVSDB_CHECK_NEGATIVE([real not acceptable integer string atom],
272 [[parse-atom-strings '["integer"]' '0.5' ]],
273 ["0.5" is not a valid integer])
274
1ab39058
LR
275OVSDB_CHECK_NEGATIVE([inverted range is not acceptable integer string atom positive and negative],
276 [[parse-atom-strings -- '["integer"]' '10--10' ]],
277 ["10--10" is not a valid range. Range end cannot be before start.])
278
279OVSDB_CHECK_NEGATIVE([inverted range is not acceptable integer string atom negative],
280 [[parse-atom-strings -- '["integer"]' '-10--100' ]],
281 ["-10--100" is not a valid range. Range end cannot be before start.])
282
283OVSDB_CHECK_NEGATIVE([inverted range is not acceptable integer string atom positive],
284 [[parse-atom-strings -- '["integer"]' '100-10' ]],
285 ["100-10" is not a valid range. Range end cannot be before start.])
286
287OVSDB_CHECK_NEGATIVE([too big range is not acceptable integer string atom positive and negative],
288 [[parse-atom-strings -- '["integer"]' '-2000-2096' ]],
289 [Range "-2000-2096" is too big.])
290
291OVSDB_CHECK_NEGATIVE([too big range is not acceptable integer string atom negative],
292 [[parse-atom-strings -- '["integer"]' '-4097--1' ]],
293 [Range "-4097--1" is too big.])
294
295OVSDB_CHECK_NEGATIVE([too big range is not acceptable integer string atom positive],
296 [[parse-atom-strings -- '["integer"]' '1-4097' ]],
297 [Range "1-4097" is too big.])
298
99155935 299OVSDB_CHECK_POSITIVE_CPY([string "true" not acceptable boolean JSON atom],
f85f8ebb 300 [[parse-atoms '["boolean"]' '["true"]' ]],
bd76d25d 301 [syntax ""true"": syntax error: expected boolean])
f85f8ebb 302
5c414a2e
BP
303OVSDB_CHECK_NEGATIVE([string "true" not acceptable boolean string atom],
304 [[parse-atom-strings '["boolean"]' '"true"' ]],
305 [""true"" is not a valid boolean (use "true" or "false")])
306
99155935 307OVSDB_CHECK_POSITIVE_CPY([integer not acceptable string JSON atom],
f85f8ebb 308 [[parse-atoms '["string"]' '[1]']],
bd76d25d 309 [syntax "1": syntax error: expected string])
f85f8ebb 310
99155935 311OVSDB_CHECK_POSITIVE_CPY([uuid atom must be expressed as JSON array],
f85f8ebb 312 [[parse-atoms '["uuid"]' '["550e8400-e29b-41d4-a716-446655440000"]']],
bd76d25d 313 [[syntax ""550e8400-e29b-41d4-a716-446655440000"": syntax error: expected ["uuid", <string>]]])
fdba6728
BP
314
315OVSDB_CHECK_POSITIVE_CPY([named-uuid requires symbol table],
316 [parse-atoms '[["uuid"]]' '[["named-uuid", "x"]]'],
317 [[syntax "["named-uuid","x"]": syntax error: expected ["uuid", <string>]]])
f85f8ebb 318
5c414a2e
BP
319OVSDB_CHECK_NEGATIVE([empty string atom must be quoted],
320 [[parse-atom-strings '["string"]' '']],
321 [An empty string is not valid as input; use "" to represent the empty string])
322
323OVSDB_CHECK_NEGATIVE([quotes must be balanced],
324 [parse-atom-strings '[["string"]]' '"asdf'],
325 ["asdf: missing quote at end of quoted string])
326
5aa7f168
BP
327OVSDB_CHECK_NEGATIVE([quoted string must not contain unescaped quote],
328 [parse-atom-strings '[["string"]]' '"as"df"'],
329 ["as"df": quoted string may not include unescaped "])
330
331OVSDB_CHECK_NEGATIVE([quoted string must not end with backslash],
332 [parse-atom-strings '[["string"]]' '"asdf\"'],
333 ["asdf\": quoted string may not end with backslash])
334
5c414a2e
BP
335OVSDB_CHECK_NEGATIVE([uuids must be valid],
336 [parse-atom-strings '[["uuid"]]' '1234-5678'],
337 ["1234-5678" is not a valid UUID])
bd76d25d 338\f
bfc96d9b
BP
339AT_BANNER([OVSDB -- atoms with enum constraints])
340
99155935 341OVSDB_CHECK_POSITIVE_CPY([integer atom enum],
bfc96d9b
BP
342 [[parse-atoms '[{"type": "integer", "enum": ["set", [1, 6, 8, 10]]}]' \
343 '[0]' \
344 '[1]' \
345 '[2]' \
346 '[3]' \
347 '[6]' \
348 '[7]' \
349 '[8]' \
350 '[9]' \
351 '[10]' \
352 '[11]']],
353 [[constraint violation: 0 is not one of the allowed values ([1, 6, 8, 10])
3541
355constraint violation: 2 is not one of the allowed values ([1, 6, 8, 10])
356constraint violation: 3 is not one of the allowed values ([1, 6, 8, 10])
3576
358constraint violation: 7 is not one of the allowed values ([1, 6, 8, 10])
3598
360constraint violation: 9 is not one of the allowed values ([1, 6, 8, 10])
36110
362constraint violation: 11 is not one of the allowed values ([1, 6, 8, 10])]])
363
1ab39058
LR
364OVSDB_CHECK_POSITIVE([integer atom enum from string],
365 [[parse-atom-strings '[{"type": "integer", "enum": ["set", [1, 6, 8, 10, 20, 21, 22, 23, 24, 25]]}]' \
366 '1' \
367 '6' \
368 '8' \
369 '10' \
370 '20-25']],
371 [[1
3726
3738
37410
37520-25]])
376
377OVSDB_CHECK_NEGATIVE([integer not in enum set from string],
378 [[parse-atom-strings '[{"type": "integer", "enum": ["set", [1, 6, 8, 10]]}]' '0' ]],
379 [[constraint violation: 0 is not one of the allowed values ([1, 6, 8, 10])]])
380
381OVSDB_CHECK_NEGATIVE([integer range not in enum set from string],
382 [[parse-atom-strings '[{"type": "integer", "enum": ["set", [1, 6, 8, 10]]}]' '8-10' ]],
383 [[constraint violation: 9 is not one of the allowed values ([1, 6, 8, 10])]])
384
99155935 385OVSDB_CHECK_POSITIVE_CPY([real atom enum],
bfc96d9b
BP
386 [[parse-atoms '[{"type": "real", "enum": ["set", [-1.5, 1.5]]}]' \
387 '[-2]' \
388 '[-1]' \
389 '[-1.5]' \
390 '[0]' \
391 '[1]' \
392 '[1.5]' \
393 '[2]']],
394 [[constraint violation: -2 is not one of the allowed values ([-1.5, 1.5])
395constraint violation: -1 is not one of the allowed values ([-1.5, 1.5])
396-1.5
397constraint violation: 0 is not one of the allowed values ([-1.5, 1.5])
398constraint violation: 1 is not one of the allowed values ([-1.5, 1.5])
3991.5
400constraint violation: 2 is not one of the allowed values ([-1.5, 1.5])]])
401
99155935 402OVSDB_CHECK_POSITIVE_CPY([boolean atom enum],
bfc96d9b
BP
403 [[parse-atoms '[{"type": "boolean", "enum": false}]' \
404 '[false]' \
405 '[true]']],
406 [[false
407constraint violation: true is not one of the allowed values ([false])]])
408
99155935 409OVSDB_CHECK_POSITIVE_CPY([string atom enum],
bfc96d9b
BP
410 [[parse-atoms '[{"type": "string", "enum": ["set", ["abc", "def"]]}]' \
411 '[""]' \
412 '["ab"]' \
413 '["abc"]' \
414 '["def"]' \
415 '["defg"]' \
416 '["DEF"]']],
417 [[constraint violation: "" is not one of the allowed values ([abc, def])
418constraint violation: ab is not one of the allowed values ([abc, def])
419"abc"
420"def"
421constraint violation: defg is not one of the allowed values ([abc, def])
422constraint violation: DEF is not one of the allowed values ([abc, def])]])
423
99155935 424OVSDB_CHECK_POSITIVE_CPY([uuid atom enum],
bfc96d9b
BP
425 [[parse-atoms '[{"type": "uuid", "enum": ["set", [["uuid", "6d53a6dd-2da7-4924-9927-97f613812382"], ["uuid", "52cbc842-137a-4db5-804f-9f34106a0ba3"]]]}]' \
426 '["uuid", "6d53a6dd-2da7-4924-9927-97f613812382"]' \
427 '["uuid", "52cbc842-137a-4db5-804f-9f34106a0ba3"]' \
428 '["uuid", "dab2a6b2-6094-4f43-a7ef-4c0f0608f176"]']],
429 [[["uuid","6d53a6dd-2da7-4924-9927-97f613812382"]
430["uuid","52cbc842-137a-4db5-804f-9f34106a0ba3"]
431constraint violation: dab2a6b2-6094-4f43-a7ef-4c0f0608f176 is not one of the allowed values ([52cbc842-137a-4db5-804f-9f34106a0ba3, 6d53a6dd-2da7-4924-9927-97f613812382])]])
432\f
433AT_BANNER([OVSDB -- atoms with other constraints])
bd76d25d 434
99155935 435OVSDB_CHECK_POSITIVE_CPY([integers >= 5],
bd76d25d
BP
436 [[parse-atoms '[{"type": "integer", "minInteger": 5}]' \
437 '[0]' \
438 '[4]' \
439 '[5]' \
440 '[6]' \
441 '[12345]']],
442 [constraint violation: 0 is less than minimum allowed value 5
443constraint violation: 4 is less than minimum allowed value 5
4445
4456
44612345])
447
99155935 448OVSDB_CHECK_POSITIVE_CPY([integers <= -1],
bd76d25d
BP
449 [[parse-atoms '[{"type": "integer", "maxInteger": -1}]' \
450 '[0]' \
451 '[-1]' \
452 '[-2]' \
453 '[-123]']],
454 [constraint violation: 0 is greater than maximum allowed value -1
455-1
456-2
457-123])
458
99155935 459OVSDB_CHECK_POSITIVE_CPY([integers in range -10 to 10],
bd76d25d
BP
460 [[parse-atoms '[{"type": "integer", "minInteger": -10, "maxInteger": 10}]' \
461 '[-20]' \
462 '[-11]' \
463 '[-10]' \
464 '[-9]' \
465 '[1]' \
466 '[9]' \
467 '[10]' \
468 '[11]' \
469 '[123576]']],
470 [constraint violation: -20 is not in the valid range -10 to 10 (inclusive)
471constraint violation: -11 is not in the valid range -10 to 10 (inclusive)
472-10
473-9
4741
4759
47610
477constraint violation: 11 is not in the valid range -10 to 10 (inclusive)
478constraint violation: 123576 is not in the valid range -10 to 10 (inclusive)])
479
99155935 480OVSDB_CHECK_POSITIVE_CPY([reals >= 5],
bd76d25d
BP
481 [[parse-atoms '[{"type": "real", "minReal": 5}]' \
482 '[0]' \
483 '[4]' \
484 '[5]' \
485 '[6]' \
486 '[12345]']],
487 [constraint violation: 0 is less than minimum allowed value 5
488constraint violation: 4 is less than minimum allowed value 5
4895
4906
49112345])
492
99155935 493OVSDB_CHECK_POSITIVE_CPY([reals <= -1],
bd76d25d
BP
494 [[parse-atoms '[{"type": "real", "maxReal": -1}]' \
495 '[0]' \
496 '[-1]' \
497 '[-2]' \
498 '[-123]']],
499 [constraint violation: 0 is greater than maximum allowed value -1
500-1
501-2
502-123])
503
99155935 504OVSDB_CHECK_POSITIVE_CPY([reals in range -10 to 10],
bd76d25d
BP
505 [[parse-atoms '[{"type": "real", "minReal": -10, "maxReal": 10}]' \
506 '[-20]' \
507 '[-11]' \
508 '[-10]' \
509 '[-9]' \
510 '[1]' \
511 '[9]' \
512 '[10]' \
513 '[11]' \
514 '[123576]']],
515 [constraint violation: -20 is not in the valid range -10 to 10 (inclusive)
516constraint violation: -11 is not in the valid range -10 to 10 (inclusive)
517-10
518-9
5191
5209
52110
522constraint violation: 11 is not in the valid range -10 to 10 (inclusive)
523constraint violation: 123576 is not in the valid range -10 to 10 (inclusive)])
524
99155935 525OVSDB_CHECK_POSITIVE_CPY([strings at least 2 characters long],
bd76d25d
BP
526 [[parse-atoms '{"type": "string", "minLength": 2}' \
527 '[""]' \
528 '["a"]' \
529 '["ab"]' \
530 '["abc"]' \
531 '["\ud834\udd1e"]']],
532 [[constraint violation: "" length 0 is less than minimum allowed length 2
533constraint violation: "a" length 1 is less than minimum allowed length 2
534"ab"
535"abc"
1ca0323e 536constraint violation: "𝄞" length 1 is less than minimum allowed length 2]])
bd76d25d 537
99155935 538OVSDB_CHECK_POSITIVE_CPY([strings no more than 2 characters long],
bd76d25d
BP
539 [[parse-atoms '{"type": "string", "maxLength": 2}' \
540 '[""]' \
541 '["a"]' \
542 '["ab"]' \
543 '["abc"]' \
65683353 544 '["de"]']],
bd76d25d
BP
545 [[""
546"a"
547"ab"
548constraint violation: "abc" length 3 is greater than maximum allowed length 2
65683353 549"de"]])
5c414a2e 550
218f9539 551AT_BANNER([OVSDB -- simple data])
f85f8ebb 552
99155935 553OVSDB_CHECK_POSITIVE_CPY([integer JSON datum],
ae8f13e2 554 [[parse-data '["integer"]' '[0]' '["set",[1]]' '[-1]']],
f85f8ebb
BP
555 [0
5561
557-1])
558
5c414a2e
BP
559OVSDB_CHECK_POSITIVE([integer string datum],
560 [[parse-data-strings -- '["integer"]' '0' '1' '-1' '+1']],
561 [0
5621
563-1
5641])
565
99155935 566OVSDB_CHECK_POSITIVE_CPY([real JSON datum],
ae8f13e2 567 [[parse-data '["real"]' '[0]' '["set",[1.0]]' '[-1.25]']],
f85f8ebb
BP
568 [0
5691
570-1.25])
571
5c414a2e
BP
572OVSDB_CHECK_POSITIVE([real string datum],
573 [[parse-data-strings -- '["real"]' '0' '1.0' '-1.25']],
574 [0
5751
576-1.25])
577
99155935 578OVSDB_CHECK_POSITIVE_CPY([boolean JSON datum],
ae8f13e2 579 [[parse-data '["boolean"]' '["set", [true]]' '[false]' ]],
f85f8ebb
BP
580 [true
581false])
582
5c414a2e
BP
583OVSDB_CHECK_POSITIVE([boolean string datum],
584 [[parse-data-strings '["boolean"]' 'true' 'false' ]],
585 [true
586false])
587
99155935 588OVSDB_CHECK_POSITIVE_CPY([string JSON datum],
ae8f13e2 589 [[parse-data '["string"]' '["set",[""]]' '["true"]' '["\"\\\/\b\f\n\r\t"]']],
f85f8ebb
BP
590 [""
591"true"
592"\"\\/\b\f\n\r\t"])
593
5c414a2e
BP
594OVSDB_CHECK_POSITIVE([string string datum],
595 [[parse-data-strings '["string"]' '"x"' '""' '"true"' '"\"\\\/\b\f\n\r\t"']],
596 [x
597""
598"true"
599"\"\\/\b\f\n\r\t"])
bd76d25d 600\f
f85f8ebb
BP
601AT_BANNER([OVSDB -- set data])
602
99155935 603OVSDB_CHECK_POSITIVE_CPY([JSON optional boolean],
f85f8ebb 604 [[parse-data '{"key": "boolean", "min": 0}' \
ae8f13e2 605 '[true]' \
f85f8ebb
BP
606 '["set", [false]]' \
607 '["set", []]']],
ae8f13e2
BP
608 [[true
609false
f85f8ebb
BP
610["set",[]]]],
611 [set])
612
5c414a2e
BP
613OVSDB_CHECK_POSITIVE([string optional boolean],
614 [[parse-data-strings '{"key": "boolean", "min": 0}' \
615 'true' \
616 'false' \
617 '[]']],
618 [[true
619false
620[]]],
621 [set])
622
99155935 623OVSDB_CHECK_POSITIVE_CPY([JSON set of 0 or more integers],
f85f8ebb
BP
624 [[parse-data '{"key": "integer", "min": 0, "max": "unlimited"}' \
625 '["set", [0]]' \
ae8f13e2 626 '[1]' \
f85f8ebb
BP
627 '["set", [0, 1]]' \
628 '["set", [0, 1, 2]]' \
629 '["set", [0, 1, 2, 3, 4, 5]]' \
630 '["set", [0, 1, 2, 3, 4, 5, 6, 7, 8]]' \
631 '["set", [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]']],
ae8f13e2
BP
632 [[0
6331
f85f8ebb
BP
634["set",[0,1]]
635["set",[0,1,2]]
636["set",[0,1,2,3,4,5]]
637["set",[0,1,2,3,4,5,6,7,8]]
638["set",[0,1,2,3,4,5,6,7,8,9,10]]]])
639
5c414a2e
BP
640OVSDB_CHECK_POSITIVE([string set of 0 or more integers],
641 [[parse-data-strings '{"key": "integer", "min": 0, "max": "unlimited"}' \
642 '0' \
643 '0,1' \
644 '0, 1, 2' \
645 '[0, 1,2, 3, 4, 5]' \
646 '0, 1,2, 3,4, 5, 6, 7, 8' \
1ab39058
LR
647 '[0, 1, 2, 3, 4,5, 6,7, 8, 9, 10]' \
648 '0-8' \
649 '[0-10']]],
5c414a2e
BP
650 [[[0]
651[0, 1]
652[0, 1, 2]
653[0, 1, 2, 3, 4, 5]
654[0, 1, 2, 3, 4, 5, 6, 7, 8]
1ab39058
LR
655[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
656[0, 1, 2, 3, 4, 5, 6, 7, 8]
5c414a2e
BP
657[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]])
658
99155935 659OVSDB_CHECK_POSITIVE_CPY([JSON set of 1 to 3 uuids],
f85f8ebb
BP
660 [[parse-data '{"key": "uuid", "min": 1, "max": 3}' \
661 '["set", [["uuid", "550e8400-e29b-41d4-a716-446655440000"]]]' \
ae8f13e2 662 '["uuid", "b5078be0-7664-4299-b836-8bcc03ef941f"]' \
f85f8ebb
BP
663 '["set", [["uuid", "c5051240-30ff-43ed-b4b9-93cf3f050813"],
664 ["uuid", "90558331-09af-4d2f-a572-509cad2e9088"],
665 ["uuid", "550e8400-e29b-41d4-a716-446655440000"]]]']],
ae8f13e2
BP
666 [[["uuid","550e8400-e29b-41d4-a716-446655440000"]
667["uuid","b5078be0-7664-4299-b836-8bcc03ef941f"]
f85f8ebb
BP
668["set",[["uuid","550e8400-e29b-41d4-a716-446655440000"],["uuid","90558331-09af-4d2f-a572-509cad2e9088"],["uuid","c5051240-30ff-43ed-b4b9-93cf3f050813"]]]]])
669
5c414a2e
BP
670OVSDB_CHECK_POSITIVE([string set of 1 to 3 uuids],
671 [[parse-data-strings '{"key": "uuid", "min": 1, "max": 3}' \
672 '[550e8400-e29b-41d4-a716-446655440000]' \
673 '[c5051240-30ff-43ed-b4b9-93cf3f050813,
674 90558331-09af-4d2f-a572-509cad2e9088,
675 550e8400-e29b-41d4-a716-446655440000]']],
676 [[[550e8400-e29b-41d4-a716-446655440000]
677[550e8400-e29b-41d4-a716-446655440000, 90558331-09af-4d2f-a572-509cad2e9088, c5051240-30ff-43ed-b4b9-93cf3f050813]]])
678
99155935 679OVSDB_CHECK_POSITIVE_CPY([JSON set of 0 to 3 strings],
f85f8ebb
BP
680 [[parse-data '{"key": "string", "min": 0, "max": 3}' \
681 '["set", []]' \
ae8f13e2 682 '["a longer string"]' \
f85f8ebb
BP
683 '["set", ["a relatively long string"]]' \
684 '["set", ["short string", "a relatively long string"]]' \
685 '["set", ["zzz", "short string", "a relatively long string"]]']],
686 [[["set",[]]
ae8f13e2
BP
687"a longer string"
688"a relatively long string"
f85f8ebb
BP
689["set",["a relatively long string","short string"]]
690["set",["a relatively long string","short string","zzz"]]]])
691
5c414a2e
BP
692OVSDB_CHECK_POSITIVE([string set of 0 to 3 strings],
693 [[parse-data-strings '{"key": "string", "min": 0, "max": 3}' \
694 '[]' \
695 '"a relatively long string"' \
696 '["short string", "a relatively long string"]' \
697 '"zzz","short string","a relatively long string"']],
698 [[[]
699["a relatively long string"]
700["a relatively long string", "short string"]
701["a relatively long string", "short string", zzz]]])
702
99155935 703OVSDB_CHECK_NEGATIVE_CPY([duplicate boolean not allowed in JSON set],
f85f8ebb
BP
704 [[parse-data '{"key": "boolean", "max": 5}' '["set", [true, true]]']],
705 [ovsdb error: set contains duplicate])
706
5c414a2e
BP
707OVSDB_CHECK_NEGATIVE([duplicate boolean not allowed in string set],
708 [[parse-data-strings '{"key": "boolean", "max": 5}' 'true, true']],
709 [set contains duplicate value])
710
99155935 711OVSDB_CHECK_NEGATIVE_CPY([duplicate integer not allowed in JSON set],
f85f8ebb
BP
712 [[parse-data '{"key": "integer", "max": 5}' '["set", [1, 2, 3, 1]]']],
713 [ovsdb error: set contains duplicate])
714
5c414a2e
BP
715OVSDB_CHECK_NEGATIVE([duplicate integer not allowed in string set],
716 [[parse-data-strings '{"key": "integer", "max": 5}' '[1, 2, 3, 1]']],
717 [set contains duplicate value])
718
99155935 719OVSDB_CHECK_NEGATIVE_CPY([duplicate real not allowed in JSON set],
f85f8ebb
BP
720 [[parse-data '{"key": "real", "max": 5}' '["set", [0.0, -0.0]]']],
721 [ovsdb error: set contains duplicate])
722
5c414a2e
BP
723OVSDB_CHECK_NEGATIVE([duplicate real not allowed in string set],
724 [[parse-data-strings '{"key": "real", "max": 5}' '0.0, -0.0']],
725 [set contains duplicate value])
726
99155935 727OVSDB_CHECK_NEGATIVE_CPY([duplicate string not allowed in JSON set],
f85f8ebb
BP
728 [[parse-data '{"key": "string", "max": 5}' '["set", ["asdf", "ASDF", "asdf"]]']],
729 [ovsdb error: set contains duplicate])
730
5c414a2e
BP
731OVSDB_CHECK_NEGATIVE([duplicate string not allowed in string set],
732 [[parse-data-strings '{"key": "string", "max": 5}' 'asdf, ASDF, "asdf"']],
733 [set contains duplicate value])
734
99155935 735OVSDB_CHECK_NEGATIVE_CPY([duplicate uuid not allowed in JSON set],
f85f8ebb
BP
736 [[parse-data '{"key": "uuid", "max": 5}' \
737 '["set", [["uuid", "7ef21525-0088-4a28-a418-5518413e43ea"],
738 ["uuid", "355ad037-f1da-40aa-b47c-ff9c7e8c6a38"],
739 ["uuid", "7ef21525-0088-4a28-a418-5518413e43ea"]]]']],
740 [ovsdb error: set contains duplicate])
741
5c414a2e
BP
742OVSDB_CHECK_NEGATIVE([duplicate uuid not allowed in string set],
743 [[parse-data-strings '{"key": "uuid", "max": 5}' \
744 '7ef21525-0088-4a28-a418-5518413e43ea,
745 355ad037-f1da-40aa-b47c-ff9c7e8c6a38,
746 7ef21525-0088-4a28-a418-5518413e43ea']],
747 [set contains duplicate value])
bd76d25d 748\f
f85f8ebb
BP
749AT_BANNER([OVSDB -- map data])
750
99155935 751OVSDB_CHECK_POSITIVE_CPY([JSON map of 1 integer to boolean],
f85f8ebb
BP
752 [[parse-data '{"key": "integer", "value": "boolean"}' \
753 '["map", [[1, true]]]']],
754 [[["map",[[1,true]]]]])
755
5c414a2e
BP
756OVSDB_CHECK_POSITIVE([string map of 1 integer to boolean],
757 [[parse-data-strings '{"key": "integer", "value": "boolean"}' \
758 '1=true']],
759 [[1=true]])
760
99155935 761OVSDB_CHECK_POSITIVE_CPY([JSON map of at least 1 integer to boolean],
f85f8ebb
BP
762 [[parse-data '{"key": "integer", "value": "boolean", "max": "unlimited"}' \
763 '["map", [[1, true]]]' \
764 '["map", [[0, true], [1, false], [2, true], [3, true], [4, true]]]' \
765 '["map", [[3, false], [0, true], [4, false]]]']],
766 [[["map",[[1,true]]]
767["map",[[0,true],[1,false],[2,true],[3,true],[4,true]]]
768["map",[[0,true],[3,false],[4,false]]]]])
769
5c414a2e
BP
770OVSDB_CHECK_POSITIVE([string map of at least 1 integer to boolean],
771 [[parse-data-strings '{"key": "integer", "value": "boolean", "max": "unlimited"}' \
772 '1=true' \
773 '0=true 1=false 2=true, 3=true 4=true,' \
774 '3=false,0=true ,4=false']],
775 [[{1=true}
776{0=true, 1=false, 2=true, 3=true, 4=true}
777{0=true, 3=false, 4=false}]])
778
99155935 779OVSDB_CHECK_POSITIVE_CPY([JSON map of 1 boolean to integer],
f85f8ebb
BP
780 [[parse-data '{"key": "boolean", "value": "integer"}' \
781 '["map", [[true, 1]]]']],
782 [[["map",[[true,1]]]]])
783
5c414a2e
BP
784OVSDB_CHECK_POSITIVE([string map of 1 boolean to integer],
785 [[parse-data-strings '{"key": "boolean", "value": "integer"}' \
786 'true=1']],
787 [[true=1]])
788
99155935 789OVSDB_CHECK_POSITIVE_CPY([JSON map of 1 uuid to real],
31a763d7 790 [[parse-data '{"key": "uuid", "value": "real", "min": 1, "max": 5}' \
f85f8ebb 791 '["map", [[["uuid", "cad8542b-6ee1-486b-971b-7dcbf6e14979"], 1.0],
a711c317
AZ
792 [["uuid", "6b94b968-2702-4f64-9457-314a34d69b8c"], 2.0],
793 [["uuid", "d2c4a168-24de-47eb-a8a3-c1abfc814979"], 3.0],
794 [["uuid", "25bfa475-d072-4f60-8be1-00f48643e9cb"], 4.0],
795 [["uuid", "1c92b8ca-d5e4-4628-a85d-1dc2d099a99a"], 5.0]]]']],
f85f8ebb
BP
796 [[["map",[[["uuid","1c92b8ca-d5e4-4628-a85d-1dc2d099a99a"],5],[["uuid","25bfa475-d072-4f60-8be1-00f48643e9cb"],4],[["uuid","6b94b968-2702-4f64-9457-314a34d69b8c"],2],[["uuid","cad8542b-6ee1-486b-971b-7dcbf6e14979"],1],[["uuid","d2c4a168-24de-47eb-a8a3-c1abfc814979"],3]]]]])
797
5c414a2e
BP
798OVSDB_CHECK_POSITIVE([string map of 1 uuid to real],
799 [[parse-data-strings '{"key": "uuid", "value": "real", "min": 1, "max": 5}' \
800 'cad8542b-6ee1-486b-971b-7dcbf6e14979=1.0,
801 6b94b968-2702-4f64-9457-314a34d69b8c=2.0,
802 d2c4a168-24de-47eb-a8a3-c1abfc814979=3.0,
803 25bfa475-d072-4f60-8be1-00f48643e9cb=4.0,
804 1c92b8ca-d5e4-4628-a85d-1dc2d099a99a=5.0']],
805 [[{1c92b8ca-d5e4-4628-a85d-1dc2d099a99a=5, 25bfa475-d072-4f60-8be1-00f48643e9cb=4, 6b94b968-2702-4f64-9457-314a34d69b8c=2, cad8542b-6ee1-486b-971b-7dcbf6e14979=1, d2c4a168-24de-47eb-a8a3-c1abfc814979=3}]])
806
99155935 807OVSDB_CHECK_POSITIVE_CPY([JSON map of 10 string to string],
31a763d7 808 [[parse-data '{"key": "string", "value": "string", "min": 1, "max": 10}' \
f85f8ebb 809 '["map", [["2 gills", "1 chopin"],
a711c317
AZ
810 ["2 chopins", "1 pint"],
811 ["2 pints", "1 quart"],
812 ["2 quarts", "1 pottle"],
813 ["2 pottles", "1 gallon"],
814 ["2 gallons", "1 peck"],
815 ["2 pecks", "1 demibushel"],
816 ["2 demibushel", "1 firkin"],
817 ["2 firkins", "1 kilderkin"],
818 ["2 kilderkins", "1 barrel"]]]']],
f85f8ebb
BP
819 [[["map",[["2 chopins","1 pint"],["2 demibushel","1 firkin"],["2 firkins","1 kilderkin"],["2 gallons","1 peck"],["2 gills","1 chopin"],["2 kilderkins","1 barrel"],["2 pecks","1 demibushel"],["2 pints","1 quart"],["2 pottles","1 gallon"],["2 quarts","1 pottle"]]]]])
820
5c414a2e
BP
821OVSDB_CHECK_POSITIVE([string map of 10 string to string],
822 [[parse-data-strings '{"key": "string", "value": "string", "min": 1, "max": 10}' \
823 '{"2 gills"="1 chopin",
824 "2 chopins"= "1 pint",
825 "2 pints"= "1 quart",
826 "2 quarts"= "1 pottle",
827 "2 pottles"= "1 gallon",
828 "2 gallons"= "1 peck",
829 "2 pecks"= "1 demibushel",
830 "2 demibushel"= "1 firkin",
831 "2 firkins"= "1 kilderkin",
832 "2 kilderkins"= "1 barrel"}']],
833 [[{"2 chopins"="1 pint", "2 demibushel"="1 firkin", "2 firkins"="1 kilderkin", "2 gallons"="1 peck", "2 gills"="1 chopin", "2 kilderkins"="1 barrel", "2 pecks"="1 demibushel", "2 pints"="1 quart", "2 pottles"="1 gallon", "2 quarts"="1 pottle"}]])
834
99155935 835OVSDB_CHECK_NEGATIVE_CPY([duplicate integer key not allowed in JSON map],
f85f8ebb
BP
836 [[parse-data '{"key": "integer", "value": "boolean", "max": 5}' \
837 '["map", [[1, true], [2, false], [1, false]]]']],
838 [ovsdb error: map contains duplicate key])
5c414a2e
BP
839
840OVSDB_CHECK_NEGATIVE([duplicate integer key not allowed in string map],
841 [[parse-data-strings '{"key": "integer", "value": "boolean", "max": 5}' \
842 '1=true 2=false 1=false']],
843 [map contains duplicate key])
1a6f1cef
AZ
844
845OVSDB_CHECK_POSITIVE([generate and apply diff -- integer],
846 [[diff-data '["integer"]' '[0]' '[2]']],
847 [[diff: 2
848apply diff: 2
849OK]])
850
851OVSDB_CHECK_POSITIVE([generate and apply diff -- boolean],
852 [[diff-data '["boolean"]' '[true]' '[false]']],
853 [[diff: false
854apply diff: false
855OK]])
856
857OVSDB_CHECK_POSITIVE([generate and apply diff -- string],
858 [[diff-data '["string"]' '["AAA"]' '["BBB"]']],
859 [[diff: "BBB"
860apply diff: "BBB"
861OK]])
862
863dnl Test set modifications.
864OVSDB_CHECK_POSITIVE([generate and apply diff -- set],
865 [[diff-data '{"key": "integer", "min":0, "max": 3}' \
866 '["set", [0, 1]]' '["set", [1,2]]' \
867 '["set", [0, 1]]' '["set", [1]]' \
868 '["set", []]' '["set", [0, 1]]' \
869 '["set", [0, 1]]' '["set", []]'
870 ]],
871 [[diff: ["set",[0,2]]
872apply diff: ["set",[1,2]]
873OK
874diff: 0
875apply diff: 1
876OK
877diff: ["set",[0,1]]
878apply diff: ["set",[0,1]]
879OK
880diff: ["set",[0,1]]
881apply diff: ["set",[]]
882OK]])
883
884dnl Test set modifications causes data to violate set size constrain.
885OVSDB_CHECK_NEGATIVE([generate and apply diff -- set -- size error],
886 [[diff-data '{"key": "integer", "min":0, "max": 3}' \
887 '["set", [0, 1]]' '["set", [1, 2, 3, 4]]']],
888 [[ovsdb error: Datum crated by diff has size error]])
889
890dnl Test set modifications.
891OVSDB_CHECK_POSITIVE([generate and apply diff -- map],
892 [[diff-data '{"key": "string", "value": "string", "min":0, "max": 3}' \
893 '["map", [["2 gills", "1 chopin"]]]' '["map", [["2 pints", "1 quart"]]]' \
894 '["map", [["2 gills", "1 chopin"]]]' '["map", [["2 gills", "1 chopin"]]]' \
895 '["map", [["2 gills", "1 chopin"]]]' '["map", []]' \
896 '["map", []]' '["map", [["2 pints", "1 quart"]]]' \
897 '["map", [["2 gills", "1 chopin"]]]' '["map", [["2 gills", "1 gallon"]]]' \
898 ]],
899 [[diff: ["map",[["2 gills","1 chopin"],["2 pints","1 quart"]]]
900apply diff: ["map",[["2 pints","1 quart"]]]
901OK
902diff: ["map",[]]
903apply diff: ["map",[["2 gills","1 chopin"]]]
904OK
905diff: ["map",[["2 gills","1 chopin"]]]
906apply diff: ["map",[]]
907OK
908diff: ["map",[["2 pints","1 quart"]]]
909apply diff: ["map",[["2 pints","1 quart"]]]
910OK
911diff: ["map",[["2 gills","1 gallon"]]]
912apply diff: ["map",[["2 gills","1 gallon"]]]
913OK]])
914
915OVSDB_CHECK_NEGATIVE([generate and apply diff with map -- size error],
916 [[diff-data '{"key": "string", "value": "string", "min":0, "max": 3}' \
917 '["map", [["2 gills", "1 chopin"]]]' \
918 '["map", [["2 gills", "1 gallon"],
919 ["2 pints", "1 quart"],
920 ["2 quarts", "1 pottle"],
921 ["2 gallons", "1 peck"]]]' \
922 ]],
923 [[ovsdb error: Datum crated by diff has size error]])