X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fovsdb-mutation.at;h=3d753176ddb152cca674d79a3dfd717513ce1056;hb=d2859659800b7e01281d1ca84a726d6b20e98ee1;hp=4308dd3059f3763ef9be9f6f3821d54c1d30403d;hpb=a0bc29a541fc7dc6e20137d5558e2094d614e6ab;p=openvswitch diff --git a/tests/ovsdb-mutation.at b/tests/ovsdb-mutation.at index 4308dd30..3d753176 100644 --- a/tests/ovsdb-mutation.at +++ b/tests/ovsdb-mutation.at @@ -502,6 +502,45 @@ row 2: no change row 3: {"i":["set",[0,1]]} ]], [mutation]) +OVSDB_CHECK_POSITIVE([executing mutations on integer sets with constraints], + [[execute-mutations \ + '{"columns": {"i": {"type": {"key": "integer", + "min": 1, + "max": 2}}}}' \ + '[[["i", "insert", ["set", [1]]]], + [["i", "insert", ["set", [2]]]], + [["i", "delete", ["set", [1]]]], + [["i", "delete", ["set", [2]]]], + [["i", "delete", ["set", [0, 1]]]]]' \ + '[{"i": ["set", [0]]}, + {"i": ["set", [2]]}, + {"i": ["set", [0, 1]]}']]], + [[mutation 0: +row 0: {"i":["set",[0,1]]} +row 1: {"i":["set",[1,2]]} +row 2: no change + +mutation 1: +row 0: {"i":["set",[0,2]]} +row 1: no change +row 2: constraint violation: Attempted to store 3 elements in set of 1 to 2 integers. + +mutation 2: +row 0: no change +row 1: no change +row 2: {"i":0} + +mutation 3: +row 0: no change +row 1: constraint violation: Attempted to store 0 elements in set of 1 to 2 integers. +row 2: no change + +mutation 4: +row 0: constraint violation: Attempted to store 0 elements in set of 1 to 2 integers. +row 1: no change +row 2: constraint violation: Attempted to store 0 elements in set of 1 to 2 integers. +]], [mutation]) + OVSDB_CHECK_POSITIVE([executing mutations on real sets], [[execute-mutations \ '{"columns": {"r": {"type": {"key": {"type": "real",