]> git.proxmox.com Git - mirror_ovs.git/blob - tests/ovsdb-table.at
netdev-afxdp: Add interrupt mode netdev class.
[mirror_ovs.git] / tests / ovsdb-table.at
1 AT_BANNER([OVSDB -- tables])
2
3 OVSDB_CHECK_POSITIVE_CPY([non-root table with one column],
4 [[parse-table mytable '{"columns": {"name": {"type": "string"}}}']],
5 [[{"columns":{"name":{"type":"string"}}}]])
6
7 OVSDB_CHECK_POSITIVE_CPY([immutable table with one column],
8 [[parse-table mytable \
9 '{"columns": {"name": {"type": "string"}},
10 "mutable": false}']],
11 [[{"columns":{"name":{"type":"string"}},"mutable":false}]])
12
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
29 OVSDB_CHECK_POSITIVE_CPY([table with maxRows of 2],
30 [[parse-table mytable '{"columns": {"name": {"type": "string"}},
31 "maxRows": 2}']],
32 [[{"columns":{"name":{"type":"string"}},"maxRows":2}]])
33
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
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]],
63 [table])
64
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.]])
68
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]])
72
73 OVSDB_CHECK_NEGATIVE_CPY([table maxRows must be positive],
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]])