X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fovsdb-execution.at;fp=tests%2Fovsdb-execution.at;h=6a3b5d157a3cab1c3ac5351afec23914a01aaa8e;hb=341c4e59f50a842a2974d06e448a57af372a7edd;hp=480f61016ffa26a252b2c191b91edd8cf7a705d1;hpb=c22c56bd746352f5c70a0d99bb3f548d03cfd105;p=openvswitch diff --git a/tests/ovsdb-execution.at b/tests/ovsdb-execution.at index 480f6101..6a3b5d15 100644 --- a/tests/ovsdb-execution.at +++ b/tests/ovsdb-execution.at @@ -111,6 +111,15 @@ gc_schema () { "isRoot": false}}} EOF } + +immutable_schema () { + cat <<'EOF' +{"name": "immutable", + "tables": { + "a": { + "columns": {"i": {"type": "integer", "mutable": false}}}}} +EOF +} ] m4_divert_pop([PREPARE_TESTS]) @@ -908,6 +917,40 @@ OVSDB_CHECK_EXECUTION([weak references], [{"rows":[{"_uuid":["uuid","<3>"],"b":2,"b2a":["set",[]]},{"_uuid":["uuid","<4>"],"b":3,"b2a":["set",[]]}]}] ]]) +OVSDB_CHECK_EXECUTION([immutable columns], + [immutable_schema], + [[[["immutable", + {"op": "insert", + "table": "a", + "row": {"i": 5}, + "uuid-name": "row1"}]]], + [[["immutable", + {"op": "update", + "table": "a", + "row": {"i": 10}, + "where": []}]]], + [[["immutable", + {"op": "update", + "table": "a", + "row": {"i": 5}, + "where": []}]]], + [[["immutable", + {"op": "mutate", + "table": "a", + "where": [], + "mutations": [["i", "-=", 5]]}]]], + [[["immutable", + {"op": "mutate", + "table": "a", + "where": [], + "mutations": [["i", "*=", 1]]}]]]], + [[[{"uuid":["uuid","<0>"]}] +[{"details":"Cannot update immutable column i in table a.","error":"constraint violation","syntax":"{\"op\":\"update\",\"row\":{\"i\":10},\"table\":\"a\",\"where\":[]}"}] +[{"details":"Cannot update immutable column i in table a.","error":"constraint violation","syntax":"{\"op\":\"update\",\"row\":{\"i\":5},\"table\":\"a\",\"where\":[]}"}] +[{"details":"Cannot mutate immutable column i in table a.","error":"constraint violation","syntax":"[\"i\",\"-=\",5]"}] +[{"details":"Cannot mutate immutable column i in table a.","error":"constraint violation","syntax":"[\"i\",\"*=\",1]"}] +]]) + OVSDB_CHECK_EXECUTION([garbage collection], [gc_schema], [dnl Check that inserting a row without any references is a no-op.