X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb-execution.at;h=54ff0aeb2e597d542255eeadc042bfbb3bd82b53;hb=1b807595c4e6b4348444852bda8814e92412ad41;hp=ebf11867214ae8f39541e8a4dcae4687a72a2f47;hpb=0066b6033e84752dff92b4ac991e8da662c5061f;p=sliver-openvswitch.git diff --git a/tests/ovsdb-execution.at b/tests/ovsdb-execution.at index ebf118672..54ff0aeb2 100644 --- a/tests/ovsdb-execution.at +++ b/tests/ovsdb-execution.at @@ -26,7 +26,8 @@ m4_define([CONSTRAINT_SCHEMA], "b2a": {"type": {"key": {"type": "uuid", "refTable": "a"}, "min": 0, "max": "unlimited"}}, "b2b": {"type": {"key": {"type": "uuid", "refTable": "b"}, - "min": 0, "max": "unlimited"}}}}, + "min": 0, "max": "unlimited"}}, + "x": {"type": {"key": "integer", "min": 1, "max": 2}}}}, "constrained": { "columns": { "positive": {"type": {"key": {"type": "integer", @@ -575,6 +576,12 @@ OVSDB_CHECK_EXECUTION([referential integrity -- simple], {"op": "delete", "table": "b", "where": []}]]], +dnl Check that "mutate" honors number-of-elements constraints on sets and maps. + [[["constraints", + {"op": "mutate", + "table": "b", + "where": [], + "mutations": [["x", "delete", 0]]}]]], [[["constraints", {"op": "delete", "table": "a", @@ -601,6 +608,7 @@ OVSDB_CHECK_EXECUTION([referential integrity -- simple], "where": []}]]]], [[[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}] [{"count":1},{"details":"cannot delete b row <0> because of 3 remaining reference(s)","error":"referential integrity violation"}] +[{"details":"Attempted to store 0 elements in set of 1 to 2 integers.","error":"constraint violation"}] [{"count":1}] [{"count":1},{"details":"cannot delete b row <0> because of 2 remaining reference(s)","error":"referential integrity violation"}] [{"count":1}]