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