]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ovsdb-condition.at
conntrack: Support zone limits.
[mirror_ovs.git] / tests / ovsdb-condition.at
CommitLineData
f85f8ebb
BP
1AT_BANNER([OVSDB -- conditions])
2
3OVSDB_CHECK_POSITIVE([null condition],
4 [[parse-conditions \
5 '{"columns": {"name": {"type": "string"}}}' \
6 '[]']],
7 [[[]]])
8
9OVSDB_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
75AT_SETUP([disallowed conditions on scalars])
76AT_KEYWORDS([ovsdb negative condition])
7c126fbb 77AT_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.
149test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean.
150test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean.
151test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean.
152test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
153test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string.
154test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string.
155test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string.
156test-ovsdb: syntax "["u",">",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
157test-ovsdb: syntax "["u",">=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid.
158test-ovsdb: syntax "["u","<",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid.
159test-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
160test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
161test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
162test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
163test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
164test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
165test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
166test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
167test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
168test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
169test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
170test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
171test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
172test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
173test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
174test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
175test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
176test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
177test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
178test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
179test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
180test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
181test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59
BP
182test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
183test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean.
184test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean.
185test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean.
bc9bbc4e
BP
186test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
187test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59 188test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
bc9bbc4e
BP
189test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
190test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
191test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59
BP
192test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
193test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string.
194test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string.
195test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string.
bc9bbc4e
BP
196test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
197test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59 198test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
bc9bbc4e
BP
199test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
200test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
201test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59
BP
202test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
203test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid.
204test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid.
205test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type uuid.
bc9bbc4e
BP
206test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
207test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59 208test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
bc9bbc4e 209test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59
BP
210]])
211AT_CLEANUP
212
213OVSDB_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
279AT_SETUP([disallowed conditions on optional scalars])
280AT_KEYWORDS([ovsdb negative condition])
281AT_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.
327test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type set of up to 1 booleans.
328test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type set of up to 1 booleans.
329test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type set of up to 1 booleans.
330test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings.
331test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type set of up to 1 strings.
332test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type set of up to 1 strings.
333test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type set of up to 1 strings.
334test-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.
335test-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.
336test-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.
337test-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
338test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
339test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
340test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
341test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
342test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
343test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
344test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
345test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
346test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
347test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
64107d59
BP
348test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans.
349test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type set of up to 1 booleans.
350test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type set of up to 1 booleans.
351test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type set of up to 1 booleans.
352test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans.
353test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings.
354test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type set of up to 1 strings.
355test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type set of up to 1 strings.
356test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type set of up to 1 strings.
357test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings.
358test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids.
359test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type set of up to 1 uuids.
360test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type set of up to 1 uuids.
361test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type set of up to 1 uuids.
362test-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]])
364AT_CLEANUP
365
366OVSDB_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
427OVSDB_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
441OVSDB_CHECK_POSITIVE([boolean condition],
442 [[parse-conditions \
443 '{"columns": {"name": {"type": "string"}}}' \
444 '[true]']],
445 [[[true]]])
446
447OVSDB_CHECK_POSITIVE([boolean condition],
448 [[parse-conditions \
449 '{"columns": {"name": {"type": "string"}}}' \
450 '[false]']],
451 [[[false]]])
452
f85f8ebb
BP
453OVSDB_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
462OVSDB_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--
478condition 1: TT-
479condition 2: -T-
480condition 3: T-T
481condition 4: -TT
482condition 5: --T
483condition 6: -T-
40f280c7
BP
484condition 7: T-T
485condition 8: -T-], [condition])
f85f8ebb
BP
486
487OVSDB_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--
503condition 1: TT-
504condition 2: -T-
505condition 3: T-T
506condition 4: -TT
507condition 5: --T
508condition 6: -T-
40f280c7
BP
509condition 7: T-T
510condition 8: -T-], [condition])
f85f8ebb
BP
511
512OVSDB_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-
527condition 1: -T
528condition 2: T-
529condition 3: -T
530condition 4: -T
531condition 5: T-
532condition 6: -T
40f280c7
BP
533condition 7: T-
534condition 8: --], [condition])
f85f8ebb
BP
535
536OVSDB_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--
552condition 1: -TT
553condition 2: T--
554condition 3: -TT
555condition 4: -T-
556condition 5: T-T
557condition 6: -T-
40f280c7
BP
558condition 7: T-T
559condition 8: --T], [condition])
f85f8ebb
BP
560
561OVSDB_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--
578condition 1: -TT
579condition 2: T--
580condition 3: -TT
581condition 4: -T-
582condition 5: T-T
583condition 6: -T-
40f280c7
BP
584condition 7: T-T
585condition 8: T-T], [condition])
f85f8ebb
BP
586
587OVSDB_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
633condition 0: T---- ---
634condition 1: -T--- ---
635condition 2: --T-- ---
636condition 3: ---T- ---
637condition 4: ----T ---
638condition 5: ----- T--
639condition 6: ----- -T-
640condition 7: ----- --T
641condition 8: -TTTT TTT
642condition 9: T-TTT TTT
643condition 10: TT-TT TTT
644condition 11: TTT-T TTT
645condition 12: TTTT- TTT
646condition 13: TTTTT -TT
647condition 14: TTTTT T-T
648condition 15: TTTTT TT-
649condition 16: TTTTT TTT
650condition 17: -T-T- T-T
651condition 18: --TT- -TT
652condition 19: ---T- --T
653condition 20: ----T TTT
654condition 21: ----- T-T
655condition 22: ----- -TT
656condition 23: ----- --T
657condition 24: TTTTT TTT
658condition 25: T-T-T -T-
659condition 26: TT--T T--
660condition 27: T---T ---
661condition 28: TTTT- ---
662condition 29: T-T-- ---
663condition 30: TT--- ---
40f280c7
BP
664condition 31: T---- ---
665condition 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.
669OVSDB_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
718condition 0: T---- ---
719condition 1: -T--- ---
720condition 2: --T-- ---
721condition 3: ---T- ---
722condition 4: ----T ---
723condition 5: ----- T--
724condition 6: ----- -T-
725condition 7: ----- --T
726condition 8: -TTTT TTT
727condition 9: T-TTT TTT
728condition 10: TT-TT TTT
729condition 11: TTT-T TTT
730condition 12: TTTT- TTT
731condition 13: TTTTT -TT
732condition 14: TTTTT T-T
733condition 15: TTTTT TT-
734condition 16: TTTTT TTT
735condition 17: -T-T- T-T
736condition 18: --TT- -TT
737condition 19: ---T- --T
738condition 20: ----T TTT
739condition 21: ----- T-T
740condition 22: ----- -TT
741condition 23: ----- --T
742condition 24: TTTTT TTT
743condition 25: T-T-T -T-
744condition 26: TT--T T--
745condition 27: T---T ---
746condition 28: TTTT- ---
747condition 29: T-T-- ---
748condition 30: TT--- ---
40f280c7
BP
749condition 31: T---- ---
750condition 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.
754OVSDB_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
812condition 0: T---- ----- -----
813condition 1: -T--- ----- -----
814condition 2: ---T- ----- -----
815condition 3: ----- T---- -----
816condition 4: ----- --T-- -----
817condition 5: ----- ----T -----
818condition 6: ----- ----- -T---
819condition 7: ----- ----- ---T-
820condition 8: -TTTT TTTTT TTTTT
821condition 9: T-TTT TTTTT TTTTT
822condition 10: TTT-T TTTTT TTTTT
823condition 11: TTTTT -TTTT TTTTT
824condition 12: TTTTT TT-TT TTTTT
825condition 13: TTTTT TTTT- TTTTT
826condition 14: TTTTT TTTTT T-TTT
827condition 15: TTTTT TTTTT TTT-T
828condition 16: TTTTT TTTTT TTTTT
829condition 17: -T--- TT--T T--T-
830condition 18: ---T- T---- -T-TT
831condition 19: ----- T---- ---T-
832condition 20: ----- --T-T -TTTT
833condition 21: ----- ----T ---T-
834condition 22: ----- ----- -T-TT
835condition 23: ----- ----- ---T-
836condition 24: TTTTT TTTTT TTTTT
837condition 25: T-TTT --TT- -TT-T
838condition 26: TTT-T -TTTT T-T--
839condition 27: T-T-T --TT- --T--
840condition 28: TTTTT TT-T- T----
841condition 29: T-TTT ---T- -----
842condition 30: TTT-T -T-T- T----
40f280c7
BP
843condition 31: T-T-T ---T- -----
844condition 32: ----- T---- ---T-], [condition])
09e25603
TW
845
846OVSDB_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
867condition 0: -T--
868condition 1: -TT-
869condition 2: --T-
870condition 3: TT-T
871condition 4: --TT
872condition 5: ---T
873condition 6: --T-
874condition 7: TT-T
fcaba95e
BP
875condition 8: --T-
876condition 9: T---
877condition 10: -TTT
878condition 11: TTTT
879condition 12: TTTT], [condition])
09e25603
TW
880
881OVSDB_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
898condition 0: T---
899condition 1: -TTT
900condition 2: T---
901condition 3: -TTT
902condition 4: -T--
903condition 5: T-TT
904condition 6: -T--
905condition 7: T-TT
906condition 8: --TT], [condition])
907
908OVSDB_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
929condition 0: T---
930condition 1: TT--
931condition 2: -T--
932condition 3: T-TT
933condition 4: -TT-
934condition 5: --T-
935condition 6: -T--
936condition 7: T-TT
fcaba95e
BP
937condition 8: -T-T
938condition 9: ---T
939condition 10: TTT-
940condition 11: TTTT
941condition 12: TTTT], [condition])
ae9cab37
LS
942
943OVSDB_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
952OVSDB_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
961OVSDB_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
969condition 1-2: 1
970condition 2-3: -1])