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