]>
Commit | Line | Data |
---|---|---|
f85f8ebb BP |
1 | AT_BANNER([OVSDB -- conditions]) |
2 | ||
3 | OVSDB_CHECK_POSITIVE([null condition], | |
4 | [[parse-conditions \ | |
5 | '{"columns": {"name": {"type": "string"}}}' \ | |
6 | '[]']], | |
7 | [[[]]]) | |
8 | ||
9 | OVSDB_CHECK_POSITIVE([conditions on scalars], | |
10 | [[parse-conditions \ | |
11 | '{"columns": | |
12 | {"i": {"type": "integer"}, | |
13 | "r": {"type": "real"}, | |
14 | "b": {"type": "boolean"}, | |
15 | "s": {"type": "string"}, | |
16 | "u": {"type": "uuid"}}}' \ | |
17 | '[["i", "==", 0]]' \ | |
18 | '[["i", "!=", 1]]' \ | |
19 | '[["i", "<", 2]]' \ | |
20 | '[["i", "<=", 3]]' \ | |
21 | '[["i", ">", 4]]' \ | |
22 | '[["i", ">=", 5]]' \ | |
23 | '[["i", "includes", 6]]' \ | |
24 | '[["i", "excludes", 7]]' \ | |
25 | '[["r", "==", 0.5]]' \ | |
26 | '[["r", "!=", 1.5]]' \ | |
27 | '[["r", "<", 2.5]]' \ | |
28 | '[["r", "<=", 3.5]]' \ | |
29 | '[["r", ">", 4.5]]' \ | |
30 | '[["r", ">=", 5.5]]' \ | |
31 | '[["r", "includes", 6.5]]' \ | |
32 | '[["r", "excludes", 7.5]]' \ | |
33 | '[["b", "==", true]]' \ | |
34 | '[["b", "!=", false]]' \ | |
35 | '[["b", "includes", false]]' \ | |
36 | '[["b", "excludes", true]]' \ | |
37 | '[["s", "==", "a"]]' \ | |
38 | '[["s", "!=", "b"]]' \ | |
39 | '[["s", "includes", "c"]]' \ | |
40 | '[["s", "excludes", "d"]]' \ | |
41 | '[["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \ | |
42 | '[["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ | |
43 | '[["u", "includes", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \ | |
44 | '[["u", "excludes", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']], | |
45 | [[[["i","==",0]] | |
46 | [["i","!=",1]] | |
47 | [["i","<",2]] | |
48 | [["i","<=",3]] | |
49 | [["i",">",4]] | |
50 | [["i",">=",5]] | |
51 | [["i","includes",6]] | |
52 | [["i","excludes",7]] | |
53 | [["r","==",0.5]] | |
54 | [["r","!=",1.5]] | |
55 | [["r","<",2.5]] | |
56 | [["r","<=",3.5]] | |
57 | [["r",">",4.5]] | |
58 | [["r",">=",5.5]] | |
59 | [["r","includes",6.5]] | |
60 | [["r","excludes",7.5]] | |
61 | [["b","==",true]] | |
62 | [["b","!=",false]] | |
63 | [["b","includes",false]] | |
64 | [["b","excludes",true]] | |
65 | [["s","==","a"]] | |
66 | [["s","!=","b"]] | |
67 | [["s","includes","c"]] | |
68 | [["s","excludes","d"]] | |
69 | [["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]] | |
70 | [["u","!=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]] | |
71 | [["u","includes",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]] | |
72 | [["u","excludes",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]]]], | |
73 | [condition]) | |
74 | ||
75 | AT_SETUP([disallowed conditions on scalars]) | |
76 | AT_KEYWORDS([ovsdb negative condition]) | |
7c126fbb | 77 | AT_CHECK([[test-ovsdb parse-conditions \ |
f85f8ebb BP |
78 | '{"columns": |
79 | {"i": {"type": "integer"}, | |
80 | "r": {"type": "real"}, | |
81 | "b": {"type": "boolean"}, | |
82 | "s": {"type": "string"}, | |
83 | "u": {"type": "uuid"}}}' \ | |
84 | '[["b", ">", true]]' \ | |
85 | '[["b", ">=", false]]' \ | |
86 | '[["b", "<", false]]' \ | |
87 | '[["b", "<=", false]]' \ | |
88 | '[["s", ">", "a"]]' \ | |
89 | '[["s", ">=", "b"]]' \ | |
90 | '[["s", "<", "c"]]' \ | |
91 | '[["s", "<=", "d"]]' \ | |
92 | '[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \ | |
93 | '[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ | |
94 | '[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \ | |
95 | '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']], | |
96 | [1], [], | |
97 | [[test-ovsdb: syntax "["b",">",true]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean. | |
98 | test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean. | |
99 | test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean. | |
100 | test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean. | |
101 | test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string. | |
102 | test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string. | |
103 | test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string. | |
104 | test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string. | |
105 | test-ovsdb: syntax "["u",">",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid. | |
106 | test-ovsdb: syntax "["u",">=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid. | |
107 | test-ovsdb: syntax "["u","<",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid. | |
108 | test-ovsdb: syntax "["u","<=",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type uuid. | |
109 | ]]) | |
110 | AT_CLEANUP | |
111 | ||
112 | OVSDB_CHECK_POSITIVE([conditions on sets], | |
113 | [[parse-conditions \ | |
114 | '{"columns": | |
115 | {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}, | |
116 | "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}}, | |
117 | "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}, | |
118 | "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}, | |
119 | "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ | |
120 | '[["i", "==", ["set", []]]]' \ | |
121 | '[["i", "!=", ["set", [1]]]]' \ | |
122 | '[["i", "includes", ["set", [1, 2]]]]' \ | |
123 | '[["i", "excludes", ["set", [1, 2, 3]]]]' \ | |
124 | '[["r", "==", ["set", []]]]' \ | |
125 | '[["r", "!=", ["set", [1.5]]]]' \ | |
126 | '[["r", "includes", ["set", [1.5, 2.5]]]]' \ | |
127 | '[["r", "excludes", ["set", [1.5, 2.5, 3.5]]]]' \ | |
128 | '[["b", "==", ["set", [true]]]]' \ | |
129 | '[["b", "!=", ["set", [false]]]]' \ | |
130 | '[["b", "includes", ["set", [false]]]]' \ | |
131 | '[["b", "excludes", ["set", [true, false]]]]' \ | |
132 | '[["s", "==", ["set", ["a"]]]]' \ | |
133 | '[["s", "!=", ["set", ["a", "b"]]]]' \ | |
134 | '[["s", "includes", ["set", ["c"]]]]' \ | |
135 | '[["s", "excludes", ["set", ["c", "d"]]]]' \ | |
136 | '[["u", "==", | |
137 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]' \ | |
138 | '[["u", "==", | |
139 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], | |
140 | ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]]]' \ | |
141 | '[["u", "includes", | |
142 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], | |
143 | ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"], | |
144 | ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]]' \ | |
145 | '[["u", "excludes", | |
146 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], | |
147 | ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"], | |
148 | ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"], | |
149 | ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]]]' \ | |
150 | ]], | |
151 | [[[["i","==",["set",[]]]] | |
ae8f13e2 | 152 | [["i","!=",1]] |
f85f8ebb BP |
153 | [["i","includes",["set",[1,2]]]] |
154 | [["i","excludes",["set",[1,2,3]]]] | |
155 | [["r","==",["set",[]]]] | |
ae8f13e2 | 156 | [["r","!=",1.5]] |
f85f8ebb BP |
157 | [["r","includes",["set",[1.5,2.5]]]] |
158 | [["r","excludes",["set",[1.5,2.5,3.5]]]] | |
ae8f13e2 BP |
159 | [["b","==",true]] |
160 | [["b","!=",false]] | |
161 | [["b","includes",false]] | |
f85f8ebb | 162 | [["b","excludes",["set",[false,true]]]] |
ae8f13e2 | 163 | [["s","==","a"]] |
f85f8ebb | 164 | [["s","!=",["set",["a","b"]]]] |
ae8f13e2 | 165 | [["s","includes","c"]] |
f85f8ebb | 166 | [["s","excludes",["set",["c","d"]]]] |
ae8f13e2 | 167 | [["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]] |
f85f8ebb BP |
168 | [["u","==",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]] |
169 | [["u","includes",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]] | |
170 | [["u","excludes",["set",[["uuid","62315898-64e0-40b9-b26f-ff74225303e6"],["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]]], | |
171 | [condition]) | |
172 | ||
173 | OVSDB_CHECK_POSITIVE([condition sorting], | |
174 | [[parse-conditions \ | |
175 | '{"columns": {"i": {"type": "integer"}}}' \ | |
176 | '[["i", "excludes", 7], | |
177 | ["i", "!=", 8], | |
178 | ["i", "==", 1], | |
179 | ["i", "includes", 2], | |
180 | ["i", "<=", 3], | |
181 | ["i", "<", 4], | |
182 | ["i", ">", 6], | |
183 | ["i", ">=", 5], | |
184 | ["_uuid", "==", ["uuid", "d50e85c6-8ae7-4b16-b69e-4395928bd9be"]]]']], | |
185 | [[[["_uuid","==",["uuid","d50e85c6-8ae7-4b16-b69e-4395928bd9be"]],["i","==",1],["i","includes",2],["i","<=",3],["i","<",4],["i",">=",5],["i",">",6],["i","excludes",7],["i","!=",8]]]]) | |
186 | ||
187 | OVSDB_CHECK_POSITIVE([evaluating null condition], | |
188 | [[evaluate-conditions \ | |
189 | '{"columns": {"i": {"type": "integer"}}}' \ | |
190 | '[[]]' \ | |
191 | '[{"i": 0}, | |
192 | {"i": 1}, | |
193 | {"i": 2}']]], | |
194 | [condition 0: TTT]) | |
195 | ||
196 | OVSDB_CHECK_POSITIVE([evaluating conditions on integers], | |
197 | [[evaluate-conditions \ | |
198 | '{"columns": {"i": {"type": "integer"}}}' \ | |
199 | '[[["i", "<", 1]], | |
200 | [["i", "<=", 1]], | |
201 | [["i", "==", 1]], | |
202 | [["i", "!=", 1]], | |
203 | [["i", ">=", 1]], | |
204 | [["i", ">", 1]], | |
205 | [["i", "includes", 1]], | |
206 | [["i", "excludes", 1]]]' \ | |
207 | '[{"i": 0}, | |
208 | {"i": 1}, | |
209 | {"i": 2}']]], | |
210 | [condition 0: T-- | |
211 | condition 1: TT- | |
212 | condition 2: -T- | |
213 | condition 3: T-T | |
214 | condition 4: -TT | |
215 | condition 5: --T | |
216 | condition 6: -T- | |
217 | condition 7: T-T], [condition]) | |
218 | ||
219 | OVSDB_CHECK_POSITIVE([evaluating conditions on reals], | |
220 | [[evaluate-conditions \ | |
221 | '{"columns": {"r": {"type": "real"}}}' \ | |
222 | '[[["r", "<", 5.0]], | |
223 | [["r", "<=", 5.0]], | |
224 | [["r", "==", 5.0]], | |
225 | [["r", "!=", 5.0]], | |
226 | [["r", ">=", 5.0]], | |
227 | [["r", ">", 5.0]], | |
228 | [["r", "includes", 5.0]], | |
229 | [["r", "excludes", 5.0]]]' \ | |
230 | '[{"r": 0}, | |
231 | {"r": 5.0}, | |
232 | {"r": 5.1}']]], | |
233 | [condition 0: T-- | |
234 | condition 1: TT- | |
235 | condition 2: -T- | |
236 | condition 3: T-T | |
237 | condition 4: -TT | |
238 | condition 5: --T | |
239 | condition 6: -T- | |
240 | condition 7: T-T], [condition]) | |
241 | ||
242 | OVSDB_CHECK_POSITIVE([evaluating conditions on booleans], | |
243 | [[evaluate-conditions \ | |
244 | '{"columns": {"b": {"type": "boolean"}}}' \ | |
245 | '[[["b", "==", true]], | |
246 | [["b", "!=", true]], | |
247 | [["b", "includes", true]], | |
248 | [["b", "excludes", true]], | |
249 | [["b", "==", false]], | |
250 | [["b", "!=", false]], | |
251 | [["b", "includes", false]], | |
252 | [["b", "excludes", false]]]' \ | |
253 | '[{"b": true}, | |
254 | {"b": false}']]], | |
255 | [condition 0: T- | |
256 | condition 1: -T | |
257 | condition 2: T- | |
258 | condition 3: -T | |
259 | condition 4: -T | |
260 | condition 5: T- | |
261 | condition 6: -T | |
262 | condition 7: T-], [condition]) | |
263 | ||
264 | OVSDB_CHECK_POSITIVE([evaluating conditions on strings], | |
265 | [[evaluate-conditions \ | |
266 | '{"columns": {"s": {"type": "string"}}}' \ | |
267 | '[[["s", "==", ""]], | |
268 | [["s", "!=", ""]], | |
269 | [["s", "includes", ""]], | |
270 | [["s", "excludes", ""]], | |
271 | [["s", "==", "foo"]], | |
272 | [["s", "!=", "foo"]], | |
273 | [["s", "includes", "foo"]], | |
274 | [["s", "excludes", "foo"]]]' \ | |
275 | '[{"s": ""}, | |
276 | {"s": "foo"}, | |
277 | {"s": "xxx"}']]], | |
278 | [condition 0: T-- | |
279 | condition 1: -TT | |
280 | condition 2: T-- | |
281 | condition 3: -TT | |
282 | condition 4: -T- | |
283 | condition 5: T-T | |
284 | condition 6: -T- | |
285 | condition 7: T-T], [condition]) | |
286 | ||
287 | OVSDB_CHECK_POSITIVE([evaluating conditions on UUIDs], | |
288 | [[evaluate-conditions \ | |
289 | '{"columns": {"u": {"type": "uuid"}}}' \ | |
290 | '[[["u", "==", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
291 | [["u", "!=", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
292 | [["u", "includes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
293 | [["u", "excludes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
294 | [["u", "==", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], | |
295 | [["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], | |
296 | [["u", "includes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], | |
297 | [["u", "excludes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]]]' \ | |
298 | '[{"u": ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]}, | |
299 | {"u": ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]}, | |
300 | {"u": ["uuid", "00000000-0000-0000-0000-000000000000"]}']]], | |
301 | [condition 0: T-- | |
302 | condition 1: -TT | |
303 | condition 2: T-- | |
304 | condition 3: -TT | |
305 | condition 4: -T- | |
306 | condition 5: T-T | |
307 | condition 6: -T- | |
308 | condition 7: T-T], [condition]) | |
309 | ||
310 | OVSDB_CHECK_POSITIVE([evaluating conditions on sets], | |
311 | [[evaluate-conditions \ | |
312 | '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}}}' \ | |
313 | '[[["i", "==", ["set", []]]], | |
314 | [["i", "==", ["set", [0]]]], | |
315 | [["i", "==", ["set", [1]]]], | |
316 | [["i", "==", ["set", [0, 1]]]], | |
317 | [["i", "==", ["set", [2]]]], | |
318 | [["i", "==", ["set", [2, 0]]]], | |
319 | [["i", "==", ["set", [2, 1]]]], | |
320 | [["i", "==", ["set", [2, 1, 0]]]], | |
321 | [["i", "!=", ["set", []]]], | |
322 | [["i", "!=", ["set", [0]]]], | |
323 | [["i", "!=", ["set", [1]]]], | |
324 | [["i", "!=", ["set", [0, 1]]]], | |
325 | [["i", "!=", ["set", [2]]]], | |
326 | [["i", "!=", ["set", [2, 0]]]], | |
327 | [["i", "!=", ["set", [2, 1]]]], | |
328 | [["i", "!=", ["set", [2, 1, 0]]]], | |
329 | [["i", "includes", ["set", []]]], | |
330 | [["i", "includes", ["set", [0]]]], | |
331 | [["i", "includes", ["set", [1]]]], | |
332 | [["i", "includes", ["set", [0, 1]]]], | |
333 | [["i", "includes", ["set", [2]]]], | |
334 | [["i", "includes", ["set", [2, 0]]]], | |
335 | [["i", "includes", ["set", [2, 1]]]], | |
336 | [["i", "includes", ["set", [2, 1, 0]]]], | |
337 | [["i", "excludes", ["set", []]]], | |
338 | [["i", "excludes", ["set", [0]]]], | |
339 | [["i", "excludes", ["set", [1]]]], | |
340 | [["i", "excludes", ["set", [0, 1]]]], | |
341 | [["i", "excludes", ["set", [2]]]], | |
342 | [["i", "excludes", ["set", [2, 0]]]], | |
343 | [["i", "excludes", ["set", [2, 1]]]], | |
344 | [["i", "excludes", ["set", [2, 1, 0]]]]]' \ | |
345 | '[{"i": ["set", []]}, | |
346 | {"i": ["set", [0]]}, | |
347 | {"i": ["set", [1]]}, | |
348 | {"i": ["set", [0, 1]]}, | |
349 | {"i": ["set", [2]]}, | |
350 | {"i": ["set", [2, 0]]}, | |
351 | {"i": ["set", [2, 1]]}, | |
352 | {"i": ["set", [2, 1, 0]]}]']], | |
353 | [dnl | |
354 | condition 0: T---- --- | |
355 | condition 1: -T--- --- | |
356 | condition 2: --T-- --- | |
357 | condition 3: ---T- --- | |
358 | condition 4: ----T --- | |
359 | condition 5: ----- T-- | |
360 | condition 6: ----- -T- | |
361 | condition 7: ----- --T | |
362 | condition 8: -TTTT TTT | |
363 | condition 9: T-TTT TTT | |
364 | condition 10: TT-TT TTT | |
365 | condition 11: TTT-T TTT | |
366 | condition 12: TTTT- TTT | |
367 | condition 13: TTTTT -TT | |
368 | condition 14: TTTTT T-T | |
369 | condition 15: TTTTT TT- | |
370 | condition 16: TTTTT TTT | |
371 | condition 17: -T-T- T-T | |
372 | condition 18: --TT- -TT | |
373 | condition 19: ---T- --T | |
374 | condition 20: ----T TTT | |
375 | condition 21: ----- T-T | |
376 | condition 22: ----- -TT | |
377 | condition 23: ----- --T | |
378 | condition 24: TTTTT TTT | |
379 | condition 25: T-T-T -T- | |
380 | condition 26: TT--T T-- | |
381 | condition 27: T---T --- | |
382 | condition 28: TTTT- --- | |
383 | condition 29: T-T-- --- | |
384 | condition 30: TT--- --- | |
385 | condition 31: T---- ---], [condition]) | |
386 | ||
387 | # This is the same as the "set" test except that it adds values, | |
388 | # all of which always match. | |
389 | OVSDB_CHECK_POSITIVE([evaluating conditions on maps (1)], | |
390 | [[evaluate-conditions \ | |
391 | '{"columns": {"i": {"type": {"key": "integer", | |
392 | "value": "boolean", | |
393 | "min": 0, | |
394 | "max": "unlimited"}}}}' \ | |
395 | '[[["i", "==", ["map", []]]], | |
396 | [["i", "==", ["map", [[0, true]]]]], | |
397 | [["i", "==", ["map", [[1, false]]]]], | |
398 | [["i", "==", ["map", [[0, true], [1, false]]]]], | |
399 | [["i", "==", ["map", [[2, true]]]]], | |
400 | [["i", "==", ["map", [[2, true], [0, true]]]]], | |
401 | [["i", "==", ["map", [[2, true], [1, false]]]]], | |
402 | [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], | |
403 | [["i", "!=", ["map", []]]], | |
404 | [["i", "!=", ["map", [[0, true]]]]], | |
405 | [["i", "!=", ["map", [[1, false]]]]], | |
406 | [["i", "!=", ["map", [[0, true], [1, false]]]]], | |
407 | [["i", "!=", ["map", [[2, true]]]]], | |
408 | [["i", "!=", ["map", [[2, true], [0, true]]]]], | |
409 | [["i", "!=", ["map", [[2, true], [1, false]]]]], | |
410 | [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], | |
411 | [["i", "includes", ["map", []]]], | |
412 | [["i", "includes", ["map", [[0, true]]]]], | |
413 | [["i", "includes", ["map", [[1, false]]]]], | |
414 | [["i", "includes", ["map", [[0, true], [1, false]]]]], | |
415 | [["i", "includes", ["map", [[2, true]]]]], | |
416 | [["i", "includes", ["map", [[2, true], [0, true]]]]], | |
417 | [["i", "includes", ["map", [[2, true], [1, false]]]]], | |
418 | [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], | |
419 | [["i", "excludes", ["map", []]]], | |
420 | [["i", "excludes", ["map", [[0, true]]]]], | |
421 | [["i", "excludes", ["map", [[1, false]]]]], | |
422 | [["i", "excludes", ["map", [[0, true], [1, false]]]]], | |
423 | [["i", "excludes", ["map", [[2, true]]]]], | |
424 | [["i", "excludes", ["map", [[2, true], [0, true]]]]], | |
425 | [["i", "excludes", ["map", [[2, true], [1, false]]]]], | |
426 | [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]]]' \ | |
427 | '[{"i": ["map", []]}, | |
428 | {"i": ["map", [[0, true]]]}, | |
429 | {"i": ["map", [[1, false]]]}, | |
430 | {"i": ["map", [[0, true], [1, false]]]}, | |
431 | {"i": ["map", [[2, true]]]}, | |
432 | {"i": ["map", [[2, true], [0, true]]]}, | |
433 | {"i": ["map", [[2, true], [1, false]]]}, | |
434 | {"i": ["map", [[2, true], [1, false], [0, true]]]}]']], | |
435 | [dnl | |
436 | condition 0: T---- --- | |
437 | condition 1: -T--- --- | |
438 | condition 2: --T-- --- | |
439 | condition 3: ---T- --- | |
440 | condition 4: ----T --- | |
441 | condition 5: ----- T-- | |
442 | condition 6: ----- -T- | |
443 | condition 7: ----- --T | |
444 | condition 8: -TTTT TTT | |
445 | condition 9: T-TTT TTT | |
446 | condition 10: TT-TT TTT | |
447 | condition 11: TTT-T TTT | |
448 | condition 12: TTTT- TTT | |
449 | condition 13: TTTTT -TT | |
450 | condition 14: TTTTT T-T | |
451 | condition 15: TTTTT TT- | |
452 | condition 16: TTTTT TTT | |
453 | condition 17: -T-T- T-T | |
454 | condition 18: --TT- -TT | |
455 | condition 19: ---T- --T | |
456 | condition 20: ----T TTT | |
457 | condition 21: ----- T-T | |
458 | condition 22: ----- -TT | |
459 | condition 23: ----- --T | |
460 | condition 24: TTTTT TTT | |
461 | condition 25: T-T-T -T- | |
462 | condition 26: TT--T T-- | |
463 | condition 27: T---T --- | |
464 | condition 28: TTTT- --- | |
465 | condition 29: T-T-- --- | |
466 | condition 30: TT--- --- | |
467 | condition 31: T---- ---], [condition]) | |
468 | ||
469 | # This is the same as the "set" test except that it adds values, | |
470 | # and those values don't always match. | |
471 | OVSDB_CHECK_POSITIVE([evaluating conditions on maps (2)], | |
472 | [[evaluate-conditions \ | |
473 | '{"columns": {"i": {"type": {"key": "integer", | |
474 | "value": "boolean", | |
475 | "min": 0, | |
476 | "max": "unlimited"}}}}' \ | |
477 | '[[["i", "==", ["map", []]]], | |
478 | [["i", "==", ["map", [[0, true]]]]], | |
479 | [["i", "==", ["map", [[1, false]]]]], | |
480 | [["i", "==", ["map", [[0, true], [1, false]]]]], | |
481 | [["i", "==", ["map", [[2, true]]]]], | |
482 | [["i", "==", ["map", [[2, true], [0, true]]]]], | |
483 | [["i", "==", ["map", [[2, true], [1, false]]]]], | |
484 | [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], | |
485 | [["i", "!=", ["map", []]]], | |
486 | [["i", "!=", ["map", [[0, true]]]]], | |
487 | [["i", "!=", ["map", [[1, false]]]]], | |
488 | [["i", "!=", ["map", [[0, true], [1, false]]]]], | |
489 | [["i", "!=", ["map", [[2, true]]]]], | |
490 | [["i", "!=", ["map", [[2, true], [0, true]]]]], | |
491 | [["i", "!=", ["map", [[2, true], [1, false]]]]], | |
492 | [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], | |
493 | [["i", "includes", ["map", []]]], | |
494 | [["i", "includes", ["map", [[0, true]]]]], | |
495 | [["i", "includes", ["map", [[1, false]]]]], | |
496 | [["i", "includes", ["map", [[0, true], [1, false]]]]], | |
497 | [["i", "includes", ["map", [[2, true]]]]], | |
498 | [["i", "includes", ["map", [[2, true], [0, true]]]]], | |
499 | [["i", "includes", ["map", [[2, true], [1, false]]]]], | |
500 | [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], | |
501 | [["i", "excludes", ["map", []]]], | |
502 | [["i", "excludes", ["map", [[0, true]]]]], | |
503 | [["i", "excludes", ["map", [[1, false]]]]], | |
504 | [["i", "excludes", ["map", [[0, true], [1, false]]]]], | |
505 | [["i", "excludes", ["map", [[2, true]]]]], | |
506 | [["i", "excludes", ["map", [[2, true], [0, true]]]]], | |
507 | [["i", "excludes", ["map", [[2, true], [1, false]]]]], | |
508 | [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]]]' \ | |
509 | '[{"i": ["map", []]}, | |
510 | {"i": ["map", [[0, true]]]}, | |
511 | {"i": ["map", [[0, false]]]}, | |
512 | {"i": ["map", [[1, false]]]}, | |
513 | {"i": ["map", [[1, true]]]}, | |
514 | ||
515 | {"i": ["map", [[0, true], [1, false]]]}, | |
516 | {"i": ["map", [[0, true], [1, true]]]}, | |
517 | {"i": ["map", [[2, true]]]}, | |
518 | {"i": ["map", [[2, false]]]}, | |
519 | {"i": ["map", [[2, true], [0, true]]]}, | |
520 | ||
521 | {"i": ["map", [[2, false], [0, true]]]}, | |
522 | {"i": ["map", [[2, true], [1, false]]]}, | |
523 | {"i": ["map", [[2, true], [1, true]]]}, | |
524 | {"i": ["map", [[2, true], [1, false], [0, true]]]}, | |
525 | {"i": ["map", [[2, true], [1, false], [0, false]]]}]']], | |
526 | [dnl | |
527 | condition 0: T---- ----- ----- | |
528 | condition 1: -T--- ----- ----- | |
529 | condition 2: ---T- ----- ----- | |
530 | condition 3: ----- T---- ----- | |
531 | condition 4: ----- --T-- ----- | |
532 | condition 5: ----- ----T ----- | |
533 | condition 6: ----- ----- -T--- | |
534 | condition 7: ----- ----- ---T- | |
535 | condition 8: -TTTT TTTTT TTTTT | |
536 | condition 9: T-TTT TTTTT TTTTT | |
537 | condition 10: TTT-T TTTTT TTTTT | |
538 | condition 11: TTTTT -TTTT TTTTT | |
539 | condition 12: TTTTT TT-TT TTTTT | |
540 | condition 13: TTTTT TTTT- TTTTT | |
541 | condition 14: TTTTT TTTTT T-TTT | |
542 | condition 15: TTTTT TTTTT TTT-T | |
543 | condition 16: TTTTT TTTTT TTTTT | |
544 | condition 17: -T--- TT--T T--T- | |
545 | condition 18: ---T- T---- -T-TT | |
546 | condition 19: ----- T---- ---T- | |
547 | condition 20: ----- --T-T -TTTT | |
548 | condition 21: ----- ----T ---T- | |
549 | condition 22: ----- ----- -T-TT | |
550 | condition 23: ----- ----- ---T- | |
551 | condition 24: TTTTT TTTTT TTTTT | |
552 | condition 25: T-TTT --TT- -TT-T | |
553 | condition 26: TTT-T -TTTT T-T-- | |
554 | condition 27: T-T-T --TT- --T-- | |
555 | condition 28: TTTTT TT-T- T---- | |
556 | condition 29: T-TTT ---T- ----- | |
557 | condition 30: TTT-T -T-T- T---- | |
558 | condition 31: T-T-T ---T- -----], [condition]) |