1 AT_BANNER([OVSDB -- rows])
3 m4_define([RESERVED_COLUMNS], [["_uuid":["uuid","00000000-0000-0000-0000-000000000000"],"_version":["uuid","00000000-0000-0000-0000-000000000000"]]])
5 OVSDB_CHECK_POSITIVE([row with one string column],
7 '{"columns": {"name": {"type": "string"}}}' \
10 '{"name": "longer string with spaces"}' \
12 [{RESERVED_COLUMNS,"name":"value"}
14 {RESERVED_COLUMNS,"name":""}
16 {RESERVED_COLUMNS,"name":"longer string with spaces"}
18 {RESERVED_COLUMNS,"name":""}
21 OVSDB_CHECK_POSITIVE([row with one integer column],
23 '{"columns": {"count": {"type": "integer"}}}' \
28 [{RESERVED_COLUMNS,"count":1}
30 {RESERVED_COLUMNS,"count":-1}
32 {RESERVED_COLUMNS,"count":20000000000}
34 {RESERVED_COLUMNS,"count":0}
37 OVSDB_CHECK_POSITIVE([row with one real column],
39 '{"columns": {"cost": {"type": "real"}}}' \
44 [{RESERVED_COLUMNS,"cost":1}
46 {RESERVED_COLUMNS,"cost":-2}
48 {RESERVED_COLUMNS,"cost":123000}
50 {RESERVED_COLUMNS,"cost":0}
53 OVSDB_CHECK_POSITIVE([row with one boolean column],
55 '{"columns": {"feasible": {"type": "boolean"}}}' \
56 '{"feasible": true}' \
57 '{"feasible": false}' \
59 [{RESERVED_COLUMNS,"feasible":true}
61 {RESERVED_COLUMNS,"feasible":false}
63 {RESERVED_COLUMNS,"feasible":false}
66 OVSDB_CHECK_POSITIVE([row with one uuid column],
68 '{"columns": {"ref": {"type": "uuid"}}}' \
69 '{"ref": ["uuid", "f707423d-bf5b-48b5-b6c0-797c900ba4b6"]}' \
70 '{"ref": ["uuid", "33583cc5-d2f4-43de-b1ca-8aac14071b51"]}' \
72 [{RESERVED_COLUMNS,"ref":[["uuid","f707423d-bf5b-48b5-b6c0-797c900ba4b6"]]}
74 {RESERVED_COLUMNS,"ref":[["uuid","33583cc5-d2f4-43de-b1ca-8aac14071b51"]]}
76 {RESERVED_COLUMNS,"ref":[["uuid","00000000-0000-0000-0000-000000000000"]]}
79 OVSDB_CHECK_POSITIVE([row with set of 1 to 2 elements],
81 '{"columns": {"myset": {"type": {"key": "integer", "min": 1, "max": 2}}}}' \
83 [{RESERVED_COLUMNS,["myset":0]}
86 OVSDB_CHECK_POSITIVE([row with map of 1 to 2 elements],
88 '{"columns": {"mymap": {"type": {"key": "integer", "value": "uuid", "min": 1, "max": 2}}}}' \
90 [{RESERVED_COLUMNS,["mymap":["map",[[0,["uuid","00000000-0000-0000-0000-000000000000"]]]]]}
93 OVSDB_CHECK_POSITIVE([row with several columns],
96 {"vswitch": {"type": "uuid"},
97 "name": {"type": "string"},
98 "datapath_id": {"type": {"key": "string", "min": 0}},
99 "hwaddr": {"type": "string"},
100 "mirrors": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}},
101 "netflows": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}},
102 "controller": {"type": {"key": "uuid", "min": 0}},
103 "listeners": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}},
104 "snoops": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \
105 '{"vswitch": ["uuid", "1a5c7280-0d4c-4e34-9ec7-c772339f7774"],
107 "datapath_id": "000ae4256bb0",
108 "hwaddr": "00:0a:e4:25:6b:b0"}' \
110 [{RESERVED_COLUMNS,["controller":["set",[]],"datapath_id":"000ae4256bb0","hwaddr":"00:0a:e4:25:6b:b0","listeners":["set",[]],"mirrors":["set",[]],"name":"br0","netflows":["set",[]],"snoops":["set",[]],"vswitch":["uuid","1a5c7280-0d4c-4e34-9ec7-c772339f7774"]]}
111 datapath_id, hwaddr, name, vswitch
112 {RESERVED_COLUMNS,["controller":["set",[]],"datapath_id":["set",[]],"hwaddr":"","listeners":["set",[]],"mirrors":["set",[]],"name":"","netflows":["set",[]],"snoops":["set",[]],"vswitch":["uuid","00000000-0000-0000-0000-000000000000"]]}
115 OVSDB_CHECK_POSITIVE([row hashing (scalars)],
118 {"i": {"type": "integer"},
119 "r": {"type": "real"},
120 "b": {"type": "boolean"},
121 "s": {"type": "string"},
122 "u": {"type": "uuid"}}}' \
128 '["i16", {"i": 16}]' \
129 '["i32", {"i": 32}]' \
130 '["i64", {"i": 64}]' \
131 '["i128", {"i": 128}]' \
132 '["i256", {"i": 256}]' \
133 '["null2", {"r": -0}]' \
134 '["r123", {"r": 123}]' \
135 '["r0.0625", {"r": 0.0625}]' \
136 '["r0.125", {"r": 0.125}]' \
137 '["r0.25", {"r": 0.25}]' \
138 '["r0.5", {"r": 0.5}]' \
143 '["r16", {"r": 16}]' \
144 '["r32", {"r": 32}]' \
145 '["null3", {"b": false}]' \
146 '["b1", {"b": true}]' \
147 '["null4", {"s": ""}]' \
148 '["s0", {"s": "a"}]' \
149 '["s1", {"s": "b"}]' \
150 '["s2", {"s": "c"}]' \
151 '["s3", {"s": "d"}]' \
152 '["s4", {"s": "e"}]' \
153 '["s5", {"s": "f"}]' \
154 '["s6", {"s": "g"}]' \
155 '["s7", {"s": "h"}]' \
156 '["s8", {"s": "i"}]' \
157 '["s9", {"s": "j"}]' \
158 '["null5", {"u": ["uuid","00000000-0000-0000-0000-000000000000"]}]' \
159 '["u1", {"u": ["uuid","10000000-0000-0000-0000-000000000000"]}]' \
160 '["u2", {"u": ["uuid","01000000-0000-0000-0000-000000000000"]}]' \
161 '["u3", {"u": ["uuid","00100000-0000-0000-0000-000000000000"]}]' \
162 '["u4", {"u": ["uuid","00010000-0000-0000-0000-000000000000"]}]' \
163 '["u5", {"u": ["uuid","00001000-0000-0000-0000-000000000000"]}]' \
164 '["u6", {"u": ["uuid","00000100-0000-0000-0000-000000000000"]}]' \
165 '["u7", {"u": ["uuid","00000010-0000-0000-0000-000000000000"]}]' \
166 '["u8", {"u": ["uuid","00000001-0000-0000-0000-000000000000"]}]' \
167 '["null6", {"u": ["uuid","00000000-c6db-4d22-970f-b41fabd20c4b"]}]']],
172 hash(null) == hash(null6)
176 hash(null2) == hash(null6)
179 hash(null3) == hash(null6)
181 hash(null4) == hash(null6)
182 hash(null5) == hash(null6)]])
184 OVSDB_CHECK_POSITIVE([row hashing (sets)],
187 {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}},
188 "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}},
189 "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}},
190 "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}},
191 "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \
192 '["null0", {"i": ["set", []]}]' \
193 '["i0", {"i": ["set", [0]]}]' \
194 '["i01", {"i": ["set", [0, 1]]}]' \
195 '["i012", {"i": ["set", [0, 1, 2]]}]' \
196 '["i021", {"i": ["set", [0, 2, 1]]}]' \
197 '["i201", {"i": ["set", [2, 0, 1]]}]' \
198 '["i102", {"i": ["set", [1, 0, 2]]}]' \
199 '["i120", {"i": ["set", [1, 2, 0]]}]' \
200 '["i210", {"i": ["set", [2, 1, 0]]}]' \
201 '["r0", {"r": ["set", [0]]}]' \
202 '["r01", {"r": ["set", [0, 1]]}]' \
203 '["r012", {"r": ["set", [0, 1, 2]]}]' \
204 '["r201", {"r": ["set", [2, 0, 1]]}]' \
205 '["null1", {"b": ["set", []]}]' \
206 '["b0", {"b": ["set", [false]]}]' \
207 '["b1", {"b": ["set", [true]]}]' \
208 '["b01", {"b": ["set", [false, true]]}]' \
209 '["b10", {"b": ["set", [true, false]]}]' \
210 '["null2", {"s": ["set", []]}]' \
211 '["sa", {"s": ["set", ["a"]]}]' \
212 '["sb", {"s": ["set", ["b"]]}]' \
213 '["sab", {"s": ["set", ["a", "b"]]}]' \
214 '["sba", {"s": ["set", ["b", "a"]]}]']],
237 OVSDB_CHECK_POSITIVE([row hashing (maps)],
240 {"ii": {"type": {"key": "integer", "value": "integer",
241 "min": 0, "max": "unlimited"}},
242 "rr": {"type": {"key": "real", "value": "real",
243 "min": 0, "max": "unlimited"}},
244 "bb": {"type": {"key": "boolean", "value": "boolean",
245 "min": 0, "max": "unlimited"}},
246 "ss": {"type": {"key": "string", "value": "string",
247 "min": 0, "max": "unlimited"}}}}' \
249 '["ii0", {"ii": ["map", [[0, 0]]]}]' \
250 '["ii1", {"ii": ["map", [[0, 1]]]}]' \
251 '["ii00", {"ii": ["map", [[0, 0], [1, 0]]]}]' \
252 '["ii01", {"ii": ["map", [[0, 0], [1, 1]]]}]' \
253 '["ii10", {"ii": ["map", [[0, 1], [1, 0]]]}]' \
254 '["ii11", {"ii": ["map", [[0, 1], [1, 1]]]}]' \
255 '["rr0", {"rr": ["map", [[0, 0]]]}]' \
256 '["rr0", {"rr": ["map", [[0, 1]]]}]' \
257 '["rr00", {"rr": ["map", [[0, 0], [1, 0]]]}]' \
258 '["rr01", {"rr": ["map", [[0, 0], [1, 1]]]}]' \
259 '["rr10", {"rr": ["map", [[0, 1], [1, 0]]]}]' \
260 '["rr11", {"rr": ["map", [[0, 1], [1, 1]]]}]' \
261 '["bb0", {"bb": ["map", [[false, false]]]}]' \
262 '["bb1", {"bb": ["map", [[false, true]]]}]' \
263 '["bb00", {"bb": ["map", [[false, false], [true, false]]]}]' \
264 '["bb01", {"bb": ["map", [[false, false], [true, true]]]}]' \
265 '["bb10", {"bb": ["map", [[false, true], [true, false]]]}]' \
266 '["bb11", {"bb": ["map", [[false, true], [true, true]]]}]' \
267 '["ss0", {"ss": ["map", [["a", "a"]]]}]' \
268 '["ss1", {"ss": ["map", [["a", "b"]]]}]' \
269 '["ss00", {"ss": ["map", [["a", "a"], ["b", "a"]]]}]' \
270 '["ss01", {"ss": ["map", [["a", "a"], ["b", "b"]]]}]' \
271 '["ss10", {"ss": ["map", [["a", "b"], ["b", "a"]]]}]' \
272 '["ss11", {"ss": ["map", [["a", "b"], ["b", "b"]]]}]'; echo