]>
Commit | Line | Data |
---|---|---|
f85f8ebb BP |
1 | AT_BANNER([OVSDB -- tables]) |
2 | ||
c5f341ab | 3 | OVSDB_CHECK_POSITIVE_CPY([non-root table with one column], |
f85f8ebb BP |
4 | [[parse-table mytable '{"columns": {"name": {"type": "string"}}}']], |
5 | [[{"columns":{"name":{"type":"string"}}}]]) | |
6 | ||
99155935 | 7 | OVSDB_CHECK_POSITIVE_CPY([immutable table with one column], |
f85f8ebb BP |
8 | [[parse-table mytable \ |
9 | '{"columns": {"name": {"type": "string"}}, | |
10 | "mutable": false}']], | |
11 | [[{"columns":{"name":{"type":"string"}},"mutable":false}]]) | |
12 | ||
c5f341ab BP |
13 | OVSDB_CHECK_POSITIVE_CPY([root table with one column], |
14 | [[parse-table mytable \ | |
15 | '{"columns": {"name": {"type": "string"}}, | |
16 | "isRoot": true}']], | |
17 | [[{"columns":{"name":{"type":"string"}},"isRoot":true}]]) | |
18 | ||
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}]]) | |
22 | ||
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"}}}]]) | |
28 | ||
99155935 | 29 | OVSDB_CHECK_POSITIVE_CPY([table with maxRows of 2], |
87ab878c BP |
30 | [[parse-table mytable '{"columns": {"name": {"type": "string"}}, |
31 | "maxRows": 2}']], | |
32 | [[{"columns":{"name":{"type":"string"}},"maxRows":2}]]) | |
33 | ||
6910a6e6 BP |
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"]]}]]) | |
39 | ||
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]]) | |
45 | ||
46 | OVSDB_CHECK_NEGATIVE_CPY([table with empty index], | |
47 | [[parse-table mytable '{"columns": {"a": {"type": "integer"}, | |
48 | "b": {"type": "string"}}, | |
49 | "indexes": [[]]}']], | |
50 | [[index must have at least one column]]) | |
51 | ||
52 | OVSDB_CHECK_NEGATIVE_CPY([table with index of ephemeral column], | |
53 | [[parse-table mytable '{"columns": {"a": {"type": "integer", | |
54 | "ephemeral": true}, | |
55 | "b": {"type": "string"}}, | |
56 | "indexes": [["b", "a"]]}']], | |
57 | [[ephemeral columns (such as a) may not be indexed]]) | |
58 | ||
99155935 | 59 | OVSDB_CHECK_NEGATIVE_CPY([column names may not begin with _], |
f85f8ebb BP |
60 | [[parse-table mytable \ |
61 | '{"columns": {"_column": {"type": "integer"}}}']], | |
62 | [[names beginning with "_" are reserved]], | |
63 | [table]) | |
64 | ||
99155935 | 65 | OVSDB_CHECK_NEGATIVE_CPY([table must have at least one column (1)], |
f85f8ebb BP |
66 | [[parse-table mytable '{}']], |
67 | [[Parsing table schema for table mytable failed: Required 'columns' member is missing.]]) | |
68 | ||
99155935 | 69 | OVSDB_CHECK_NEGATIVE_CPY([table must have at least one column (2)], |
f85f8ebb BP |
70 | [[parse-table mytable '{"columns": {}}']], |
71 | [[table must have at least one column]]) | |
87ab878c | 72 | |
99155935 | 73 | OVSDB_CHECK_NEGATIVE_CPY([table maxRows must be positive], |
87ab878c BP |
74 | [[parse-table mytable '{"columns": {"name": {"type": "string"}}, |
75 | "maxRows": 0}']], | |
76 | [[syntax "{"columns":{"name":{"type":"string"}},"maxRows":0}": syntax error: maxRows must be at least 1]]) |