1 AT_BANNER([OVSDB -- atomic types])
3 OVSDB_CHECK_POSITIVE([integer],
4 [[parse-atomic-type '["integer"]' ]], ["integer"])
5 OVSDB_CHECK_POSITIVE([real],
6 [[parse-atomic-type '["real"]' ]], ["real"])
7 OVSDB_CHECK_POSITIVE([boolean],
8 [[parse-atomic-type '["boolean"]' ]], ["boolean"])
9 OVSDB_CHECK_POSITIVE([string],
10 [[parse-atomic-type '["string"]' ]], ["string"])
11 OVSDB_CHECK_POSITIVE([uuid],
12 [[parse-atomic-type '["uuid"]' ]], ["uuid"])
13 OVSDB_CHECK_NEGATIVE([void is not a valid atomic-type],
14 [[parse-atomic-type '["void"]' ]], ["void" is not an atomic-type])
16 AT_BANNER([OVSDB -- simple types])
18 OVSDB_CHECK_POSITIVE([simple integer],
19 [[parse-type '["integer"]' ]], ["integer"])
20 OVSDB_CHECK_POSITIVE([simple real],
21 [[parse-type '["real"]' ]], ["real"])
22 OVSDB_CHECK_POSITIVE([simple boolean],
23 [[parse-type '["boolean"]' ]], ["boolean"])
24 OVSDB_CHECK_POSITIVE([simple string],
25 [[parse-type '["string"]' ]], ["string"])
26 OVSDB_CHECK_POSITIVE([simple uuid],
27 [[parse-type '["uuid"]' ]], ["uuid"])
28 OVSDB_CHECK_POSITIVE([integer in object],
29 [[parse-type '{"key": "integer"}' ]], ["integer"])
30 OVSDB_CHECK_POSITIVE([real in object with explicit min and max],
31 [[parse-type '{"key": "real", "min": 1, "max": 1}' ]], ["real"])
33 OVSDB_CHECK_NEGATIVE([key type is required],
34 [[parse-type '{}' ]], [Required 'key' member is missing.])
35 OVSDB_CHECK_NEGATIVE([void is not a valid type],
36 [[parse-type '["void"]' ]], ["void" is not an atomic-type])
38 AT_BANNER([OVSDB -- set types])
40 OVSDB_CHECK_POSITIVE([optional boolean],
41 [[parse-type '{"key": "boolean", "min": 0}' ]],
42 [[{"key":"boolean","min":0}]],
44 OVSDB_CHECK_POSITIVE([set of 1 to 3 uuids],
45 [[parse-type '{"key": "uuid", "min": 1, "max": 3}' ]],
46 [[{"key":"uuid","max":3}]])
47 OVSDB_CHECK_POSITIVE([set of 0 to 3 strings],
48 [[parse-type '{"key": "string", "min": 0, "max": 3}' ]],
49 [[{"key":"string","max":3,"min":0}]])
50 OVSDB_CHECK_POSITIVE([set of 0 or more integers],
51 [[parse-type '{"key": "integer", "min": 0, "max": "unlimited"}']],
52 [[{"key":"integer","max":"unlimited","min":0}]])
53 OVSDB_CHECK_POSITIVE([set of 10 or more reals],
54 [[parse-type '{"key": "real", "min": 10, "max": "unlimited"}']],
55 [[{"key":"real","max":"unlimited","min":10}]])
57 OVSDB_CHECK_NEGATIVE([set max cannot be less than min],
58 [[parse-type '{"key": "real", "min": 5, "max": 3}' ]],
59 [ovsdb type fails constraint checks])
60 OVSDB_CHECK_NEGATIVE([set max cannot be negative],
61 [[parse-type '{"key": "real", "max": -1}' ]],
62 [bad min or max value])
63 OVSDB_CHECK_NEGATIVE([set min cannot be negative],
64 [[parse-type '{"key": "real", "min": -1}' ]],
65 [bad min or max value])
67 AT_BANNER([OVSDB -- map types])
69 OVSDB_CHECK_POSITIVE([map of 1 integer to boolean],
70 [[parse-type '{"key": "integer", "value": "boolean"}' ]],
71 [[{"key":"integer","value":"boolean"}]])
72 OVSDB_CHECK_POSITIVE([map of 1 boolean to integer, explicit min and max],
73 [[parse-type '{"key": "boolean", "value": "integer", "min": 1, "max": 1}' ]],
74 [[{"key":"boolean","value":"integer"}]])
75 OVSDB_CHECK_POSITIVE([map of 2 to 5 uuid to real],
76 [[parse-type '{"key": "uuid", "value": "real", "min": 2, "max": 5}' ]],
77 [[{"key":"uuid","max":5,"min":2,"value":"real"}]])
78 OVSDB_CHECK_POSITIVE([map of 0 to 10 string to uuid],
79 [[parse-type '{"key": "string", "value": "uuid", "min": 0, "max": 10}' ]],
80 [[{"key":"string","max":10,"min":0,"value":"uuid"}]])
81 OVSDB_CHECK_POSITIVE([map of 10 to 20 real to string],
82 [[parse-type '{"key": "real", "value": "string", "min": 10, "max": 20}' ]],
83 [[{"key":"real","max":20,"min":10,"value":"string"}]])
84 OVSDB_CHECK_POSITIVE([map of 20 or more string to real],
85 [[parse-type '{"key": "string", "value": "real", "min": 20, "max": "unlimited"}' ]],
86 [[{"key":"string","max":"unlimited","min":20,"value":"real"}]])
88 OVSDB_CHECK_NEGATIVE([map key type is required],
89 [[parse-type '{"value": "integer"}' ]],
90 [Required 'key' member is missing.])