ovsdb: Add new "mutation" operation to transactions.
[sliver-openvswitch.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 OVS_CHECK_LCOV([[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",["set",[true]]]]
147 [["b","delete",["set",[false]]]]
148 [["s","insert",["set",["a"]]]]
149 [["s","delete",["set",["a","b"]]]]
150 [["u","insert",["set",[["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 reals],
286   [[execute-mutations \
287     '{"columns": {"r": {"type": "real"}}}' \
288     '[[["r", "+=", 0.5]],
289       [["r", "-=", 1.5]],
290       [["r", "*=", 2.5]],
291       [["r", "/=", 4]]]' \
292     '[{"r": 0},
293       {"r": -2.5},
294       {"r": 1.25}']]],
295   [mutation  0:
296 row 0: {"r":0.5}
297 row 1: {"r":-2}
298 row 2: {"r":1.75}
299
300 mutation  1:
301 row 0: {"r":-1.5}
302 row 1: {"r":-4}
303 row 2: {"r":-0.25}
304
305 mutation  2:
306 row 0: no change
307 row 1: {"r":-6.25}
308 row 2: {"r":3.125}
309
310 mutation  3:
311 row 0: no change
312 row 1: {"r":-0.625}
313 row 2: {"r":0.3125}
314 ], [mutation])
315
316 OVSDB_CHECK_POSITIVE([real overflow detection],
317   [[execute-mutations \
318     '{"columns": {"r": {"type": "real"}}}' \
319     '[[["r", "+=", 1.7976931348623157e+308]],
320       [["r", "-=", 1.7976931348623157e+308]],
321       [["r", "*=", 2]],
322       [["r", "/=", 4]],
323       [["r", "/=", 0.5]],
324       [["r", "/=", 0]]]' \
325     '[{"r": 0},
326       {"r": 1.7976931348623157e+308},
327       {"r": -1.7976931348623157e+308}']]],
328   [mutation  0:
329 row 0: {"r":1.79769313486232e+308}
330 row 1: range error: Result of "+=" operation is out of range.
331 row 2: {"r":0}
332
333 mutation  1:
334 row 0: {"r":-1.79769313486232e+308}
335 row 1: {"r":0}
336 row 2: range error: Result of "-=" operation is out of range.
337
338 mutation  2:
339 row 0: no change
340 row 1: range error: Result of "*=" operation is out of range.
341 row 2: range error: Result of "*=" operation is out of range.
342
343 mutation  3:
344 row 0: no change
345 row 1: {"r":4.49423283715579e+307}
346 row 2: {"r":-4.49423283715579e+307}
347
348 mutation  4:
349 row 0: no change
350 row 1: range error: Result of "/=" operation is out of range.
351 row 2: range error: Result of "/=" operation is out of range.
352
353 mutation  5:
354 row 0: domain error: Division by zero.
355 row 1: domain error: Division by zero.
356 row 2: domain error: Division by zero.
357 ], [mutation])
358
359 OVSDB_CHECK_POSITIVE([executing mutations on integer sets],
360   [[execute-mutations \
361     '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}}}' \
362     '[[["i", "+=", 1]],
363       [["i", "-=", 2]],
364       [["i", "*=", 3]],
365       [["i", "/=", 4]],
366       [["i", "%=", 2]],
367       [["i", "insert", ["set", [1]]]],
368       [["i", "insert", ["set", [2, 3]]]],
369       [["i", "delete", ["set", [1]]]],
370       [["i", "delete", ["set", [2, 3]]]]]' \
371     '[{"i": ["set", []]},
372       {"i": ["set", [0]]},
373       {"i": ["set", [0, 1]]},
374       {"i": ["set", [0, 1, 2]]}']]],
375   [[mutation  0:
376 row 0: no change
377 row 1: {"i":["set",[1]]}
378 row 2: {"i":["set",[1,2]]}
379 row 3: {"i":["set",[1,2,3]]}
380
381 mutation  1:
382 row 0: no change
383 row 1: {"i":["set",[-2]]}
384 row 2: {"i":["set",[-2,-1]]}
385 row 3: {"i":["set",[-2,-1,0]]}
386
387 mutation  2:
388 row 0: no change
389 row 1: no change
390 row 2: {"i":["set",[0,3]]}
391 row 3: {"i":["set",[0,3,6]]}
392
393 mutation  3:
394 row 0: no change
395 row 1: no change
396 row 2: constraint violation: Result of "/=" operation contains duplicates.
397 row 3: constraint violation: Result of "/=" operation contains duplicates.
398
399 mutation  4:
400 row 0: no change
401 row 1: no change
402 row 2: no change
403 row 3: constraint violation: Result of "%=" operation contains duplicates.
404
405 mutation  5:
406 row 0: {"i":["set",[1]]}
407 row 1: {"i":["set",[0,1]]}
408 row 2: no change
409 row 3: no change
410
411 mutation  6:
412 row 0: {"i":["set",[2,3]]}
413 row 1: {"i":["set",[0,2,3]]}
414 row 2: {"i":["set",[0,1,2,3]]}
415 row 3: {"i":["set",[0,1,2,3]]}
416
417 mutation  7:
418 row 0: no change
419 row 1: no change
420 row 2: {"i":["set",[0]]}
421 row 3: {"i":["set",[0,2]]}
422
423 mutation  8:
424 row 0: no change
425 row 1: no change
426 row 2: no change
427 row 3: {"i":["set",[0,1]]}
428 ]], [mutation])
429
430 OVSDB_CHECK_POSITIVE([executing mutations on real sets],
431   [[execute-mutations \
432     '{"columns": {"r": {"type": {"key": "real", "min": 0, "max": "unlimited"}}}}' \
433     '[[["r", "+=", 0.5]],
434       [["r", "-=", 1.5]],
435       [["r", "*=", 2.5]],
436       [["r", "/=", 4]],
437       [["r", "*=", 0]],
438       [["r", "insert", ["set", [1.5]]]],
439       [["r", "insert", ["set", [3]]]],
440       [["r", "delete", ["set", [1.5, 3.5]]]],
441       [["r", "delete", ["set", [0.5, 1.5, 2.5]]]]]' \
442     '[{"r": ["set", []]},
443       {"r": ["set", [0.5]]},
444       {"r": ["set", [0.5, 1.5]]},
445       {"r": ["set", [0.5, 1.5, 2.5]]}']]],
446   [[mutation  0:
447 row 0: no change
448 row 1: {"r":["set",[1]]}
449 row 2: {"r":["set",[1,2]]}
450 row 3: {"r":["set",[1,2,3]]}
451
452 mutation  1:
453 row 0: no change
454 row 1: {"r":["set",[-1]]}
455 row 2: {"r":["set",[-1,0]]}
456 row 3: {"r":["set",[-1,0,1]]}
457
458 mutation  2:
459 row 0: no change
460 row 1: {"r":["set",[1.25]]}
461 row 2: {"r":["set",[1.25,3.75]]}
462 row 3: {"r":["set",[1.25,3.75,6.25]]}
463
464 mutation  3:
465 row 0: no change
466 row 1: {"r":["set",[0.125]]}
467 row 2: {"r":["set",[0.125,0.375]]}
468 row 3: {"r":["set",[0.125,0.375,0.625]]}
469
470 mutation  4:
471 row 0: no change
472 row 1: {"r":["set",[0]]}
473 row 2: constraint violation: Result of "*=" operation contains duplicates.
474 row 3: constraint violation: Result of "*=" operation contains duplicates.
475
476 mutation  5:
477 row 0: {"r":["set",[1.5]]}
478 row 1: {"r":["set",[0.5,1.5]]}
479 row 2: no change
480 row 3: no change
481
482 mutation  6:
483 row 0: {"r":["set",[3]]}
484 row 1: {"r":["set",[0.5,3]]}
485 row 2: {"r":["set",[0.5,1.5,3]]}
486 row 3: {"r":["set",[0.5,1.5,2.5,3]]}
487
488 mutation  7:
489 row 0: no change
490 row 1: no change
491 row 2: {"r":["set",[0.5]]}
492 row 3: {"r":["set",[0.5,2.5]]}
493
494 mutation  8:
495 row 0: no change
496 row 1: {"r":["set",[]]}
497 row 2: {"r":["set",[]]}
498 row 3: {"r":["set",[]]}
499 ]], [mutation])
500
501 OVSDB_CHECK_POSITIVE([executing mutations on boolean sets],
502   [[execute-mutations \
503     '{"columns": {"b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}}}' \
504     '[[["b", "insert", ["set", [false]]]],
505       [["b", "insert", ["set", [true]]]],
506       [["b", "insert", ["set", [false, true]]]],
507       [["b", "delete", ["set", [false]]]],
508       [["b", "delete", ["set", [true]]]],
509       [["b", "delete", ["set", [true, false]]]]]' \
510     '[{"b": ["set", []]},
511       {"b": ["set", [false]]},
512       {"b": ["set", [true]]},
513       {"b": ["set", [false, true]]}']]],
514   [[mutation  0:
515 row 0: {"b":["set",[false]]}
516 row 1: no change
517 row 2: {"b":["set",[false,true]]}
518 row 3: no change
519
520 mutation  1:
521 row 0: {"b":["set",[true]]}
522 row 1: {"b":["set",[false,true]]}
523 row 2: no change
524 row 3: no change
525
526 mutation  2:
527 row 0: {"b":["set",[false,true]]}
528 row 1: {"b":["set",[false,true]]}
529 row 2: {"b":["set",[false,true]]}
530 row 3: no change
531
532 mutation  3:
533 row 0: no change
534 row 1: {"b":["set",[]]}
535 row 2: no change
536 row 3: {"b":["set",[true]]}
537
538 mutation  4:
539 row 0: no change
540 row 1: no change
541 row 2: {"b":["set",[]]}
542 row 3: {"b":["set",[false]]}
543
544 mutation  5:
545 row 0: no change
546 row 1: {"b":["set",[]]}
547 row 2: {"b":["set",[]]}
548 row 3: {"b":["set",[]]}
549 ]], [mutation])
550
551 OVSDB_CHECK_POSITIVE([executing mutations on string sets],
552   [[execute-mutations \
553     '{"columns": {"s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}}}' \
554     '[[["s", "insert", ["set", ["a"]]]],
555       [["s", "insert", ["set", ["b"]]]],
556       [["s", "insert", ["set", ["c", "d"]]]],
557       [["s", "delete", ["set", ["a"]]]],
558       [["s", "delete", ["set", ["b"]]]],
559       [["s", "delete", ["set", ["c", "d"]]]]]' \
560     '[{"s": ["set", []]},
561       {"s": ["set", ["a"]]},
562       {"s": ["set", ["a", "b"]]},
563       {"s": ["set", ["a", "b", "c", "d"]]}']]],
564   [[mutation  0:
565 row 0: {"s":["set",["a"]]}
566 row 1: no change
567 row 2: no change
568 row 3: no change
569
570 mutation  1:
571 row 0: {"s":["set",["b"]]}
572 row 1: {"s":["set",["a","b"]]}
573 row 2: no change
574 row 3: no change
575
576 mutation  2:
577 row 0: {"s":["set",["c","d"]]}
578 row 1: {"s":["set",["a","c","d"]]}
579 row 2: {"s":["set",["a","b","c","d"]]}
580 row 3: no change
581
582 mutation  3:
583 row 0: no change
584 row 1: {"s":["set",[]]}
585 row 2: {"s":["set",["b"]]}
586 row 3: {"s":["set",["b","c","d"]]}
587
588 mutation  4:
589 row 0: no change
590 row 1: no change
591 row 2: {"s":["set",["a"]]}
592 row 3: {"s":["set",["a","c","d"]]}
593
594 mutation  5:
595 row 0: no change
596 row 1: no change
597 row 2: no change
598 row 3: {"s":["set",["a","b"]]}
599 ]], [mutation])
600
601 OVSDB_CHECK_POSITIVE([executing mutations on uuid sets],
602   [[execute-mutations \
603     '{"columns": {"u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \
604     '[[["u", "insert", ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]]],
605       [["u", "insert", ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]]],
606       [["u", "insert", ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]]],
607       [["u", "delete", ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]]],
608       [["u", "delete", ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]]],
609       [["u", "delete", ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]]]]' \
610     '[{"u": ["set", []]},
611       {"u": ["set", [["uuid", "ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]},
612       {"u": ["set", [["uuid", "a60fe7ff-317b-4568-9106-892b37445313"]]]},
613       {"u": ["set", [["uuid", "2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]}']]],
614   [[mutation  0:
615 row 0: {"u":["set",[["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
616 row 1: no change
617 row 2: {"u":["set",[["uuid","a60fe7ff-317b-4568-9106-892b37445313"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
618 row 3: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
619
620 mutation  1:
621 row 0: {"u":["set",[["uuid","a60fe7ff-317b-4568-9106-892b37445313"]]]}
622 row 1: {"u":["set",[["uuid","a60fe7ff-317b-4568-9106-892b37445313"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
623 row 2: no change
624 row 3: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","a60fe7ff-317b-4568-9106-892b37445313"]]]}
625
626 mutation  2:
627 row 0: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"]]]}
628 row 1: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","ddd9e79d-7782-414c-8b22-1046c60b6ec2"]]]}
629 row 2: {"u":["set",[["uuid","2607d30e-e652-4927-9fec-8bbf1b60c7e9"],["uuid","a60fe7ff-317b-4568-9106-892b37445313"]]]}
630 row 3: no change
631
632 mutation  3:
633 row 0: no change
634 row 1: {"u":["set",[]]}
635 row 2: no change
636 row 3: no change
637
638 mutation  4:
639 row 0: no change
640 row 1: no change
641 row 2: {"u":["set",[]]}
642 row 3: no change
643
644 mutation  5:
645 row 0: no change
646 row 1: no change
647 row 2: no change
648 row 3: {"u":["set",[]]}
649 ]], [mutation])
650
651
652 OVSDB_CHECK_POSITIVE([executing mutations on integer maps],
653   [[execute-mutations \
654     '{"columns": {"i": {"type": {"key": "integer", "value": "integer", "min": 0, "max": "unlimited"}}}}' \
655     '[[["i", "insert", ["map", [[1, 2]]]]],
656       [["i", "insert", ["map", [[2, 4], [3, 5]]]]],
657       [["i", "delete", ["map", [[1, 2]]]]],
658       [["i", "delete", ["map", [[2, 3]]]]],
659       [["i", "delete", ["set", [1]]]],
660       [["i", "delete", ["set", [2, 3]]]]]' \
661     '[{"i": ["map", []]},
662       {"i": ["map", [[1, 2]]]},
663       {"i": ["map", [[1, 3], [2, 3]]]},
664       {"i": ["map", [[3, 5]]]}']]],
665   [[mutation  0:
666 row 0: {"i":["map",[[1,2]]]}
667 row 1: no change
668 row 2: no change
669 row 3: {"i":["map",[[1,2],[3,5]]]}
670
671 mutation  1:
672 row 0: {"i":["map",[[2,4],[3,5]]]}
673 row 1: {"i":["map",[[1,2],[2,4],[3,5]]]}
674 row 2: {"i":["map",[[1,3],[2,3],[3,5]]]}
675 row 3: {"i":["map",[[2,4],[3,5]]]}
676
677 mutation  2:
678 row 0: no change
679 row 1: {"i":["map",[]]}
680 row 2: no change
681 row 3: no change
682
683 mutation  3:
684 row 0: no change
685 row 1: no change
686 row 2: {"i":["map",[[1,3]]]}
687 row 3: no change
688
689 mutation  4:
690 row 0: no change
691 row 1: {"i":["map",[]]}
692 row 2: {"i":["map",[[2,3]]]}
693 row 3: no change
694
695 mutation  5:
696 row 0: no change
697 row 1: no change
698 row 2: {"i":["map",[[1,3]]]}
699 row 3: {"i":["map",[]]}
700 ]], [mutation])