]> git.proxmox.com Git - ovs.git/blob - tests/ovsdb-transaction.at
tests: Convert ovsdb-monitor-sort utility from Perl to Python.
[ovs.git] / tests / ovsdb-transaction.at
1 AT_BANNER([OVSDB -- transactions])
2
3 OVSDB_CHECK_POSITIVE([empty table, empty transaction],
4 [[transact \
5 '["print"]' \
6 '["commit"]' \
7 '["print"]' \
8 '["abort"]' \
9 '["print"]']],
10 [dnl
11 print:
12 commit:
13 print:
14 abort:
15 print:])
16
17 OVSDB_CHECK_POSITIVE([nonempty table, empty transaction],
18 [[transact \
19 '["insert", "1", "2", "3"]' \
20 '["insert", "2", "2", "3"]' \
21 '["print"]' \
22 '["commit"]' \
23 '["print"]' \
24 '["abort"]' \
25 '["print"]']],
26 [dnl
27 insert 1 2 3:
28 insert 2 2 3:
29 print:
30 1: i=2, j=3
31 2: i=2, j=3
32 commit:
33 print:
34 1: i=2, j=3
35 2: i=2, j=3
36 abort:
37 print:
38 1: i=2, j=3
39 2: i=2, j=3])
40
41 OVSDB_CHECK_POSITIVE([insert, commit],
42 [[transact \
43 '["insert", "1", "2", "3"]' \
44 '["insert", "2", "2", "3"]' \
45 '["commit"]' \
46 '["print"]' \
47 '["insert", "3", "1", "2"]' \
48 '["print"]' \
49 '["commit"]' \
50 '["print"]']],
51 [dnl
52 insert 1 2 3:
53 insert 2 2 3:
54 commit:
55 print:
56 1: i=2, j=3
57 2: i=2, j=3
58 insert 3 1 2:
59 print:
60 1: i=2, j=3
61 2: i=2, j=3
62 3: i=1, j=2
63 commit:
64 print:
65 1: i=2, j=3
66 2: i=2, j=3
67 3: i=1, j=2],
68 [transaction])
69
70 OVSDB_CHECK_POSITIVE([insert, abort],
71 [[transact \
72 '["insert", "1", "2", "3"]' \
73 '["insert", "2", "2", "3"]' \
74 '["commit"]' \
75 '["print"]' \
76 '["insert", "3", "1", "2"]' \
77 '["print"]' \
78 '["abort"]' \
79 '["print"]']],
80 [dnl
81 insert 1 2 3:
82 insert 2 2 3:
83 commit:
84 print:
85 1: i=2, j=3
86 2: i=2, j=3
87 insert 3 1 2:
88 print:
89 1: i=2, j=3
90 2: i=2, j=3
91 3: i=1, j=2
92 abort:
93 print:
94 1: i=2, j=3
95 2: i=2, j=3],
96 [transaction])
97
98 OVSDB_CHECK_POSITIVE([modify, commit],
99 [[transact \
100 '["insert", "1", "2", "3"]' \
101 '["insert", "2", "2", "3"]' \
102 '["commit"]' \
103 '["print"]' \
104 '["modify", "2", "5", "-1"]' \
105 '["modify", "1", "-1", "4"]' \
106 '["print"]' \
107 '["commit"]' \
108 '["print"]']],
109 [dnl
110 insert 1 2 3:
111 insert 2 2 3:
112 commit:
113 print:
114 1: i=2, j=3
115 2: i=2, j=3
116 modify 2 5 -1:
117 modify 1 -1 4:
118 print:
119 1: i=2, j=4
120 2: i=5, j=3
121 commit:
122 print:
123 1: i=2, j=4
124 2: i=5, j=3],
125 [transaction])
126
127 OVSDB_CHECK_POSITIVE([modify, abort],
128 [[transact \
129 '["insert", "1", "2", "3"]' \
130 '["insert", "2", "2", "3"]' \
131 '["commit"]' \
132 '["print"]' \
133 '["modify", "2", "5", "-1"]' \
134 '["modify", "1", "-1", "4"]' \
135 '["print"]' \
136 '["abort"]' \
137 '["print"]']],
138 [dnl
139 insert 1 2 3:
140 insert 2 2 3:
141 commit:
142 print:
143 1: i=2, j=3
144 2: i=2, j=3
145 modify 2 5 -1:
146 modify 1 -1 4:
147 print:
148 1: i=2, j=4
149 2: i=5, j=3
150 abort:
151 print:
152 1: i=2, j=3
153 2: i=2, j=3],
154 [transaction])
155
156 OVSDB_CHECK_POSITIVE([delete, commit],
157 [[transact \
158 '["insert", "1", "2", "3"]' \
159 '["insert", "2", "2", "3"]' \
160 '["commit"]' \
161 '["print"]' \
162 '["delete", "1"]' \
163 '["print"]' \
164 '["commit"]' \
165 '["print"]']],
166 [dnl
167 insert 1 2 3:
168 insert 2 2 3:
169 commit:
170 print:
171 1: i=2, j=3
172 2: i=2, j=3
173 delete 1:
174 print:
175 2: i=2, j=3
176 commit:
177 print:
178 2: i=2, j=3],
179 [transaction])
180
181 OVSDB_CHECK_POSITIVE([delete, abort],
182 [[transact \
183 '["insert", "1", "2", "3"]' \
184 '["insert", "2", "2", "3"]' \
185 '["commit"]' \
186 '["print"]' \
187 '["delete", "1"]' \
188 '["print"]' \
189 '["abort"]' \
190 '["print"]']],
191 [dnl
192 insert 1 2 3:
193 insert 2 2 3:
194 commit:
195 print:
196 1: i=2, j=3
197 2: i=2, j=3
198 delete 1:
199 print:
200 2: i=2, j=3
201 abort:
202 print:
203 1: i=2, j=3
204 2: i=2, j=3],
205 [transaction])
206
207 OVSDB_CHECK_POSITIVE([modify, delete, commit],
208 [[transact \
209 '["insert", "1", "2", "3"]' \
210 '["insert", "2", "2", "3"]' \
211 '["commit"]' \
212 '["print"]' \
213 '["modify", "1", "5", "6"]' \
214 '["delete", "1"]' \
215 '["print"]' \
216 '["commit"]' \
217 '["print"]']],
218 [dnl
219 insert 1 2 3:
220 insert 2 2 3:
221 commit:
222 print:
223 1: i=2, j=3
224 2: i=2, j=3
225 modify 1 5 6:
226 delete 1:
227 print:
228 2: i=2, j=3
229 commit:
230 print:
231 2: i=2, j=3],
232 [transaction])
233
234 OVSDB_CHECK_POSITIVE([modify, delete, abort],
235 [[transact \
236 '["insert", "1", "2", "3"]' \
237 '["insert", "2", "2", "3"]' \
238 '["commit"]' \
239 '["print"]' \
240 '["modify", "1", "5", "6"]' \
241 '["delete", "1"]' \
242 '["print"]' \
243 '["abort"]' \
244 '["print"]']],
245 [dnl
246 insert 1 2 3:
247 insert 2 2 3:
248 commit:
249 print:
250 1: i=2, j=3
251 2: i=2, j=3
252 modify 1 5 6:
253 delete 1:
254 print:
255 2: i=2, j=3
256 abort:
257 print:
258 1: i=2, j=3
259 2: i=2, j=3],
260 [transaction])
261
262 OVSDB_CHECK_POSITIVE([insert, delete, commit],
263 [[transact \
264 '["insert", "1", "2", "3"]' \
265 '["insert", "2", "2", "3"]' \
266 '["commit"]' \
267 '["print"]' \
268 '["insert", "3", "5", "6"]' \
269 '["delete", "1"]' \
270 '["delete", "3"]' \
271 '["print"]' \
272 '["commit"]' \
273 '["print"]']],
274 [dnl
275 insert 1 2 3:
276 insert 2 2 3:
277 commit:
278 print:
279 1: i=2, j=3
280 2: i=2, j=3
281 insert 3 5 6:
282 delete 1:
283 delete 3:
284 print:
285 2: i=2, j=3
286 commit:
287 print:
288 2: i=2, j=3],
289 [transaction])
290
291 OVSDB_CHECK_POSITIVE([insert, delete, abort],
292 [[transact \
293 '["insert", "1", "2", "3"]' \
294 '["insert", "2", "2", "3"]' \
295 '["commit"]' \
296 '["print"]' \
297 '["insert", "3", "5", "6"]' \
298 '["delete", "1"]' \
299 '["delete", "3"]' \
300 '["print"]' \
301 '["abort"]' \
302 '["print"]']],
303 [dnl
304 insert 1 2 3:
305 insert 2 2 3:
306 commit:
307 print:
308 1: i=2, j=3
309 2: i=2, j=3
310 insert 3 5 6:
311 delete 1:
312 delete 3:
313 print:
314 2: i=2, j=3
315 abort:
316 print:
317 1: i=2, j=3
318 2: i=2, j=3],
319 [transaction])
320
321
322 OVSDB_CHECK_POSITIVE([insert, modify, delete, commit],
323 [[transact \
324 '["insert", "1", "2", "3"]' \
325 '["insert", "2", "2", "3"]' \
326 '["commit"]' \
327 '["print"]' \
328 '["insert", "3", "5", "6"]' \
329 '["delete", "1"]' \
330 '["modify", "3", "7", "8"]' \
331 '["delete", "3"]' \
332 '["print"]' \
333 '["commit"]' \
334 '["print"]']],
335 [dnl
336 insert 1 2 3:
337 insert 2 2 3:
338 commit:
339 print:
340 1: i=2, j=3
341 2: i=2, j=3
342 insert 3 5 6:
343 delete 1:
344 modify 3 7 8:
345 delete 3:
346 print:
347 2: i=2, j=3
348 commit:
349 print:
350 2: i=2, j=3],
351 [transaction])
352
353 OVSDB_CHECK_POSITIVE([insert, modify, delete, abort],
354 [[transact \
355 '["insert", "1", "2", "3"]' \
356 '["insert", "2", "2", "3"]' \
357 '["commit"]' \
358 '["print"]' \
359 '["insert", "3", "5", "6"]' \
360 '["delete", "1"]' \
361 '["modify", "3", "7", "8"]' \
362 '["delete", "3"]' \
363 '["print"]' \
364 '["abort"]' \
365 '["print"]']],
366 [dnl
367 insert 1 2 3:
368 insert 2 2 3:
369 commit:
370 print:
371 1: i=2, j=3
372 2: i=2, j=3
373 insert 3 5 6:
374 delete 1:
375 modify 3 7 8:
376 delete 3:
377 print:
378 2: i=2, j=3
379 abort:
380 print:
381 1: i=2, j=3
382 2: i=2, j=3],
383 [transaction])
384
385 OVSDB_CHECK_POSITIVE([deletes are aborted cleanly],
386 [[transact \
387 '["insert", "1", "2", "3"]' \
388 '["commit"]' \
389 '["print"]' \
390 '["delete", "1"]' \
391 '["abort"]' \
392 '["print"]' \
393 '["delete", "1"]' \
394 '["abort"]' \
395 '["print"]']],
396 [dnl
397 insert 1 2 3:
398 commit:
399 print:
400 1: i=2, j=3
401 delete 1:
402 abort:
403 print:
404 1: i=2, j=3
405 delete 1:
406 abort:
407 print:
408 1: i=2, j=3],
409 [transaction])
410