1 AT_BANNER([OVSDB -- interface description language (IDL)])
3 # OVSDB_CHECK_IDL(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS])
5 # Creates a database with a schema derived from idltest.ovsidl, runs
6 # each PRE-IDL-TXN (if any), starts an ovsdb-server on that database,
7 # and runs "test-ovsdb idl" passing each of the TRANSACTIONS along.
9 # Checks that the overall output is OUTPUT. Before comparison, the
10 # output is sorted (using "sort") and UUIDs in the output are replaced
11 # by markers of the form <N> where N is a number. The first unique
12 # UUID is replaced by <0>, the next by <1>, and so on. If a given
13 # UUID appears more than once it is always replaced by the same
16 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
17 m4_define([OVSDB_CHECK_IDL],
19 AT_KEYWORDS([ovsdb server idl positive $5])
20 OVS_CHECK_LCOV([ovsdb-tool create db $abs_builddir/idltest.ovsschema],
21 [0], [stdout], [ignore])
22 AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
24 [OVS_CHECK_LCOV([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat server-pid`])])
25 AT_CHECK([test-ovsdb -vjsonrpc -t10 idl unix:socket $3],
26 [0], [stdout], [ignore], [kill `cat server-pid`])
27 AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl], [0], [$4], [],
28 [kill `cat server-pid`])
32 OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
39 OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
47 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
48 "ia": ["set", [1, 2, 3]],
49 "ra": ["set", [-0.5]],
50 "ba": ["set", [true, false]],
51 "sa": ["set", ["abc", "def"]],
52 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
53 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
60 "row": {"b": true}}]' \
64 "row": {"r": 123.5}}]' \
73 "ba": ["set", [false]],
75 "ua": ["set", []]}}]' \
78 "where": [["i", "<", 1]],
79 "row": {"s": "newstring"}}]' \
82 "where": [["i", "==", 0]]}]' \
85 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
86 002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
87 002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
88 003: {"error":null,"result":[{"count":2}]}
89 004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
90 004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
91 005: {"error":null,"result":[{"count":2}]}
92 006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
93 006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
94 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
95 008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
96 008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
97 008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
98 009: {"error":null,"result":[{"count":2}]}
99 010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
100 010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
101 010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
102 011: {"error":null,"result":[{"count":1}]}
103 012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
104 012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
106 014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
107 014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<4> <5>] uuid=<0>
111 OVSDB_CHECK_IDL([simple idl, initially populated],
118 "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
119 "ia": ["set", [1, 2, 3]],
120 "ra": ["set", [-0.5]],
121 "ba": ["set", [true, false]],
122 "sa": ["set", ["abc", "def"]],
123 "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
124 ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
131 "row": {"b": true}}]']],
132 [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
133 000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<3> <4>] uuid=<5>
134 001: {"error":null,"result":[{"count":2}]}
135 002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
136 002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[false true] sa=[abc def] ua=[<3> <4>] uuid=<5>
140 OVSDB_CHECK_IDL([self-linking idl, consistent ops],
144 "row": {"i": 0, "k": ["named-uuid", "self"]},
145 "uuid-name": "self"}]' \
149 "uuid-name": "row1"},
152 "row": {"i": 2, "k": ["named-uuid", "row1"]},
153 "uuid-name": "row2"},
156 "where": [["i", "==", 1]],
157 "row": {"k": ["named-uuid", "row2"]}}]' \
160 "where": [["i", "==", 1]],
161 "row": {"k": ["uuid", "#1#"]}}]' \
165 "row": {"k": ["uuid", "#0#"]}}]']],
167 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
168 002: i=0 k=0 ka=[] l2= uuid=<0>
169 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"count":1}]}
170 004: i=0 k=0 ka=[] l2= uuid=<0>
171 004: i=1 k=2 ka=[] l2= uuid=<1>
172 004: i=2 k=1 ka=[] l2= uuid=<2>
173 005: {"error":null,"result":[{"count":1}]}
174 006: i=0 k=0 ka=[] l2= uuid=<0>
175 006: i=1 k=1 ka=[] l2= uuid=<1>
176 006: i=2 k=1 ka=[] l2= uuid=<2>
177 007: {"error":null,"result":[{"count":3}]}
178 008: i=0 k=0 ka=[] l2= uuid=<0>
179 008: i=1 k=0 ka=[] l2= uuid=<1>
180 008: i=2 k=0 ka=[] l2= uuid=<2>
184 OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
188 "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
192 "row": {"k": ["uuid", "#0#"]}}]' \
196 "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
199 "row": {"i": 1, "k": ["uuid", "52d752a3-b062-4668-9446-d2e0d4a14703"]}}]' \
203 "row": {"k": ["uuid", "#1#"]}}]' \
206 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
207 002: i=0 k= ka=[] l2= uuid=<0>
208 003: {"error":null,"result":[{"count":1}]}
209 004: i=0 k=0 ka=[] l2= uuid=<0>
210 005: {"error":null,"result":[{"count":1}]}
211 006: i=0 k= ka=[] l2= uuid=<0>
212 007: {"error":null,"result":[{"uuid":["uuid","<1>"]}]}
213 008: i=0 k= ka=[] l2= uuid=<0>
214 008: i=1 k= ka=[] l2= uuid=<1>
215 009: {"error":null,"result":[{"count":2}]}
216 010: i=0 k=1 ka=[] l2= uuid=<0>
217 010: i=1 k=1 ka=[] l2= uuid=<1>
221 OVSDB_CHECK_IDL([self-linking idl, sets],
225 "row": {"i": 0, "ka": ["set", [["named-uuid", "i0"]]]},
229 "row": {"i": 1, "ka": ["set", [["named-uuid", "i1"]]]},
233 "row": {"i": 2, "ka": ["set", [["named-uuid", "i2"]]]},
237 "row": {"i": 3, "ka": ["set", [["named-uuid", "i3"]]]},
238 "uuid-name": "i3"}]' \
242 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
246 "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"], ["uuid", "1ac2b12e-b767-4805-a55d-43976e40c465"]]]}}]']],
248 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
249 002: i=0 k= ka=[0] l2= uuid=<0>
250 002: i=1 k= ka=[1] l2= uuid=<1>
251 002: i=2 k= ka=[2] l2= uuid=<2>
252 002: i=3 k= ka=[3] l2= uuid=<3>
253 003: {"error":null,"result":[{"count":4}]}
254 004: i=0 k= ka=[0 1 2 3] l2= uuid=<0>
255 004: i=1 k= ka=[0 1 2 3] l2= uuid=<1>
256 004: i=2 k= ka=[0 1 2 3] l2= uuid=<2>
257 004: i=3 k= ka=[0 1 2 3] l2= uuid=<3>
258 005: {"error":null,"result":[{"count":4}]}
259 006: i=0 k= ka=[0 2] l2= uuid=<0>
260 006: i=1 k= ka=[0 2] l2= uuid=<1>
261 006: i=2 k= ka=[0 2] l2= uuid=<2>
262 006: i=3 k= ka=[0 2] l2= uuid=<3>
267 OVSDB_CHECK_IDL([external-linking idl, consistent ops],
272 "uuid-name": "row0"},
275 "row": {"i": 1, "l2": ["set", [["named-uuid", "row0"]]]},
276 "uuid-name": "row1"}]']],
278 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
279 002: i=0 l1= uuid=<0>
280 002: i=1 k= ka=[] l2=0 uuid=<1>