'[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
'[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
'[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
- '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']],
+ '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' \
+ '[["i", "==", ["set", []]]]' \
+ '[["i", "!=", ["set", []]]]' \
+ '[["i", ">", ["set", []]]]' \
+ '[["i", ">=", ["set", []]]]' \
+ '[["i", "<", ["set", []]]]' \
+ '[["i", "<=", ["set", []]]]' \
+ '[["i", "includes", ["set", []]]]' \
+ '[["i", "excludes", ["set", []]]]' \
+ '[["i", ">", ["set", []]]]' \
+ '[["i", "==", ["set", []]]]' \
+ '[["r", "==", ["set", []]]]' \
+ '[["r", "!=", ["set", []]]]' \
+ '[["r", ">", ["set", []]]]' \
+ '[["r", ">=", ["set", []]]]' \
+ '[["r", "<", ["set", []]]]' \
+ '[["r", "<=", ["set", []]]]' \
+ '[["r", "includes", ["set", []]]]' \
+ '[["r", "excludes", ["set", []]]]' \
+ '[["r", ">", ["set", []]]]' \
+ '[["r", "==", ["set", []]]]' \
+ '[["b", "==", ["set", []]]]' \
+ '[["b", "!=", ["set", []]]]' \
+ '[["b", ">", ["set", []]]]' \
+ '[["b", ">=", ["set", []]]]' \
+ '[["b", "<", ["set", []]]]' \
+ '[["b", "<=", ["set", []]]]' \
+ '[["b", "includes", ["set", []]]]' \
+ '[["b", "excludes", ["set", []]]]' \
+ '[["b", ">", ["set", []]]]' \
+ '[["b", "==", ["set", []]]]' \
+ '[["s", "==", ["set", []]]]' \
+ '[["s", "!=", ["set", []]]]' \
+ '[["s", ">", ["set", []]]]' \
+ '[["s", ">=", ["set", []]]]' \
+ '[["s", "<", ["set", []]]]' \
+ '[["s", "<=", ["set", []]]]' \
+ '[["s", "includes", ["set", []]]]' \
+ '[["s", "excludes", ["set", []]]]' \
+ '[["s", ">", ["set", []]]]' \
+ '[["s", "==", ["set", []]]]' \
+ '[["u", "==", ["set", []]]]' \
+ '[["u", "!=", ["set", []]]]' \
+ '[["u", ">", ["set", []]]]' \
+ '[["u", ">=", ["set", []]]]' \
+ '[["u", "<", ["set", []]]]' \
+ '[["u", "<=", ["set", []]]]' \
+ '[["u", "includes", ["set", []]]]' \
+ '[["u", "excludes", ["set", []]]]' \
+ '[["u", ">", ["set", []]]]' \
+ '[["u", "==", ["set", []]]]' \
+]],
[1], [],
[[test-ovsdb: syntax "["b",">",true]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean.
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.
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.
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.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
+test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean.
+test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean.
+test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
+test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string.
+test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string.
+test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
+test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid.
+test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid.
+test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type uuid.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+]])
+AT_CLEANUP
+
+OVSDB_CHECK_POSITIVE([conditions on optional scalars],
+ [[parse-conditions \
+ '{"columns":
+ {"i": {"type": {"key": "integer", "min": 0, "max": 1}},
+ "r": {"type": {"key": "real", "min": 0, "max": 1}},
+ "b": {"type": {"key": "boolean", "min": 0, "max": 1}},
+ "s": {"type": {"key": "string", "min": 0, "max": 1}},
+ "u": {"type": {"key": "uuid", "min": 0, "max": 1}}}}' \
+ '[["i", "==", 0]]' \
+ '[["i", "!=", 1]]' \
+ '[["i", "<", 2]]' \
+ '[["i", "<=", 3]]' \
+ '[["i", ">", 4]]' \
+ '[["i", ">=", 5]]' \
+ '[["i", "includes", 6]]' \
+ '[["i", "excludes", 7]]' \
+ '[["r", "==", 0.5]]' \
+ '[["r", "!=", 1.5]]' \
+ '[["r", "<", 2.5]]' \
+ '[["r", "<=", 3.5]]' \
+ '[["r", ">", 4.5]]' \
+ '[["r", ">=", 5.5]]' \
+ '[["r", "includes", 6.5]]' \
+ '[["r", "excludes", 7.5]]' \
+ '[["b", "==", true]]' \
+ '[["b", "!=", false]]' \
+ '[["b", "includes", false]]' \
+ '[["b", "excludes", true]]' \
+ '[["s", "==", "a"]]' \
+ '[["s", "!=", "b"]]' \
+ '[["s", "includes", "c"]]' \
+ '[["s", "excludes", "d"]]' \
+ '[["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
+ '[["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
+ '[["u", "includes", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
+ '[["u", "excludes", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']],
+ [[[["i","==",0]]
+[["i","!=",1]]
+[["i","<",2]]
+[["i","<=",3]]
+[["i",">",4]]
+[["i",">=",5]]
+[["i","includes",6]]
+[["i","excludes",7]]
+[["r","==",0.5]]
+[["r","!=",1.5]]
+[["r","<",2.5]]
+[["r","<=",3.5]]
+[["r",">",4.5]]
+[["r",">=",5.5]]
+[["r","includes",6.5]]
+[["r","excludes",7.5]]
+[["b","==",true]]
+[["b","!=",false]]
+[["b","includes",false]]
+[["b","excludes",true]]
+[["s","==","a"]]
+[["s","!=","b"]]
+[["s","includes","c"]]
+[["s","excludes","d"]]
+[["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]
+[["u","!=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]]
+[["u","includes",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]
+[["u","excludes",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]]]],
+ [condition])
+
+AT_SETUP([disallowed conditions on optional scalars])
+AT_KEYWORDS([ovsdb negative condition])
+AT_CHECK([[test-ovsdb parse-conditions \
+ '{"columns":
+ {"i": {"type": {"key": "integer", "min": 0, "max": 1}},
+ "r": {"type": {"key": "real", "min": 0, "max": 1}},
+ "b": {"type": {"key": "boolean", "min": 0, "max": 1}},
+ "s": {"type": {"key": "string", "min": 0, "max": 1}},
+ "u": {"type": {"key": "uuid", "min": 0, "max": 1}}}}' \
+ '[["b", ">", true]]' \
+ '[["b", ">=", false]]' \
+ '[["b", "<", false]]' \
+ '[["b", "<=", false]]' \
+ '[["s", ">", "a"]]' \
+ '[["s", ">=", "b"]]' \
+ '[["s", "<", "c"]]' \
+ '[["s", "<=", "d"]]' \
+ '[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
+ '[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
+ '[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
+ '[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' \
+ '[["i", ">", ["set", []]]]' \
+ '[["i", ">=", ["set", []]]]' \
+ '[["i", "<", ["set", []]]]' \
+ '[["i", "<=", ["set", []]]]' \
+ '[["i", ">", ["set", []]]]' \
+ '[["r", ">", ["set", []]]]' \
+ '[["r", ">=", ["set", []]]]' \
+ '[["r", "<", ["set", []]]]' \
+ '[["r", "<=", ["set", []]]]' \
+ '[["r", ">", ["set", []]]]' \
+ '[["b", ">", ["set", []]]]' \
+ '[["b", ">=", ["set", []]]]' \
+ '[["b", "<", ["set", []]]]' \
+ '[["b", "<=", ["set", []]]]' \
+ '[["b", ">", ["set", []]]]' \
+ '[["s", ">", ["set", []]]]' \
+ '[["s", ">=", ["set", []]]]' \
+ '[["s", "<", ["set", []]]]' \
+ '[["s", "<=", ["set", []]]]' \
+ '[["s", ">", ["set", []]]]' \
+ '[["u", ">", ["set", []]]]' \
+ '[["u", ">=", ["set", []]]]' \
+ '[["u", "<", ["set", []]]]' \
+ '[["u", "<=", ["set", []]]]' \
+ '[["u", ">", ["set", []]]]' \
+]],
+ [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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
+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.
]])
AT_CLEANUP
[["i", ">", 1]],
[["i", "includes", 1]],
[["i", "excludes", 1]],
- [["i", ">", 0], ["i", "<", 2]]]' \
+ [["i", ">", 0], ["i", "<", 2]],
+ [["i", "==", ["set", []]]],
+ [["i", "!=", ["set", []]]],
+ [["i", "includes", ["set", []]]],
+ [["i", "excludes", ["set", []]]]]' \
'[{"i": ["set", []]},
{"i": ["set", [0]]},
{"i": ["set", [1]]},
condition 5: ---T
condition 6: --T-
condition 7: TT-T
-condition 8: --T-], [condition])
+condition 8: --T-
+condition 9: T---
+condition 10: -TTT
+condition 11: TTTT
+condition 12: TTTT], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on optional strings],
[[evaluate-conditions \
[["r", ">", 5.0]],
[["r", "includes", 5.0]],
[["r", "excludes", 5.0]],
- [["r", "!=", 0], ["r", "!=", 5.1]]]' \
+ [["r", "!=", 0], ["r", "!=", 5.1]],
+ [["r", "==", ["set", []]]],
+ [["r", "!=", ["set", []]]],
+ [["r", "includes", ["set", []]]],
+ [["r", "excludes", ["set", []]]]]' \
'[{"r": ["set", [0]]},
{"r": ["set", [5.0]]},
{"r": ["set", [5.1]]},
condition 5: --T-
condition 6: -T--
condition 7: T-TT
-condition 8: -T-T], [condition])
+condition 8: -T-T
+condition 9: ---T
+condition 10: TTT-
+condition 11: TTTT
+condition 12: TTTT], [condition])
OVSDB_CHECK_POSITIVE([evaluating false boolean condition],
[[evaluate-conditions-any \