summaryrefslogtreecommitdiff
path: root/tests/ovsdb-execution.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-02-28 15:43:29 -0800
committerBen Pfaff <blp@nicira.com>2011-03-10 11:23:59 -0800
commitd198c4beee03741670d046baf0179ac5583305bb (patch)
tree334e1bdaeb58f1f63797a711d0f01e9c22f81c15 /tests/ovsdb-execution.at
parentacb4f876b8cdf37191355724da8f4aca64c9bfae (diff)
downloadopenvswitch-d198c4beee03741670d046baf0179ac5583305bb.tar.gz
ovsdb-data: Verify that named-uuid string is an <id>.
The "uuid-name" that creates symbols must be an <id> but we weren't verifying the same constraint on the "named-uuid"s that refer to symbols, which was a bit confusing in writing transactions by hand. This commit fixes the inconsistency and updates the SPECS file to clarify that a named-uuid string has to be an <id>.
Diffstat (limited to 'tests/ovsdb-execution.at')
-rw-r--r--tests/ovsdb-execution.at19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ovsdb-execution.at b/tests/ovsdb-execution.at
index d4f2380f8..47be1935f 100644
--- a/tests/ovsdb-execution.at
+++ b/tests/ovsdb-execution.at
@@ -77,6 +77,25 @@ m4_define([OVSDB_CHECK_EXECUTION],
AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [$4])
AT_CLEANUP])
+OVSDB_CHECK_EXECUTION([uuid-name must be <id>],
+ [CONSTRAINT_SCHEMA],
+ [[[["constraints",
+ {"op": "insert",
+ "table": "a",
+ "row": {},
+ "uuid-name": "0"}]]]],
+ [[[{"details":"Parsing ovsdb operation 1 of 1 failed: Type mismatch for member 'uuid-name'.","error":"syntax error","syntax":"{\"op\":\"insert\",\"row\":{},\"table\":\"a\",\"uuid-name\":\"0\"}"}]
+]])
+
+OVSDB_CHECK_EXECUTION([named-uuid must be <id>],
+ [CONSTRAINT_SCHEMA],
+ [[[["constraints",
+ {"op": "insert",
+ "table": "a",
+ "row": {"a2a": ["named-uuid", "0"]}}]]]],
+ [[[{"details":"named-uuid string is not a valid <id>","error":"syntax error","syntax":"[\"named-uuid\",\"0\"]"}]
+]])
+
m4_define([EXECUTION_EXAMPLES], [
dnl At one point the "commit" code ignored new rows with all-default values,
dnl so this checks for that problem.