]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ovsdb-schema.at
ofp-actions: Only set defined bits when encoding "load" actions.
[mirror_ovs.git] / tests / ovsdb-schema.at
CommitLineData
0d0f05b9
BP
1AT_BANNER([OVSDB -- schemas])
2
99155935 3OVSDB_CHECK_POSITIVE_CPY([schema with valid refTables],
0d0f05b9
BP
4 [[parse-schema \
5 '{"name": "mydb",
8159b984 6 "version": "4.2.1",
0d0f05b9
BP
7 "tables": {
8 "a": {
9 "columns": {
10 "map": {
11 "type": {
12 "key": {
13 "type": "uuid",
14 "refTable": "b"},
15 "value": {
16 "type": "uuid",
17 "refTable": "a"}}}}},
18 "b": {
19 "columns": {
20 "aRef": {
21 "type": {
22 "key": {
23 "type": "uuid",
24 "refTable": "a"}}}}}}}']],
8159b984 25 [[{"name":"mydb","tables":{"a":{"columns":{"map":{"type":{"key":{"refTable":"b","type":"uuid"},"value":{"refTable":"a","type":"uuid"}}}}},"b":{"columns":{"aRef":{"type":{"key":{"refTable":"a","type":"uuid"}}}}}},"version":"4.2.1"}]])
42a49b96
BP
26
27dnl Ephemeral strong references to root set tables are OK.
28dnl Ephemeral strong references to non-root set tables are forced to be
29dnl persistent.
30OVSDB_CHECK_POSITIVE_CPY([schema with ephemeral strong references],
31 [[parse-schema \
32 '{"name": "mydb",
33 "version": "4.2.1",
34 "tables": {
35 "a": {
36 "columns": {
37 "x": {
38 "type": {
39 "key": {
40 "type": "uuid",
41 "refTable": "b"}},
42 "ephemeral": true},
43 "y": {
44 "type": {
45 "key": {
46 "type": "uuid",
47 "refTable": "a"}},
48 "ephemeral": true}}},
49 "b": {
50 "columns": {
51 "aRef": {
52 "type": {
53 "key": {
54 "type": "uuid",
55 "refTable": "a"}}}},
56 "isRoot": true}}}']],
57 [[{"name":"mydb","tables":{"a":{"columns":{"x":{"ephemeral":true,"type":{"key":{"refTable":"b","type":"uuid"}}},"y":{"type":{"key":{"refTable":"a","type":"uuid"}}}}},"b":{"columns":{"aRef":{"type":{"key":{"refTable":"a","type":"uuid"}}}},"isRoot":true}},"version":"4.2.1"}]])
8159b984
BP
58
59dnl Schemas without version numbers are accepted for backward
60dnl compatibility, but this is a deprecated feature.
61OVSDB_CHECK_POSITIVE_CPY([schema without version number],
62 [[parse-schema \
63 '{"name": "mydb",
64 "tables": {
65 "x": {
66 "columns": {
67 "y": {
68 "type": "integer"}}}}}']],
69 [{"name":"mydb","tables":{"x":{"columns":{"y":{"type":"integer"}}}}}])
0d0f05b9 70
99155935 71OVSDB_CHECK_NEGATIVE_CPY([schema with invalid refTables],
0d0f05b9
BP
72 [[parse-schema \
73 '{"name": "mydb",
74 "tables": {
75 "a": {
76 "columns": {
77 "map": {
78 "type": {
79 "key": {
80 "type": "uuid",
81 "refTable": "c"},
82 "value": {
83 "type": "uuid",
84 "refTable": "a"}}}}},
85 "b": {
86 "columns": {
87 "aRef": {
88 "type": {
89 "key": {
90 "type": "uuid",
91 "refTable": "a"}}}}}}}']],
99155935 92 [[syntax error: column map key refers to undefined table c]])
8159b984
BP
93
94OVSDB_CHECK_NEGATIVE_CPY([schema with invalid version number],
95 [[parse-schema \
96 '{"name": "mydb",
97 "tables": {
98 "x": {
99 "columns": {
100 "y": {
101 "type": "integer"}}}},
102 "version": "xxx"}']],
103 [[schema version "xxx" not in format x.y.z]])