1 AT_BANNER([OVSDB -- tables])
3 OVSDB_CHECK_POSITIVE_CPY([non-root table with one column],
4 [[parse-table mytable '{"columns": {"name": {"type": "string"}}}']],
5 [[{"columns":{"name":{"type":"string"}}}]])
7 OVSDB_CHECK_POSITIVE_CPY([immutable table with one column],
8 [[parse-table mytable \
9 '{"columns": {"name": {"type": "string"}},
11 [[{"columns":{"name":{"type":"string"}},"mutable":false}]])
13 OVSDB_CHECK_POSITIVE_CPY([root table with one column],
14 [[parse-table mytable \
15 '{"columns": {"name": {"type": "string"}},
17 [[{"columns":{"name":{"type":"string"}},"isRoot":true}]])
19 OVSDB_CHECK_POSITIVE_CPY([non-root table with default_is_root=true],
20 [[parse-table mytable '{"columns": {"name": {"type": "string"}}}' true]],
21 [[{"columns":{"name":{"type":"string"}},"isRoot":false}]])
23 OVSDB_CHECK_POSITIVE_CPY([root table with default_is_root=true],
24 [[parse-table mytable \
25 '{"columns": {"name": {"type": "string"}},
26 "isRoot": true}' true]],
27 [[{"columns":{"name":{"type":"string"}}}]])
29 OVSDB_CHECK_POSITIVE_CPY([table with maxRows of 2],
30 [[parse-table mytable '{"columns": {"name": {"type": "string"}},
32 [[{"columns":{"name":{"type":"string"}},"maxRows":2}]])
34 OVSDB_CHECK_POSITIVE_CPY([table with index],
35 [[parse-table mytable '{"columns": {"a": {"type": "integer"},
36 "b": {"type": "string"}},
37 "indexes": [["b", "a"]]}']],
38 [[{"columns":{"a":{"type":"integer"},"b":{"type":"string"}},"indexes":[["b","a"]]}]])
40 OVSDB_CHECK_NEGATIVE_CPY([table with syntax error in index],
41 [[parse-table mytable '{"columns": {"a": {"type": "integer"},
42 "b": {"type": "string"}},
43 "indexes": [["b", "a"], [0]]}']],
44 [[array of distinct column names expected]])
46 OVSDB_CHECK_NEGATIVE_CPY([table with empty index],
47 [[parse-table mytable '{"columns": {"a": {"type": "integer"},
48 "b": {"type": "string"}},
50 [[index must have at least one column]])
52 OVSDB_CHECK_NEGATIVE_CPY([table with index of ephemeral column],
53 [[parse-table mytable '{"columns": {"a": {"type": "integer",
55 "b": {"type": "string"}},
56 "indexes": [["b", "a"]]}']],
57 [[ephemeral columns (such as a) may not be indexed]])
59 OVSDB_CHECK_NEGATIVE_CPY([column names may not begin with _],
60 [[parse-table mytable \
61 '{"columns": {"_column": {"type": "integer"}}}']],
62 [[names beginning with "_" are reserved]],
65 OVSDB_CHECK_NEGATIVE_CPY([table must have at least one column (1)],
66 [[parse-table mytable '{}']],
67 [[Parsing table schema for table mytable failed: Required 'columns' member is missing.]])
69 OVSDB_CHECK_NEGATIVE_CPY([table must have at least one column (2)],
70 [[parse-table mytable '{"columns": {}}']],
71 [[table must have at least one column]])
73 OVSDB_CHECK_NEGATIVE_CPY([table maxRows must be positive],
74 [[parse-table mytable '{"columns": {"name": {"type": "string"}},
76 [[syntax "{"columns":{"name":{"type":"string"}},"maxRows":0}": syntax error: maxRows must be at least 1]])