]>
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"}, | |
5a0e4aec | 15 | "s": {"type": "string"}, |
f85f8ebb BP |
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"}, | |
5a0e4aec | 82 | "s": {"type": "string"}, |
f85f8ebb BP |
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"]]]' \ | |
64107d59 BP |
95 | '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' \ |
96 | '[["i", "==", ["set", []]]]' \ | |
97 | '[["i", "!=", ["set", []]]]' \ | |
98 | '[["i", ">", ["set", []]]]' \ | |
99 | '[["i", ">=", ["set", []]]]' \ | |
100 | '[["i", "<", ["set", []]]]' \ | |
101 | '[["i", "<=", ["set", []]]]' \ | |
102 | '[["i", "includes", ["set", []]]]' \ | |
103 | '[["i", "excludes", ["set", []]]]' \ | |
104 | '[["i", ">", ["set", []]]]' \ | |
105 | '[["i", "==", ["set", []]]]' \ | |
106 | '[["r", "==", ["set", []]]]' \ | |
107 | '[["r", "!=", ["set", []]]]' \ | |
108 | '[["r", ">", ["set", []]]]' \ | |
109 | '[["r", ">=", ["set", []]]]' \ | |
110 | '[["r", "<", ["set", []]]]' \ | |
111 | '[["r", "<=", ["set", []]]]' \ | |
112 | '[["r", "includes", ["set", []]]]' \ | |
113 | '[["r", "excludes", ["set", []]]]' \ | |
114 | '[["r", ">", ["set", []]]]' \ | |
115 | '[["r", "==", ["set", []]]]' \ | |
116 | '[["b", "==", ["set", []]]]' \ | |
117 | '[["b", "!=", ["set", []]]]' \ | |
118 | '[["b", ">", ["set", []]]]' \ | |
119 | '[["b", ">=", ["set", []]]]' \ | |
120 | '[["b", "<", ["set", []]]]' \ | |
121 | '[["b", "<=", ["set", []]]]' \ | |
122 | '[["b", "includes", ["set", []]]]' \ | |
123 | '[["b", "excludes", ["set", []]]]' \ | |
124 | '[["b", ">", ["set", []]]]' \ | |
125 | '[["b", "==", ["set", []]]]' \ | |
126 | '[["s", "==", ["set", []]]]' \ | |
127 | '[["s", "!=", ["set", []]]]' \ | |
128 | '[["s", ">", ["set", []]]]' \ | |
129 | '[["s", ">=", ["set", []]]]' \ | |
130 | '[["s", "<", ["set", []]]]' \ | |
131 | '[["s", "<=", ["set", []]]]' \ | |
132 | '[["s", "includes", ["set", []]]]' \ | |
133 | '[["s", "excludes", ["set", []]]]' \ | |
134 | '[["s", ">", ["set", []]]]' \ | |
135 | '[["s", "==", ["set", []]]]' \ | |
136 | '[["u", "==", ["set", []]]]' \ | |
137 | '[["u", "!=", ["set", []]]]' \ | |
138 | '[["u", ">", ["set", []]]]' \ | |
139 | '[["u", ">=", ["set", []]]]' \ | |
140 | '[["u", "<", ["set", []]]]' \ | |
141 | '[["u", "<=", ["set", []]]]' \ | |
142 | '[["u", "includes", ["set", []]]]' \ | |
143 | '[["u", "excludes", ["set", []]]]' \ | |
144 | '[["u", ">", ["set", []]]]' \ | |
145 | '[["u", "==", ["set", []]]]' \ | |
146 | ]], | |
f85f8ebb BP |
147 | [1], [], |
148 | [[test-ovsdb: syntax "["b",">",true]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean. | |
149 | test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean. | |
150 | test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean. | |
151 | test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean. | |
152 | test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string. | |
153 | test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string. | |
154 | test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string. | |
155 | test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string. | |
156 | 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. | |
157 | 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. | |
158 | 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. | |
159 | 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. | |
bc9bbc4e BP |
160 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
161 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
162 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
163 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
164 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
165 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
166 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
167 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
168 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
169 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
170 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
171 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
172 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
173 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
174 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
175 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
176 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
177 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
178 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
179 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
180 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
181 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 BP |
182 | test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean. |
183 | test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean. | |
184 | test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean. | |
185 | test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean. | |
bc9bbc4e BP |
186 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
187 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 | 188 | test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean. |
bc9bbc4e BP |
189 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
190 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
191 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 BP |
192 | test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string. |
193 | test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string. | |
194 | test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string. | |
195 | test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string. | |
bc9bbc4e BP |
196 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
197 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 | 198 | test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string. |
bc9bbc4e BP |
199 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
200 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
201 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 BP |
202 | test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid. |
203 | test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid. | |
204 | test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid. | |
205 | test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type uuid. | |
bc9bbc4e BP |
206 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
207 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 | 208 | test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid. |
bc9bbc4e | 209 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
64107d59 BP |
210 | ]]) |
211 | AT_CLEANUP | |
212 | ||
213 | OVSDB_CHECK_POSITIVE([conditions on optional scalars], | |
214 | [[parse-conditions \ | |
215 | '{"columns": | |
216 | {"i": {"type": {"key": "integer", "min": 0, "max": 1}}, | |
217 | "r": {"type": {"key": "real", "min": 0, "max": 1}}, | |
218 | "b": {"type": {"key": "boolean", "min": 0, "max": 1}}, | |
219 | "s": {"type": {"key": "string", "min": 0, "max": 1}}, | |
220 | "u": {"type": {"key": "uuid", "min": 0, "max": 1}}}}' \ | |
221 | '[["i", "==", 0]]' \ | |
222 | '[["i", "!=", 1]]' \ | |
223 | '[["i", "<", 2]]' \ | |
224 | '[["i", "<=", 3]]' \ | |
225 | '[["i", ">", 4]]' \ | |
226 | '[["i", ">=", 5]]' \ | |
227 | '[["i", "includes", 6]]' \ | |
228 | '[["i", "excludes", 7]]' \ | |
229 | '[["r", "==", 0.5]]' \ | |
230 | '[["r", "!=", 1.5]]' \ | |
231 | '[["r", "<", 2.5]]' \ | |
232 | '[["r", "<=", 3.5]]' \ | |
233 | '[["r", ">", 4.5]]' \ | |
234 | '[["r", ">=", 5.5]]' \ | |
235 | '[["r", "includes", 6.5]]' \ | |
236 | '[["r", "excludes", 7.5]]' \ | |
237 | '[["b", "==", true]]' \ | |
238 | '[["b", "!=", false]]' \ | |
239 | '[["b", "includes", false]]' \ | |
240 | '[["b", "excludes", true]]' \ | |
241 | '[["s", "==", "a"]]' \ | |
242 | '[["s", "!=", "b"]]' \ | |
243 | '[["s", "includes", "c"]]' \ | |
244 | '[["s", "excludes", "d"]]' \ | |
245 | '[["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \ | |
246 | '[["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ | |
247 | '[["u", "includes", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \ | |
248 | '[["u", "excludes", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']], | |
249 | [[[["i","==",0]] | |
250 | [["i","!=",1]] | |
251 | [["i","<",2]] | |
252 | [["i","<=",3]] | |
253 | [["i",">",4]] | |
254 | [["i",">=",5]] | |
255 | [["i","includes",6]] | |
256 | [["i","excludes",7]] | |
257 | [["r","==",0.5]] | |
258 | [["r","!=",1.5]] | |
259 | [["r","<",2.5]] | |
260 | [["r","<=",3.5]] | |
261 | [["r",">",4.5]] | |
262 | [["r",">=",5.5]] | |
263 | [["r","includes",6.5]] | |
264 | [["r","excludes",7.5]] | |
265 | [["b","==",true]] | |
266 | [["b","!=",false]] | |
267 | [["b","includes",false]] | |
268 | [["b","excludes",true]] | |
269 | [["s","==","a"]] | |
270 | [["s","!=","b"]] | |
271 | [["s","includes","c"]] | |
272 | [["s","excludes","d"]] | |
273 | [["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]] | |
274 | [["u","!=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]] | |
275 | [["u","includes",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]] | |
276 | [["u","excludes",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]]]], | |
277 | [condition]) | |
278 | ||
279 | AT_SETUP([disallowed conditions on optional scalars]) | |
280 | AT_KEYWORDS([ovsdb negative condition]) | |
281 | AT_CHECK([[test-ovsdb parse-conditions \ | |
282 | '{"columns": | |
283 | {"i": {"type": {"key": "integer", "min": 0, "max": 1}}, | |
284 | "r": {"type": {"key": "real", "min": 0, "max": 1}}, | |
285 | "b": {"type": {"key": "boolean", "min": 0, "max": 1}}, | |
286 | "s": {"type": {"key": "string", "min": 0, "max": 1}}, | |
287 | "u": {"type": {"key": "uuid", "min": 0, "max": 1}}}}' \ | |
288 | '[["b", ">", true]]' \ | |
289 | '[["b", ">=", false]]' \ | |
290 | '[["b", "<", false]]' \ | |
291 | '[["b", "<=", false]]' \ | |
292 | '[["s", ">", "a"]]' \ | |
293 | '[["s", ">=", "b"]]' \ | |
294 | '[["s", "<", "c"]]' \ | |
295 | '[["s", "<=", "d"]]' \ | |
296 | '[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \ | |
297 | '[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \ | |
298 | '[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \ | |
299 | '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' \ | |
300 | '[["i", ">", ["set", []]]]' \ | |
301 | '[["i", ">=", ["set", []]]]' \ | |
302 | '[["i", "<", ["set", []]]]' \ | |
303 | '[["i", "<=", ["set", []]]]' \ | |
304 | '[["i", ">", ["set", []]]]' \ | |
305 | '[["r", ">", ["set", []]]]' \ | |
306 | '[["r", ">=", ["set", []]]]' \ | |
307 | '[["r", "<", ["set", []]]]' \ | |
308 | '[["r", "<=", ["set", []]]]' \ | |
309 | '[["r", ">", ["set", []]]]' \ | |
310 | '[["b", ">", ["set", []]]]' \ | |
311 | '[["b", ">=", ["set", []]]]' \ | |
312 | '[["b", "<", ["set", []]]]' \ | |
313 | '[["b", "<=", ["set", []]]]' \ | |
314 | '[["b", ">", ["set", []]]]' \ | |
315 | '[["s", ">", ["set", []]]]' \ | |
316 | '[["s", ">=", ["set", []]]]' \ | |
317 | '[["s", "<", ["set", []]]]' \ | |
318 | '[["s", "<=", ["set", []]]]' \ | |
319 | '[["s", ">", ["set", []]]]' \ | |
320 | '[["u", ">", ["set", []]]]' \ | |
321 | '[["u", ">=", ["set", []]]]' \ | |
322 | '[["u", "<", ["set", []]]]' \ | |
323 | '[["u", "<=", ["set", []]]]' \ | |
324 | '[["u", ">", ["set", []]]]' \ | |
325 | ]], | |
326 | [1], [], [[test-ovsdb: syntax "["b",">",true]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans. | |
327 | test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type set of up to 1 booleans. | |
328 | test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type set of up to 1 booleans. | |
329 | test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type set of up to 1 booleans. | |
330 | test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings. | |
331 | test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type set of up to 1 strings. | |
332 | test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type set of up to 1 strings. | |
333 | test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type set of up to 1 strings. | |
334 | test-ovsdb: syntax "["u",">",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids. | |
335 | test-ovsdb: syntax "["u",">=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type set of up to 1 uuids. | |
336 | test-ovsdb: syntax "["u","<",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type set of up to 1 uuids. | |
337 | test-ovsdb: syntax "["u","<=",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type set of up to 1 uuids. | |
bc9bbc4e BP |
338 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present |
339 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
340 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
341 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
342 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
343 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
344 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
345 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
346 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
347 | test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present | |
64107d59 BP |
348 | test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans. |
349 | test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type set of up to 1 booleans. | |
350 | test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type set of up to 1 booleans. | |
351 | test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type set of up to 1 booleans. | |
352 | test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans. | |
353 | test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings. | |
354 | test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type set of up to 1 strings. | |
355 | test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type set of up to 1 strings. | |
356 | test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type set of up to 1 strings. | |
357 | test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings. | |
358 | test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids. | |
359 | test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type set of up to 1 uuids. | |
360 | test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type set of up to 1 uuids. | |
361 | test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type set of up to 1 uuids. | |
362 | test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids. | |
f85f8ebb BP |
363 | ]]) |
364 | AT_CLEANUP | |
365 | ||
366 | OVSDB_CHECK_POSITIVE([conditions on sets], | |
367 | [[parse-conditions \ | |
368 | '{"columns": | |
369 | {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}, | |
370 | "r": {"type": {"key": "real", "min": 0, "max": "unlimited"}}, | |
371 | "b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}}, | |
5a0e4aec | 372 | "s": {"type": {"key": "string", "min": 0, "max": "unlimited"}}, |
f85f8ebb BP |
373 | "u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \ |
374 | '[["i", "==", ["set", []]]]' \ | |
375 | '[["i", "!=", ["set", [1]]]]' \ | |
376 | '[["i", "includes", ["set", [1, 2]]]]' \ | |
377 | '[["i", "excludes", ["set", [1, 2, 3]]]]' \ | |
378 | '[["r", "==", ["set", []]]]' \ | |
379 | '[["r", "!=", ["set", [1.5]]]]' \ | |
380 | '[["r", "includes", ["set", [1.5, 2.5]]]]' \ | |
381 | '[["r", "excludes", ["set", [1.5, 2.5, 3.5]]]]' \ | |
382 | '[["b", "==", ["set", [true]]]]' \ | |
383 | '[["b", "!=", ["set", [false]]]]' \ | |
384 | '[["b", "includes", ["set", [false]]]]' \ | |
385 | '[["b", "excludes", ["set", [true, false]]]]' \ | |
386 | '[["s", "==", ["set", ["a"]]]]' \ | |
387 | '[["s", "!=", ["set", ["a", "b"]]]]' \ | |
388 | '[["s", "includes", ["set", ["c"]]]]' \ | |
389 | '[["s", "excludes", ["set", ["c", "d"]]]]' \ | |
390 | '[["u", "==", | |
391 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]' \ | |
392 | '[["u", "==", | |
393 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], | |
394 | ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]]]' \ | |
395 | '[["u", "includes", | |
396 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], | |
397 | ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"], | |
398 | ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]]' \ | |
399 | '[["u", "excludes", | |
400 | ["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"], | |
401 | ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"], | |
402 | ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"], | |
403 | ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]]]' \ | |
404 | ]], | |
405 | [[[["i","==",["set",[]]]] | |
ae8f13e2 | 406 | [["i","!=",1]] |
f85f8ebb BP |
407 | [["i","includes",["set",[1,2]]]] |
408 | [["i","excludes",["set",[1,2,3]]]] | |
409 | [["r","==",["set",[]]]] | |
ae8f13e2 | 410 | [["r","!=",1.5]] |
f85f8ebb BP |
411 | [["r","includes",["set",[1.5,2.5]]]] |
412 | [["r","excludes",["set",[1.5,2.5,3.5]]]] | |
ae8f13e2 BP |
413 | [["b","==",true]] |
414 | [["b","!=",false]] | |
415 | [["b","includes",false]] | |
f85f8ebb | 416 | [["b","excludes",["set",[false,true]]]] |
ae8f13e2 | 417 | [["s","==","a"]] |
f85f8ebb | 418 | [["s","!=",["set",["a","b"]]]] |
ae8f13e2 | 419 | [["s","includes","c"]] |
f85f8ebb | 420 | [["s","excludes",["set",["c","d"]]]] |
ae8f13e2 | 421 | [["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]] |
f85f8ebb BP |
422 | [["u","==",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]] |
423 | [["u","includes",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]] | |
424 | [["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"]]]]]]], | |
425 | [condition]) | |
426 | ||
427 | OVSDB_CHECK_POSITIVE([condition sorting], | |
428 | [[parse-conditions \ | |
429 | '{"columns": {"i": {"type": "integer"}}}' \ | |
430 | '[["i", "excludes", 7], | |
431 | ["i", "!=", 8], | |
432 | ["i", "==", 1], | |
433 | ["i", "includes", 2], | |
434 | ["i", "<=", 3], | |
435 | ["i", "<", 4], | |
436 | ["i", ">", 6], | |
437 | ["i", ">=", 5], | |
438 | ["_uuid", "==", ["uuid", "d50e85c6-8ae7-4b16-b69e-4395928bd9be"]]]']], | |
439 | [[[["_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]]]]) | |
440 | ||
ae9cab37 LS |
441 | OVSDB_CHECK_POSITIVE([boolean condition], |
442 | [[parse-conditions \ | |
443 | '{"columns": {"name": {"type": "string"}}}' \ | |
444 | '[true]']], | |
445 | [[[true]]]) | |
446 | ||
447 | OVSDB_CHECK_POSITIVE([boolean condition], | |
448 | [[parse-conditions \ | |
449 | '{"columns": {"name": {"type": "string"}}}' \ | |
450 | '[false]']], | |
451 | [[[false]]]) | |
452 | ||
f85f8ebb BP |
453 | OVSDB_CHECK_POSITIVE([evaluating null condition], |
454 | [[evaluate-conditions \ | |
455 | '{"columns": {"i": {"type": "integer"}}}' \ | |
456 | '[[]]' \ | |
457 | '[{"i": 0}, | |
458 | {"i": 1}, | |
459 | {"i": 2}']]], | |
460 | [condition 0: TTT]) | |
461 | ||
462 | OVSDB_CHECK_POSITIVE([evaluating conditions on integers], | |
463 | [[evaluate-conditions \ | |
464 | '{"columns": {"i": {"type": "integer"}}}' \ | |
465 | '[[["i", "<", 1]], | |
466 | [["i", "<=", 1]], | |
467 | [["i", "==", 1]], | |
468 | [["i", "!=", 1]], | |
469 | [["i", ">=", 1]], | |
470 | [["i", ">", 1]], | |
471 | [["i", "includes", 1]], | |
40f280c7 BP |
472 | [["i", "excludes", 1]], |
473 | [["i", ">", 0], ["i", "<", 2]]]' \ | |
f85f8ebb BP |
474 | '[{"i": 0}, |
475 | {"i": 1}, | |
476 | {"i": 2}']]], | |
477 | [condition 0: T-- | |
478 | condition 1: TT- | |
479 | condition 2: -T- | |
480 | condition 3: T-T | |
481 | condition 4: -TT | |
482 | condition 5: --T | |
483 | condition 6: -T- | |
40f280c7 BP |
484 | condition 7: T-T |
485 | condition 8: -T-], [condition]) | |
f85f8ebb BP |
486 | |
487 | OVSDB_CHECK_POSITIVE([evaluating conditions on reals], | |
488 | [[evaluate-conditions \ | |
489 | '{"columns": {"r": {"type": "real"}}}' \ | |
490 | '[[["r", "<", 5.0]], | |
491 | [["r", "<=", 5.0]], | |
492 | [["r", "==", 5.0]], | |
493 | [["r", "!=", 5.0]], | |
494 | [["r", ">=", 5.0]], | |
495 | [["r", ">", 5.0]], | |
496 | [["r", "includes", 5.0]], | |
40f280c7 BP |
497 | [["r", "excludes", 5.0]], |
498 | [["r", "!=", 0], ["r", "!=", 5.1]]]' \ | |
f85f8ebb BP |
499 | '[{"r": 0}, |
500 | {"r": 5.0}, | |
501 | {"r": 5.1}']]], | |
502 | [condition 0: T-- | |
503 | condition 1: TT- | |
504 | condition 2: -T- | |
505 | condition 3: T-T | |
506 | condition 4: -TT | |
507 | condition 5: --T | |
508 | condition 6: -T- | |
40f280c7 BP |
509 | condition 7: T-T |
510 | condition 8: -T-], [condition]) | |
f85f8ebb BP |
511 | |
512 | OVSDB_CHECK_POSITIVE([evaluating conditions on booleans], | |
513 | [[evaluate-conditions \ | |
514 | '{"columns": {"b": {"type": "boolean"}}}' \ | |
515 | '[[["b", "==", true]], | |
516 | [["b", "!=", true]], | |
517 | [["b", "includes", true]], | |
518 | [["b", "excludes", true]], | |
519 | [["b", "==", false]], | |
520 | [["b", "!=", false]], | |
521 | [["b", "includes", false]], | |
40f280c7 BP |
522 | [["b", "excludes", false]], |
523 | [["b", "==", true], ["b", "==", false]]]' \ | |
f85f8ebb BP |
524 | '[{"b": true}, |
525 | {"b": false}']]], | |
526 | [condition 0: T- | |
527 | condition 1: -T | |
528 | condition 2: T- | |
529 | condition 3: -T | |
530 | condition 4: -T | |
531 | condition 5: T- | |
532 | condition 6: -T | |
40f280c7 BP |
533 | condition 7: T- |
534 | condition 8: --], [condition]) | |
f85f8ebb BP |
535 | |
536 | OVSDB_CHECK_POSITIVE([evaluating conditions on strings], | |
537 | [[evaluate-conditions \ | |
538 | '{"columns": {"s": {"type": "string"}}}' \ | |
539 | '[[["s", "==", ""]], | |
540 | [["s", "!=", ""]], | |
541 | [["s", "includes", ""]], | |
542 | [["s", "excludes", ""]], | |
543 | [["s", "==", "foo"]], | |
544 | [["s", "!=", "foo"]], | |
545 | [["s", "includes", "foo"]], | |
40f280c7 BP |
546 | [["s", "excludes", "foo"]], |
547 | [["s", "!=", "foo"], ["s", "!=", ""]]]' \ | |
f85f8ebb BP |
548 | '[{"s": ""}, |
549 | {"s": "foo"}, | |
550 | {"s": "xxx"}']]], | |
551 | [condition 0: T-- | |
552 | condition 1: -TT | |
553 | condition 2: T-- | |
554 | condition 3: -TT | |
555 | condition 4: -T- | |
556 | condition 5: T-T | |
557 | condition 6: -T- | |
40f280c7 BP |
558 | condition 7: T-T |
559 | condition 8: --T], [condition]) | |
f85f8ebb BP |
560 | |
561 | OVSDB_CHECK_POSITIVE([evaluating conditions on UUIDs], | |
562 | [[evaluate-conditions \ | |
563 | '{"columns": {"u": {"type": "uuid"}}}' \ | |
564 | '[[["u", "==", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
565 | [["u", "!=", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
566 | [["u", "includes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
567 | [["u", "excludes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]], | |
568 | [["u", "==", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], | |
569 | [["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], | |
570 | [["u", "includes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], | |
40f280c7 BP |
571 | [["u", "excludes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]], |
572 | [["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]], | |
573 | ["u", "!=", ["uuid", "cb160ed6-92a6-4503-a6aa-a09a09e01f0d"]]]]' \ | |
f85f8ebb BP |
574 | '[{"u": ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]}, |
575 | {"u": ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]}, | |
576 | {"u": ["uuid", "00000000-0000-0000-0000-000000000000"]}']]], | |
577 | [condition 0: T-- | |
578 | condition 1: -TT | |
579 | condition 2: T-- | |
580 | condition 3: -TT | |
581 | condition 4: -T- | |
582 | condition 5: T-T | |
583 | condition 6: -T- | |
40f280c7 BP |
584 | condition 7: T-T |
585 | condition 8: T-T], [condition]) | |
f85f8ebb BP |
586 | |
587 | OVSDB_CHECK_POSITIVE([evaluating conditions on sets], | |
588 | [[evaluate-conditions \ | |
589 | '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}}}' \ | |
590 | '[[["i", "==", ["set", []]]], | |
591 | [["i", "==", ["set", [0]]]], | |
592 | [["i", "==", ["set", [1]]]], | |
593 | [["i", "==", ["set", [0, 1]]]], | |
594 | [["i", "==", ["set", [2]]]], | |
595 | [["i", "==", ["set", [2, 0]]]], | |
596 | [["i", "==", ["set", [2, 1]]]], | |
597 | [["i", "==", ["set", [2, 1, 0]]]], | |
598 | [["i", "!=", ["set", []]]], | |
599 | [["i", "!=", ["set", [0]]]], | |
600 | [["i", "!=", ["set", [1]]]], | |
601 | [["i", "!=", ["set", [0, 1]]]], | |
602 | [["i", "!=", ["set", [2]]]], | |
603 | [["i", "!=", ["set", [2, 0]]]], | |
604 | [["i", "!=", ["set", [2, 1]]]], | |
605 | [["i", "!=", ["set", [2, 1, 0]]]], | |
606 | [["i", "includes", ["set", []]]], | |
607 | [["i", "includes", ["set", [0]]]], | |
608 | [["i", "includes", ["set", [1]]]], | |
609 | [["i", "includes", ["set", [0, 1]]]], | |
610 | [["i", "includes", ["set", [2]]]], | |
611 | [["i", "includes", ["set", [2, 0]]]], | |
612 | [["i", "includes", ["set", [2, 1]]]], | |
613 | [["i", "includes", ["set", [2, 1, 0]]]], | |
614 | [["i", "excludes", ["set", []]]], | |
615 | [["i", "excludes", ["set", [0]]]], | |
616 | [["i", "excludes", ["set", [1]]]], | |
617 | [["i", "excludes", ["set", [0, 1]]]], | |
618 | [["i", "excludes", ["set", [2]]]], | |
619 | [["i", "excludes", ["set", [2, 0]]]], | |
620 | [["i", "excludes", ["set", [2, 1]]]], | |
40f280c7 BP |
621 | [["i", "excludes", ["set", [2, 1, 0]]]], |
622 | [["i", "includes", ["set", [0]]], | |
623 | ["i", "includes", ["set", [1]]]]]' \ | |
f85f8ebb BP |
624 | '[{"i": ["set", []]}, |
625 | {"i": ["set", [0]]}, | |
626 | {"i": ["set", [1]]}, | |
627 | {"i": ["set", [0, 1]]}, | |
628 | {"i": ["set", [2]]}, | |
629 | {"i": ["set", [2, 0]]}, | |
630 | {"i": ["set", [2, 1]]}, | |
631 | {"i": ["set", [2, 1, 0]]}]']], | |
632 | [dnl | |
633 | condition 0: T---- --- | |
634 | condition 1: -T--- --- | |
635 | condition 2: --T-- --- | |
636 | condition 3: ---T- --- | |
637 | condition 4: ----T --- | |
638 | condition 5: ----- T-- | |
639 | condition 6: ----- -T- | |
640 | condition 7: ----- --T | |
641 | condition 8: -TTTT TTT | |
642 | condition 9: T-TTT TTT | |
643 | condition 10: TT-TT TTT | |
644 | condition 11: TTT-T TTT | |
645 | condition 12: TTTT- TTT | |
646 | condition 13: TTTTT -TT | |
647 | condition 14: TTTTT T-T | |
648 | condition 15: TTTTT TT- | |
649 | condition 16: TTTTT TTT | |
650 | condition 17: -T-T- T-T | |
651 | condition 18: --TT- -TT | |
652 | condition 19: ---T- --T | |
653 | condition 20: ----T TTT | |
654 | condition 21: ----- T-T | |
655 | condition 22: ----- -TT | |
656 | condition 23: ----- --T | |
657 | condition 24: TTTTT TTT | |
658 | condition 25: T-T-T -T- | |
659 | condition 26: TT--T T-- | |
660 | condition 27: T---T --- | |
661 | condition 28: TTTT- --- | |
662 | condition 29: T-T-- --- | |
663 | condition 30: TT--- --- | |
40f280c7 BP |
664 | condition 31: T---- --- |
665 | condition 32: ---T- --T], [condition]) | |
f85f8ebb BP |
666 | |
667 | # This is the same as the "set" test except that it adds values, | |
668 | # all of which always match. | |
669 | OVSDB_CHECK_POSITIVE([evaluating conditions on maps (1)], | |
670 | [[evaluate-conditions \ | |
671 | '{"columns": {"i": {"type": {"key": "integer", | |
672 | "value": "boolean", | |
673 | "min": 0, | |
674 | "max": "unlimited"}}}}' \ | |
675 | '[[["i", "==", ["map", []]]], | |
676 | [["i", "==", ["map", [[0, true]]]]], | |
677 | [["i", "==", ["map", [[1, false]]]]], | |
678 | [["i", "==", ["map", [[0, true], [1, false]]]]], | |
679 | [["i", "==", ["map", [[2, true]]]]], | |
680 | [["i", "==", ["map", [[2, true], [0, true]]]]], | |
681 | [["i", "==", ["map", [[2, true], [1, false]]]]], | |
682 | [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], | |
683 | [["i", "!=", ["map", []]]], | |
684 | [["i", "!=", ["map", [[0, true]]]]], | |
685 | [["i", "!=", ["map", [[1, false]]]]], | |
686 | [["i", "!=", ["map", [[0, true], [1, false]]]]], | |
687 | [["i", "!=", ["map", [[2, true]]]]], | |
688 | [["i", "!=", ["map", [[2, true], [0, true]]]]], | |
689 | [["i", "!=", ["map", [[2, true], [1, false]]]]], | |
690 | [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], | |
691 | [["i", "includes", ["map", []]]], | |
692 | [["i", "includes", ["map", [[0, true]]]]], | |
693 | [["i", "includes", ["map", [[1, false]]]]], | |
694 | [["i", "includes", ["map", [[0, true], [1, false]]]]], | |
695 | [["i", "includes", ["map", [[2, true]]]]], | |
696 | [["i", "includes", ["map", [[2, true], [0, true]]]]], | |
697 | [["i", "includes", ["map", [[2, true], [1, false]]]]], | |
698 | [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], | |
699 | [["i", "excludes", ["map", []]]], | |
700 | [["i", "excludes", ["map", [[0, true]]]]], | |
701 | [["i", "excludes", ["map", [[1, false]]]]], | |
702 | [["i", "excludes", ["map", [[0, true], [1, false]]]]], | |
703 | [["i", "excludes", ["map", [[2, true]]]]], | |
704 | [["i", "excludes", ["map", [[2, true], [0, true]]]]], | |
705 | [["i", "excludes", ["map", [[2, true], [1, false]]]]], | |
40f280c7 BP |
706 | [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]], |
707 | [["i", "includes", ["map", [[0, true]]]], | |
708 | ["i", "includes", ["map", [[1, false]]]]]]' \ | |
f85f8ebb BP |
709 | '[{"i": ["map", []]}, |
710 | {"i": ["map", [[0, true]]]}, | |
711 | {"i": ["map", [[1, false]]]}, | |
712 | {"i": ["map", [[0, true], [1, false]]]}, | |
713 | {"i": ["map", [[2, true]]]}, | |
714 | {"i": ["map", [[2, true], [0, true]]]}, | |
715 | {"i": ["map", [[2, true], [1, false]]]}, | |
716 | {"i": ["map", [[2, true], [1, false], [0, true]]]}]']], | |
717 | [dnl | |
718 | condition 0: T---- --- | |
719 | condition 1: -T--- --- | |
720 | condition 2: --T-- --- | |
721 | condition 3: ---T- --- | |
722 | condition 4: ----T --- | |
723 | condition 5: ----- T-- | |
724 | condition 6: ----- -T- | |
725 | condition 7: ----- --T | |
726 | condition 8: -TTTT TTT | |
727 | condition 9: T-TTT TTT | |
728 | condition 10: TT-TT TTT | |
729 | condition 11: TTT-T TTT | |
730 | condition 12: TTTT- TTT | |
731 | condition 13: TTTTT -TT | |
732 | condition 14: TTTTT T-T | |
733 | condition 15: TTTTT TT- | |
734 | condition 16: TTTTT TTT | |
735 | condition 17: -T-T- T-T | |
736 | condition 18: --TT- -TT | |
737 | condition 19: ---T- --T | |
738 | condition 20: ----T TTT | |
739 | condition 21: ----- T-T | |
740 | condition 22: ----- -TT | |
741 | condition 23: ----- --T | |
742 | condition 24: TTTTT TTT | |
743 | condition 25: T-T-T -T- | |
744 | condition 26: TT--T T-- | |
745 | condition 27: T---T --- | |
746 | condition 28: TTTT- --- | |
747 | condition 29: T-T-- --- | |
748 | condition 30: TT--- --- | |
40f280c7 BP |
749 | condition 31: T---- --- |
750 | condition 32: ---T- --T], [condition]) | |
f85f8ebb BP |
751 | |
752 | # This is the same as the "set" test except that it adds values, | |
753 | # and those values don't always match. | |
754 | OVSDB_CHECK_POSITIVE([evaluating conditions on maps (2)], | |
755 | [[evaluate-conditions \ | |
756 | '{"columns": {"i": {"type": {"key": "integer", | |
757 | "value": "boolean", | |
758 | "min": 0, | |
759 | "max": "unlimited"}}}}' \ | |
760 | '[[["i", "==", ["map", []]]], | |
761 | [["i", "==", ["map", [[0, true]]]]], | |
762 | [["i", "==", ["map", [[1, false]]]]], | |
763 | [["i", "==", ["map", [[0, true], [1, false]]]]], | |
764 | [["i", "==", ["map", [[2, true]]]]], | |
765 | [["i", "==", ["map", [[2, true], [0, true]]]]], | |
766 | [["i", "==", ["map", [[2, true], [1, false]]]]], | |
767 | [["i", "==", ["map", [[2, true], [1, false], [0, true]]]]], | |
768 | [["i", "!=", ["map", []]]], | |
769 | [["i", "!=", ["map", [[0, true]]]]], | |
770 | [["i", "!=", ["map", [[1, false]]]]], | |
771 | [["i", "!=", ["map", [[0, true], [1, false]]]]], | |
772 | [["i", "!=", ["map", [[2, true]]]]], | |
773 | [["i", "!=", ["map", [[2, true], [0, true]]]]], | |
774 | [["i", "!=", ["map", [[2, true], [1, false]]]]], | |
775 | [["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]], | |
776 | [["i", "includes", ["map", []]]], | |
777 | [["i", "includes", ["map", [[0, true]]]]], | |
778 | [["i", "includes", ["map", [[1, false]]]]], | |
779 | [["i", "includes", ["map", [[0, true], [1, false]]]]], | |
780 | [["i", "includes", ["map", [[2, true]]]]], | |
781 | [["i", "includes", ["map", [[2, true], [0, true]]]]], | |
782 | [["i", "includes", ["map", [[2, true], [1, false]]]]], | |
783 | [["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]], | |
784 | [["i", "excludes", ["map", []]]], | |
785 | [["i", "excludes", ["map", [[0, true]]]]], | |
786 | [["i", "excludes", ["map", [[1, false]]]]], | |
787 | [["i", "excludes", ["map", [[0, true], [1, false]]]]], | |
788 | [["i", "excludes", ["map", [[2, true]]]]], | |
789 | [["i", "excludes", ["map", [[2, true], [0, true]]]]], | |
790 | [["i", "excludes", ["map", [[2, true], [1, false]]]]], | |
40f280c7 BP |
791 | [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]], |
792 | [["i", "includes", ["map", [[0, true]]]], | |
793 | ["i", "includes", ["map", [[1, false]]]]]]' \ | |
f85f8ebb BP |
794 | '[{"i": ["map", []]}, |
795 | {"i": ["map", [[0, true]]]}, | |
796 | {"i": ["map", [[0, false]]]}, | |
797 | {"i": ["map", [[1, false]]]}, | |
798 | {"i": ["map", [[1, true]]]}, | |
799 | ||
800 | {"i": ["map", [[0, true], [1, false]]]}, | |
801 | {"i": ["map", [[0, true], [1, true]]]}, | |
802 | {"i": ["map", [[2, true]]]}, | |
803 | {"i": ["map", [[2, false]]]}, | |
804 | {"i": ["map", [[2, true], [0, true]]]}, | |
805 | ||
806 | {"i": ["map", [[2, false], [0, true]]]}, | |
807 | {"i": ["map", [[2, true], [1, false]]]}, | |
808 | {"i": ["map", [[2, true], [1, true]]]}, | |
809 | {"i": ["map", [[2, true], [1, false], [0, true]]]}, | |
810 | {"i": ["map", [[2, true], [1, false], [0, false]]]}]']], | |
811 | [dnl | |
812 | condition 0: T---- ----- ----- | |
813 | condition 1: -T--- ----- ----- | |
814 | condition 2: ---T- ----- ----- | |
815 | condition 3: ----- T---- ----- | |
816 | condition 4: ----- --T-- ----- | |
817 | condition 5: ----- ----T ----- | |
818 | condition 6: ----- ----- -T--- | |
819 | condition 7: ----- ----- ---T- | |
820 | condition 8: -TTTT TTTTT TTTTT | |
821 | condition 9: T-TTT TTTTT TTTTT | |
822 | condition 10: TTT-T TTTTT TTTTT | |
823 | condition 11: TTTTT -TTTT TTTTT | |
824 | condition 12: TTTTT TT-TT TTTTT | |
825 | condition 13: TTTTT TTTT- TTTTT | |
826 | condition 14: TTTTT TTTTT T-TTT | |
827 | condition 15: TTTTT TTTTT TTT-T | |
828 | condition 16: TTTTT TTTTT TTTTT | |
829 | condition 17: -T--- TT--T T--T- | |
830 | condition 18: ---T- T---- -T-TT | |
831 | condition 19: ----- T---- ---T- | |
832 | condition 20: ----- --T-T -TTTT | |
833 | condition 21: ----- ----T ---T- | |
834 | condition 22: ----- ----- -T-TT | |
835 | condition 23: ----- ----- ---T- | |
836 | condition 24: TTTTT TTTTT TTTTT | |
837 | condition 25: T-TTT --TT- -TT-T | |
838 | condition 26: TTT-T -TTTT T-T-- | |
839 | condition 27: T-T-T --TT- --T-- | |
840 | condition 28: TTTTT TT-T- T---- | |
841 | condition 29: T-TTT ---T- ----- | |
842 | condition 30: TTT-T -T-T- T---- | |
40f280c7 BP |
843 | condition 31: T-T-T ---T- ----- |
844 | condition 32: ----- T---- ---T-], [condition]) | |
09e25603 TW |
845 | |
846 | OVSDB_CHECK_POSITIVE([evaluating conditions on optional integers], | |
847 | [[evaluate-conditions \ | |
848 | '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": 1}}}}' \ | |
849 | '[[["i", "<", 1]], | |
850 | [["i", "<=", 1]], | |
851 | [["i", "==", 1]], | |
852 | [["i", "!=", 1]], | |
853 | [["i", ">=", 1]], | |
854 | [["i", ">", 1]], | |
855 | [["i", "includes", 1]], | |
856 | [["i", "excludes", 1]], | |
fcaba95e BP |
857 | [["i", ">", 0], ["i", "<", 2]], |
858 | [["i", "==", ["set", []]]], | |
859 | [["i", "!=", ["set", []]]], | |
860 | [["i", "includes", ["set", []]]], | |
861 | [["i", "excludes", ["set", []]]]]' \ | |
09e25603 TW |
862 | '[{"i": ["set", []]}, |
863 | {"i": ["set", [0]]}, | |
864 | {"i": ["set", [1]]}, | |
865 | {"i": ["set", [2]]}]']], | |
866 | [dnl | |
867 | condition 0: -T-- | |
868 | condition 1: -TT- | |
869 | condition 2: --T- | |
870 | condition 3: TT-T | |
871 | condition 4: --TT | |
872 | condition 5: ---T | |
873 | condition 6: --T- | |
874 | condition 7: TT-T | |
fcaba95e BP |
875 | condition 8: --T- |
876 | condition 9: T--- | |
877 | condition 10: -TTT | |
878 | condition 11: TTTT | |
879 | condition 12: TTTT], [condition]) | |
09e25603 TW |
880 | |
881 | OVSDB_CHECK_POSITIVE([evaluating conditions on optional strings], | |
882 | [[evaluate-conditions \ | |
883 | '{"columns": {"s": {"type": {"key": "string", "min": 0, "max": 1}}}}' \ | |
884 | '[[["s", "==", ""]], | |
885 | [["s", "!=", ""]], | |
886 | [["s", "includes", ""]], | |
887 | [["s", "excludes", ""]], | |
888 | [["s", "==", "foo"]], | |
889 | [["s", "!=", "foo"]], | |
890 | [["s", "includes", "foo"]], | |
891 | [["s", "excludes", "foo"]], | |
892 | [["s", "!=", "foo"], ["s", "!=", ""]]]' \ | |
893 | '[{"s": ["set", [""]]}, | |
894 | {"s": ["set", ["foo"]]}, | |
895 | {"s": ["set", ["xxx"]]}, | |
896 | {"s": ["set", []]}]']], | |
897 | [dnl | |
898 | condition 0: T--- | |
899 | condition 1: -TTT | |
900 | condition 2: T--- | |
901 | condition 3: -TTT | |
902 | condition 4: -T-- | |
903 | condition 5: T-TT | |
904 | condition 6: -T-- | |
905 | condition 7: T-TT | |
906 | condition 8: --TT], [condition]) | |
907 | ||
908 | OVSDB_CHECK_POSITIVE([evaluating conditions on optional reals], | |
909 | [[evaluate-conditions \ | |
910 | '{"columns": {"r": {"type": {"key": "real", "min": 0, "max": 1}}}}' \ | |
911 | '[[["r", "<", 5.0]], | |
912 | [["r", "<=", 5.0]], | |
913 | [["r", "==", 5.0]], | |
914 | [["r", "!=", 5.0]], | |
915 | [["r", ">=", 5.0]], | |
916 | [["r", ">", 5.0]], | |
917 | [["r", "includes", 5.0]], | |
918 | [["r", "excludes", 5.0]], | |
fcaba95e BP |
919 | [["r", "!=", 0], ["r", "!=", 5.1]], |
920 | [["r", "==", ["set", []]]], | |
921 | [["r", "!=", ["set", []]]], | |
922 | [["r", "includes", ["set", []]]], | |
923 | [["r", "excludes", ["set", []]]]]' \ | |
09e25603 TW |
924 | '[{"r": ["set", [0]]}, |
925 | {"r": ["set", [5.0]]}, | |
926 | {"r": ["set", [5.1]]}, | |
927 | {"r": ["set", []]}]']], | |
928 | [dnl | |
929 | condition 0: T--- | |
930 | condition 1: TT-- | |
931 | condition 2: -T-- | |
932 | condition 3: T-TT | |
933 | condition 4: -TT- | |
934 | condition 5: --T- | |
935 | condition 6: -T-- | |
936 | condition 7: T-TT | |
fcaba95e BP |
937 | condition 8: -T-T |
938 | condition 9: ---T | |
939 | condition 10: TTT- | |
940 | condition 11: TTTT | |
941 | condition 12: TTTT], [condition]) | |
ae9cab37 LS |
942 | |
943 | OVSDB_CHECK_POSITIVE([evaluating false boolean condition], | |
944 | [[evaluate-conditions-any \ | |
945 | '{"columns": {"i": {"type": "integer"}}}' \ | |
946 | '[[false,["i","==",1]]]' \ | |
947 | '[{"i": 0}, | |
948 | {"i": 1}, | |
949 | {"i": 2}']]], | |
950 | [condition 0: -T-]) | |
951 | ||
952 | OVSDB_CHECK_POSITIVE([evaluating true boolean condition], | |
953 | [[evaluate-conditions-any \ | |
954 | '{"columns": {"i": {"type": "integer"}}}' \ | |
955 | '[[true,["i","==",1]]]' \ | |
956 | '[{"i": 0}, | |
957 | {"i": 1}, | |
958 | {"i": 2}']]], | |
959 | [condition 0: TTT]) | |
960 | ||
961 | OVSDB_CHECK_POSITIVE([compare condition], | |
962 | [[compare-conditions \ | |
963 | '{"columns": {"i": {"type": "integer"}}}' \ | |
964 | '[[true,["i","==",1],["i","==",2],["i","==",3]], | |
965 | [["i","==",1],["i","==",3],["i","==",2],true], | |
966 | [["i","==",1]], | |
967 | [["i",">=",1]]']]], | |
968 | [condition 0-1: 0 | |
969 | condition 1-2: 1 | |
970 | condition 2-3: -1]) |