]> git.proxmox.com Git - ovs.git/blob - tests/ovsdb-mutation.at
Merge "master" into "next".
[ovs.git] / tests / ovsdb-mutation.at
1 AT_BANNER([OVSDB -- mutations])
2
3 OVSDB_CHECK_POSITIVE([null mutation],
4 [[parse-mutations \
5 '{"columns": {"name": {"type": "string"}}}' \
6 '[]']],
7 [[[]]])
8
9 OVSDB_CHECK_POSITIVE([mutations on scalars],
10 [[parse-mutations \
11 '{"columns":
12 {"i": {"type": "integer"},
13 "r": {"type": "real"},
14 "b": {"type": "boolean"},
15 "s": {"type": "string"},
16 "u": {"type": "uuid"}}}' \
17 '[["i", "+=", 0]]' \
18 '[["i", "-=", 1]]' \
19 '[["i", "*=", 2]]' \
20 '[["i", "/=", 3]]' \
21 '[["i", "%=", 4]]' \
22 '[["r", "+=", 0.5]]' \
23 '[["r", "-=", 1.5]]' \
24 '[["r", "*=", 2.5]]' \
25 '[["r", "/=", 3.5]]']],
26 [[[["i","+=",0]]
27 [["i","-=",1]]
28 [["i","*=",2]]
29 [["i","/=",3]]
30 [["i","%=",4]]
31 [["r","+=",0.5]]
32 [["r","-=",1.5]]
33 [["r","*=",2.5]]
34 [["r","/=",3.5]]]],
35 [mutation])
36
37 AT_SETUP([disallowed mutations on scalars])
38 AT_KEYWORDS([ovsdb negative mutation])
39 AT_CHECK([[test-ovsdb parse-mutations \
40 '{"columns":
41 {"i": {"type": "integer"},
42 "r": {"type": "real"},
43 "b": {"type": "boolean"},
44 "s": {"type": "string"},
45 "u": {"type": "uuid"}}}' \
46 '[["i", "xxx", 1]]' \
47 '[["i", "insert", 1]]' \
48 '[["i", "delete", 2]]' \
49 '[["r", "%=", 0.5]]' \
50 '[["r", "insert", 1.5]]' \
51 '[["r", "delete", 2.5]]' \
52 '[["b", "+=", true]]' \
53 '[["b", "-=", false]]' \
54 '[["b", "*=", true]]' \
55 '[["b", "/=", false]]' \
56 '[["b", "%=", true]]' \
57 '[["b", "insert", false]]' \
58 '[["b", "delete", true]]' \
59 '[["s", "+=", "a"]]' \
60 '[["s", "-=", "b"]]' \
61 '[["s", "*=", "c"]]' \
62 '[["s", "/=", "d"]]' \
63 '[["s", "%=", "e"]]' \
64 '[["s", "insert", "f"]]' \
65 '[["s", "delete", "g"]]' \
66 '[["u", "+=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
67 '[["u", "-=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
68 '[["u", "*=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
69 '[["u", "/=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
70 '[["u", "insert", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
71 '[["u", "delete", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]']],
72 [1], [],
73 [[test-ovsdb: unknown mutator: No mutator named xxx.
74 test-ovsdb: syntax "["i","insert",1]": syntax error: Type mismatch: "insert" operator may not be applied to column i of type integer.
75 test-ovsdb: syntax "["i","delete",2]": syntax error: Type mismatch: "delete" operator may not be applied to column i of type integer.
76 test-ovsdb: syntax "["r","%=",0.5]": syntax error: Type mismatch: "%=" operator may not be applied to column r of type real.
77 test-ovsdb: syntax "["r","insert",1.5]": syntax error: Type mismatch: "insert" operator may not be applied to column r of type real.
78 test-ovsdb: syntax "["r","delete",2.5]": syntax error: Type mismatch: "delete" operator may not be applied to column r of type real.
79 test-ovsdb: syntax "["b","+=",true]": syntax error: Type mismatch: "+=" operator may not be applied to column b of type boolean.
80 test-ovsdb: syntax "["b","-=",false]": syntax error: Type mismatch: "-=" operator may not be applied to column b of type boolean.
81 test-ovsdb: syntax "["b","*=",true]": syntax error: Type mismatch: "*=" operator may not be applied to column b of type boolean.
82 test-ovsdb: syntax "["b","/=",false]": syntax error: Type mismatch: "/=" operator may not be applied to column b of type boolean.
83 test-ovsdb: syntax "["b","%=",true]": syntax error: Type mismatch: "%=" operator may not be applied to column b of type boolean.
84 test-ovsdb: syntax "["b","insert",false]": syntax error: Type mismatch: "insert" operator may not be applied to column b of type boolean.
85 test-ovsdb: syntax "["b","delete",true]": syntax error: Type mismatch: "delete" operator may not be applied to column b of type boolean.
86 test-ovsdb: syntax "["s","+=","a"]": syntax error: Type mismatch: "+=" operator may not be applied to column s of type string.
87 test-ovsdb: syntax "["s","-=","b"]": syntax error: Type mismatch: "-=" operator may not be applied to column s of type string.
88 test-ovsdb: syntax "["s","*=","c"]": syntax error: Type mismatch: "*=" operator may not be applied to column s of type string.
89 test-ovsdb: syntax "["s","/=","d"]": syntax error: Type mismatch: "/=" operator may not be applied to column s of type string.
90 test-ovsdb: syntax "["s","%=","e"]": syntax error: Type mismatch: "%=" operator may not be applied to column s of type string.
91 test-ovsdb: syntax "["s","insert","f"]": syntax error: Type mismatch: "insert" operator may not be applied to column s of type string.
92 test-ovsdb: syntax "["s","delete","g"]": syntax error: Type mismatch: "delete" operator may not be applied to column s of type string.
93 test-ovsdb: syntax "["u","+=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: "+=" operator may not be applied to column u of type uuid.
94 test-ovsdb: syntax "["u","-=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: "-=" operator may not be applied to column u of type uuid.
95 test-ovsdb: syntax "["u","*=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: "*=" operator may not be applied to column u of type uuid.
96 test-ovsdb: syntax "["u","/=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: "/=" operator may not be applied to column u of type uuid.
97 test-ovsdb: syntax "["u","insert",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: "insert" operator may not be applied to column u of type uuid.
98 test-ovsdb: syntax "["u","delete",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: "delete" operator may not be applied to column u of type uuid.
99 ]])
100 AT_CLEANUP
101
102 OVSDB_CHECK_POSITIVE([mutations on sets],
103 [[parse-mutations \
104 '{"columns":
105 {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}},
106 "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}},
107 "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}},
108 "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}},
109 "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \
110 '[["i", "+=", 1]]' \
111 '[["i", "-=", 2]]' \
112 '[["i", "*=", 3]]' \
113 '[["i", "/=", 4]]' \
114 '[["i", "%=", 5]]' \
115 '[["i", "insert", ["set", [1, 2]]]]' \
116 '[["i", "delete", ["set", [1, 2, 3]]]]' \
117 '[["r", "+=", 1]]' \
118 '[["r", "-=", 2]]' \
119 '[["r", "*=", 3]]' \
120 '[["r", "/=", 4]]' \
121 '[["r", "insert", ["set", [1, 2]]]]' \
122 '[["r", "delete", ["set", [1, 2, 3]]]]' \
123 '[["b", "insert", ["set", [true]]]]' \
124 '[["b", "delete", ["set", [false]]]]' \
125 '[["s", "insert", ["set", ["a"]]]]' \
126 '[["s", "delete", ["set", ["a", "b"]]]]' \
127 '[["u", "insert",
128 ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]' \
129 '[["u", "delete",
130 ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"],
131 ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]]]' \
132 ]],
133 [[[["i","+=",1]]
134 [["i","-=",2]]
135 [["i","*=",3]]
136 [["i","/=",4]]
137 [["i","%=",5]]
138 [["i","insert",["set",[1,2]]]]
139 [["i","delete",["set",[1,2,3]]]]
140 [["r","+=",1]]
141 [["r","-=",2]]
142 [["r","*=",3]]
143 [["r","/=",4]]
144 [["r","insert",["set",[1,2]]]]
145 [["r","delete",["set",[1,2,3]]]]
146 [["b","insert",true]]
147 [["b","delete",false]]
148 [["s","insert","a"]]
149 [["s","delete",["set",["a","b"]]]]
150 [["u","insert",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]
151 [["u","delete",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]]],
152 [mutation])
153
154 OVSDB_CHECK_POSITIVE([executing null mutation],
155 [[execute-mutations \
156 '{"columns": {"i": {"type": "integer"}}}' \
157 '[[]]' \
158 '[{"i": 0},
159 {"i": 1},
160 {"i": 2}']]],
161 [mutation 0:
162 row 0: no change
163 row 1: no change
164 row 2: no change
165 ])
166
167 OVSDB_CHECK_POSITIVE([executing mutations on integers],
168 [[execute-mutations \
169 '{"columns": {"i": {"type": "integer"}}}' \
170 '[[["i", "+=", 1]],
171 [["i", "-=", 2]],
172 [["i", "*=", 3]],
173 [["i", "/=", 4]],
174 [["i", "%=", 2]]]' \
175 '[{"i": 0},
176 {"i": 1},
177 {"i": 2}']]],
178 [mutation 0:
179 row 0: {"i":1}
180 row 1: {"i":2}
181 row 2: {"i":3}
182
183 mutation 1:
184 row 0: {"i":-2}
185 row 1: {"i":-1}
186 row 2: {"i":0}
187
188 mutation 2:
189 row 0: no change
190 row 1: {"i":3}
191 row 2: {"i":6}
192
193 mutation 3:
194 row 0: no change
195 row 1: {"i":0}
196 row 2: {"i":0}
197
198 mutation 4:
199 row 0: no change
200 row 1: no change
201 row 2: {"i":0}
202 ], [mutation])
203
204 OVSDB_CHECK_POSITIVE([integer overflow detection],
205 [[execute-mutations \
206 '{"columns": {"i": {"type": "integer"}}}' \
207 '[[["i", "+=", 9223372036854775807]],
208 [["i", "+=", -9223372036854775808]],
209 [["i", "-=", -9223372036854775808]],
210 [["i", "-=", 9223372036854775807]],
211 [["i", "*=", 3037000500]],
212 [["i", "/=", -1]],
213 [["i", "/=", 0]]]' \
214 '[{"i": 0},
215 {"i": 1},
216 {"i": -1},
217 {"i": 9223372036854775807},
218 {"i": -9223372036854775808},
219 {"i": 3037000500},
220 {"i": -3037000500}']]],
221 [mutation 0:
222 row 0: {"i":9223372036854775807}
223 row 1: range error: Result of "+=" operation is out of range.
224 row 2: {"i":9223372036854775806}
225 row 3: range error: Result of "+=" operation is out of range.
226 row 4: {"i":-1}
227 row 5: range error: Result of "+=" operation is out of range.
228 row 6: {"i":9223372033817775307}
229
230 mutation 1:
231 row 0: {"i":-9223372036854775808}
232 row 1: {"i":-9223372036854775807}
233 row 2: range error: Result of "+=" operation is out of range.
234 row 3: {"i":-1}
235 row 4: range error: Result of "+=" operation is out of range.
236 row 5: {"i":-9223372033817775308}
237 row 6: range error: Result of "+=" operation is out of range.
238
239 mutation 2:
240 row 0: range error: Result of "-=" operation is out of range.
241 row 1: range error: Result of "-=" operation is out of range.
242 row 2: {"i":9223372036854775807}
243 row 3: range error: Result of "-=" operation is out of range.
244 row 4: {"i":0}
245 row 5: range error: Result of "-=" operation is out of range.
246 row 6: {"i":9223372033817775308}
247
248 mutation 3:
249 row 0: {"i":-9223372036854775807}
250 row 1: {"i":-9223372036854775806}
251 row 2: {"i":-9223372036854775808}
252 row 3: {"i":0}
253 row 4: range error: Result of "-=" operation is out of range.
254 row 5: {"i":-9223372033817775307}
255 row 6: range error: Result of "-=" operation is out of range.
256
257 mutation 4:
258 row 0: no change
259 row 1: {"i":3037000500}
260 row 2: {"i":-3037000500}
261 row 3: range error: Result of "*=" operation is out of range.
262 row 4: range error: Result of "*=" operation is out of range.
263 row 5: range error: Result of "*=" operation is out of range.
264 row 6: range error: Result of "*=" operation is out of range.
265
266 mutation 5:
267 row 0: no change
268 row 1: {"i":-1}
269 row 2: {"i":1}
270 row 3: {"i":-9223372036854775807}
271 row 4: range error: Result of "/=" operation is out of range.
272 row 5: {"i":-3037000500}
273 row 6: {"i":3037000500}
274
275 mutation 6:
276 row 0: domain error: Division by zero.
277 row 1: domain error: Division by zero.
278 row 2: domain error: Division by zero.
279 row 3: domain error: Division by zero.
280 row 4: domain error: Division by zero.
281 row 5: domain error: Division by zero.
282 row 6: domain error: Division by zero.
283 ], [mutation])
284
285 OVSDB_CHECK_POSITIVE([executing mutations on integers with constraints],
286 [[execute-mutations \
287 '{"columns": {"i": {"type": {"key": {"type": "integer",
288 "minInteger": 0,
289 "maxInteger": 2}}}}}' \
290 '[[["i", "+=", 1]],
291 [["i", "-=", 2]],
292 [["i", "*=", 3]],
293 [["i", "/=", 4]],
294 [["i", "%=", 2]]]' \
295 '[{"i": 0},
296 {"i": 1},
297 {"i": 2}']]],
298 [mutation 0:
299 row 0: {"i":1}
300 row 1: {"i":2}
301 row 2: constraint violation: 3 is not in the valid range 0 to 2 (inclusive)
302
303 mutation 1:
304 row 0: constraint violation: -2 is not in the valid range 0 to 2 (inclusive)
305 row 1: constraint violation: -1 is not in the valid range 0 to 2 (inclusive)
306 row 2: {"i":0}
307
308 mutation 2:
309 row 0: no change
310 row 1: constraint violation: 3 is not in the valid range 0 to 2 (inclusive)
311 row 2: constraint violation: 6 is not in the valid range 0 to 2 (inclusive)
312
313 mutation 3:
314 row 0: no change
315 row 1: {"i":0}
316 row 2: {"i":0}
317
318 mutation 4:
319 row 0: no change
320 row 1: no change
321 row 2: {"i":0}
322 ], [mutation])
323
324 OVSDB_CHECK_POSITIVE([executing mutations on reals],
325 [[execute-mutations \
326 '{"columns": {"r": {"type": "real"}}}' \
327 '[[["r", "+=", 0.5]],
328 [["r", "-=", 1.5]],
329 [["r", "*=", 2.5]],
330 [["r", "/=", 4]]]' \
331 '[{"r": 0},
332 {"r": -2.5},
333 {"r": 1.25}']]],
334 [mutation 0:
335 row 0: {"r":0.5}
336 row 1: {"r":-2}
337 row 2: {"r":1.75}
338
339 mutation 1:
340 row 0: {"r":-1.5}
341 row 1: {"r":-4}
342 row 2: {"r":-0.25}
343
344 mutation 2:
345 row 0: no change
346 row 1: {"r":-6.25}
347 row 2: {"r":3.125}
348
349 mutation 3:
350 row 0: no change
351 row 1: {"r":-0.625}
352 row 2: {"r":0.3125}
353 ], [mutation])
354
355 OVSDB_CHECK_POSITIVE([real overflow detection],
356 [[execute-mutations \
357 '{"columns": {"r": {"type": "real"}}}' \
358 '[[["r", "+=", 1.7976931348623157e+308]],
359 [["r", "-=", 1.7976931348623157e+308]],
360 [["r", "*=", 2]],
361 [["r", "/=", 4]],
362 [["r", "/=", 0.5]],
363 [["r", "/=", 0]]]' \
364 '[{"r": 0},
365 {"r": 1.7976931348623157e+308},
366 {"r": -1.7976931348623157e+308}']]],
367 [mutation 0:
368 row 0: {"r":1.79769313486232e+308}
369 row 1: range error: Result of "+=" operation is out of range.
370 row 2: {"r":0}
371
372 mutation 1:
373 row 0: {"r":-1.79769313486232e+308}
374 row 1: {"r":0}
375 row 2: range error: Result of "-=" operation is out of range.
376
377 mutation 2:
378 row 0: no change
379 row 1: range error: Result of "*=" operation is out of range.
380 row 2: range error: Result of "*=" operation is out of range.
381
382 mutation 3:
383 row 0: no change
384 row 1: {"r":4.49423283715579e+307}
385 row 2: {"r":-4.49423283715579e+307}
386
387 mutation 4:
388 row 0: no change
389 row 1: range error: Result of "/=" operation is out of range.
390 row 2: range error: Result of "/=" operation is out of range.
391
392 mutation 5:
393 row 0: domain error: Division by zero.
394 row 1: domain error: Division by zero.
395 row 2: domain error: Division by zero.
396 ], [mutation])
397
398 OVSDB_CHECK_POSITIVE([executing mutations on reals with constraints],
399 [[execute-mutations \
400 '{"columns": {"r": {"type": {"key": {"type": "real",
401 "minReal": -2.5,
402 "maxReal": 1.75}}}}}' \
403 '[[["r", "+=", 0.5]],
404 [["r", "-=", 1.5]],
405 [["r", "*=", 2.5]],
406 [["r", "/=", 4]]]' \
407 '[{"r": 0},
408 {"r": -2.5},
409 {"r": 1.25}']]],
410 [mutation 0:
411 row 0: {"r":0.5}
412 row 1: {"r":-2}
413 row 2: {"r":1.75}
414
415 mutation 1:
416 row 0: {"r":-1.5}
417 row 1: constraint violation: -4 is not in the valid range -2.5 to 1.75 (inclusive)
418 row 2: {"r":-0.25}
419
420 mutation 2:
421 row 0: no change
422 row 1: constraint violation: -6.25 is not in the valid range -2.5 to 1.75 (inclusive)
423 row 2: constraint violation: 3.125 is not in the valid range -2.5 to 1.75 (inclusive)
424
425 mutation 3:
426 row 0: no change
427 row 1: {"r":-0.625}
428 row 2: {"r":0.3125}
429 ], [mutation])
430
431 OVSDB_CHECK_POSITIVE([executing mutations on integer sets],
432 [[execute-mutations \
433 '{"columns": {"i": {"type": {"key": {"type": "integer",
434 "maxInteger": 5},
435 "min": 0,
436 "max": "unlimited"}}}}' \
437 '[[["i", "+=", 1]],
438 [["i", "-=", 2]],
439 [["i", "*=", 3]],
440 [["i", "/=", 4]],
441 [["i", "%=", 2]],
442 [["i", "insert", ["set", [1]]]],
443 [["i", "insert", ["set", [2, 3]]]],
444 [["i", "delete", ["set", [1]]]],
445 [["i", "delete", ["set", [2, 3]]]]]' \
446 '[{"i": ["set", []]},
447 {"i": ["set", [0]]},
448 {"i": ["set", [0, 1]]},
449 {"i": ["set", [0, 1, 2]]}']]],
450 [[mutation 0:
451 row 0: no change
452 row 1: {"i":1}
453 row 2: {"i":["set",[1,2]]}
454 row 3: {"i":["set",[1,2,3]]}
455
456 mutation 1:
457 row 0: no change
458 row 1: {"i":-2}
459 row 2: {"i":["set",[-2,-1]]}
460 row 3: {"i":["set",[-2,-1,0]]}
461
462 mutation 2:
463 row 0: no change
464 row 1: no change
465 row 2: {"i":["set",[0,3]]}
466 row 3: constraint violation: 6 is greater than maximum allowed value 5
467
468 mutation 3:
469 row 0: no change
470 row 1: no change
471 row 2: constraint violation: Result of "/=" operation contains duplicates.
472 row 3: constraint violation: Result of "/=" operation contains duplicates.
473
474 mutation 4:
475 row 0: no change
476 row 1: no change
477 row 2: no change
478 row 3: constraint violation: Result of "%=" operation contains duplicates.
479
480 mutation 5:
481 row 0: {"i":1}
482 row 1: {"i":["set",[0,1]]}
483 row 2: no change
484 row 3: no change
485
486 mutation 6:
487 row 0: {"i":["set",[2,3]]}
488 row 1: {"i":["set",[0,2,3]]}
489 row 2: {"i":["set",[0,1,2,3]]}
490 row 3: {"i":["set",[0,1,2,3]]}
491
492 mutation 7:
493 row 0: no change
494 row 1: no change
495 row 2: {"i":0}
496 row 3: {"i":["set",[0,2]]}
497
498 mutation 8:
499 row 0: no change
500 row 1: no change
501 row 2: no change
502 row 3: {"i":["set",[0,1]]}
503 ]], [mutation])
504
505 OVSDB_CHECK_POSITIVE([executing mutations on real sets],
506 [[execute-mutations \
507 '{"columns": {"r": {"type": {"key": {"type": "real",
508 "maxReal": 6},
509 "min": 0, "max": "unlimited"}}}}' \
510 '[[["r", "+=", 0.5]],
511 [["r", "-=", 1.5]],
512 [["r", "*=", 2.5]],
513 [["r", "/=", 4]],
514 [["r", "*=", 0]],
515 [["r", "insert", 1.5]],
516 [["r", "insert", 3]],
517 [["r", "delete", ["set", [1.5, 3.5]]]],
518 [["r", "delete", ["set", [0.5, 1.5, 2.5]]]]]' \
519 '[{"r": ["set", []]},
520 {"r": 0.5},
521 {"r": ["set", [0.5, 1.5]]},
522 {"r": ["set", [0.5, 1.5, 2.5]]}']]],
523 [[mutation 0:
524 row 0: no change
525 row 1: {"r":1}
526 row 2: {"r":["set",[1,2]]}
527 row 3: {"r":["set",[1,2,3]]}
528
529 mutation 1:
530 row 0: no change
531 row 1: {"r":-1}
532 row 2: {"r":["set",[-1,0]]}
533 row 3: {"r":["set",[-1,0,1]]}
534
535 mutation 2:
536 row 0: no change
537 row 1: {"r":1.25}
538 row 2: {"r":["set",[1.25,3.75]]}
539 row 3: constraint violation: 6.25 is greater than maximum allowed value 6
540
541 mutation 3:
542 row 0: no change
543 row 1: {"r":0.125}
544 row 2: {"r":["set",[0.125,0.375]]}
545 row 3: {"r":["set",[0.125,0.375,0.625]]}
546
547 mutation 4:
548 row 0: no change
549 row 1: {"r":0}
550 row 2: constraint violation: Result of "*=" operation contains duplicates.
551 row 3: constraint violation: Result of "*=" operation contains duplicates.
552
553 mutation 5:
554 row 0: {"r":1.5}
555 row 1: {"r":["set",[0.5,1.5]]}
556 row 2: no change
557 row 3: no change
558
559 mutation 6:
560 row 0: {"r":3}
561 row 1: {"r":["set",[0.5,3]]}
562 row 2: {"r":["set",[0.5,1.5,3]]}
563 row 3: {"r":["set",[0.5,1.5,2.5,3]]}
564
565 mutation 7:
566 row 0: no change
567 row 1: no change
568 row 2: {"r":0.5}
569 row 3: {"r":["set",[0.5,2.5]]}
570
571 mutation 8:
572 row 0: no change
573 row 1: {"r":["set",[]]}
574 row 2: {"r":["set",[]]}
575 row 3: {"r":["set",[]]}
576 ]], [mutation])
577
578 OVSDB_CHECK_POSITIVE([executing mutations on boolean sets],
579 [[execute-mutations \
580 '{"columns": {"b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}}}' \
581 '[[["b", "insert", ["set", [false]]]],
582 [["b", "insert", ["set", [true]]]],
583 [["b", "insert", ["set", [false, true]]]],
584 [["b", "delete", ["set", [false]]]],
585 [["b", "delete", ["set", [true]]]],
586 [["b", "delete", ["set", [true, false]]]]]' \
587 '[{"b": ["set", []]},
588 {"b": ["set", [false]]},
589 {"b": ["set", [true]]},
590 {"b": ["set", [false, true]]}']]],
591 [[mutation 0:
592 row 0: {"b":false}
593 row 1: no change
594 row 2: {"b":["set",[false,true]]}
595 row 3: no change
596
597 mutation 1:
598 row 0: {"b":true}
599 row 1: {"b":["set",[false,true]]}
600 row 2: no change
601 row 3: no change
602
603 mutation 2:
604 row 0: {"b":["set",[false,true]]}
605 row 1: {"b":["set",[false,true]]}
606 row 2: {"b":["set",[false,true]]}
607 row 3: no change
608
609 mutation 3:
610 row 0: no change
611 row 1: {"b":["set",[]]}
612 row 2: no change
613 row 3: {"b":true}
614
615 mutation 4:
616 row 0: no change
617 row 1: no change
618 row 2: {"b":["set",[]]}
619 row 3: {"b":false}
620
621 mutation 5:
622 row 0: no change
623 row 1: {"b":["set",[]]}
624 row 2: {"b":["set",[]]}
625 row 3: {"b":["set",[]]}
626 ]], [mutation])
627
628 OVSDB_CHECK_POSITIVE([executing mutations on string sets],
629 [[execute-mutations \
630 '{"columns": {"s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}}}' \
631 '[[["s", "insert", ["set", ["a"]]]],
632 [["s", "insert", ["set", ["b"]]]],
633 [["s", "insert", ["set", ["c", "d"]]]],
634 [["s", "delete", ["set", ["a"]]]],
635 [["s", "delete", ["set", ["b"]]]],
636 [["s", "delete", ["set", ["c", "d"]]]]]' \
637 '[{"s": ["set", []]},
638 {"s": ["set", ["a"]]},
639 {"s": ["set", ["a", "b"]]},
640 {"s": ["set", ["a", "b", "c", "d"]]}']]],
641 [[mutation 0:
642 row 0: {"s":"a"}
643 row 1: no change
644 row 2: no change
645 row 3: no change
646
647 mutation 1:
648 row 0: {"s":"b"}
649 row 1: {"s":["set",["a","b"]]}
650 row 2: no change
651 row 3: no change
652
653 mutation 2:
654 row 0: {"s":["set",["c","d"]]}
655 row 1: {"s":["set",["a","c","d"]]}
656 row 2: {"s":["set",["a","b","c","d"]]}
657 row 3: no change
658
659 mutation 3:
660 row 0: no change
661 row 1: {"s":["set",[]]}
662 row 2: {"s":"b"}
663 row 3: {"s":["set",["b","c","d"]]}
664
665 mutation 4:
666 row 0: no change
667 row 1: no change
668 row 2: {"s":"a"}
669 row 3: {"s":["set",["a","c","d"]]}
670
671 mutation 5:
672 row 0: no change
673 row 1: no change
674 row 2: no change
675 row 3: {"s":["set",["a","b"]]}
676 ]], [mutation])
677
678 OVSDB_CHECK_POSITIVE([executing mutations on uuid sets],
679 [[execute-mutations \
680 '{"columns": {"u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \
681 '[[["u", "insert", ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]]],
682 [["u", "insert", ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]]],
683 [["u", "insert", ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]]],
684 [["u", "delete", ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]]],
685 [["u", "delete", ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]]],
686 [["u", "delete", ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]]]]' \
687 '[{"u": ["set", []]},
688 {"u": ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]},
689 {"u": ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]},
690 {"u": ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]}']]],
691 [[mutation 0:
692 row 0: {"u":["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]}
693 row 1: no change
694 row 2: {"u":["set",[["uuid","a60fe7ff-317b-4568-9106-892b37445313"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
695 row 3: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
696
697 mutation 1:
698 row 0: {"u":["uuid","a60fe7ff-317b-4568-9106-892b37445313"]}
699 row 1: {"u":["set",[["uuid","a60fe7ff-317b-4568-9106-892b37445313"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
700 row 2: no change
701 row 3: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","a60fe7ff-317b-4568-9106-892b37445313"]]]}
702
703 mutation 2:
704 row 0: {"u":["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"]}
705 row 1: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
706 row 2: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","a60fe7ff-317b-4568-9106-892b37445313"]]]}
707 row 3: no change
708
709 mutation 3:
710 row 0: no change
711 row 1: {"u":["set",[]]}
712 row 2: no change
713 row 3: no change
714
715 mutation 4:
716 row 0: no change
717 row 1: no change
718 row 2: {"u":["set",[]]}
719 row 3: no change
720
721 mutation 5:
722 row 0: no change
723 row 1: no change
724 row 2: no change
725 row 3: {"u":["set",[]]}
726 ]], [mutation])
727
728 OVSDB_CHECK_POSITIVE([executing mutations on integer maps],
729 [[execute-mutations \
730 '{"columns": {"i": {"type": {"key": "integer", "value": "integer", "min": 0, "max": "unlimited"}}}}' \
731 '[[["i", "insert", ["map", [[1, 2]]]]],
732 [["i", "insert", ["map", [[2, 4], [3, 5]]]]],
733 [["i", "delete", ["map", [[1, 2]]]]],
734 [["i", "delete", ["map", [[2, 3]]]]],
735 [["i", "delete", ["set", [1]]]],
736 [["i", "delete", ["set", [2, 3]]]]]' \
737 '[{"i": ["map", []]},
738 {"i": ["map", [[1, 2]]]},
739 {"i": ["map", [[1, 3], [2, 3]]]},
740 {"i": ["map", [[3, 5]]]}']]],
741 [[mutation 0:
742 row 0: {"i":["map",[[1,2]]]}
743 row 1: no change
744 row 2: no change
745 row 3: {"i":["map",[[1,2],[3,5]]]}
746
747 mutation 1:
748 row 0: {"i":["map",[[2,4],[3,5]]]}
749 row 1: {"i":["map",[[1,2],[2,4],[3,5]]]}
750 row 2: {"i":["map",[[1,3],[2,3],[3,5]]]}
751 row 3: {"i":["map",[[2,4],[3,5]]]}
752
753 mutation 2:
754 row 0: no change
755 row 1: {"i":["map",[]]}
756 row 2: no change
757 row 3: no change
758
759 mutation 3:
760 row 0: no change
761 row 1: no change
762 row 2: {"i":["map",[[1,3]]]}
763 row 3: no change
764
765 mutation 4:
766 row 0: no change
767 row 1: {"i":["map",[]]}
768 row 2: {"i":["map",[[2,3]]]}
769 row 3: no change
770
771 mutation 5:
772 row 0: no change
773 row 1: no change
774 row 2: {"i":["map",[[1,3]]]}
775 row 3: {"i":["map",[]]}
776 ]], [mutation])