]> git.proxmox.com Git - mirror_ovs.git/blame - tests/ovsdb-tool.at
conntrack: Support zone limits.
[mirror_ovs.git] / tests / ovsdb-tool.at
CommitLineData
1e19e50e
BP
1AT_BANNER([OVSDB -- ovsdb-tool])
2
3# OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
4#
5# Creates a database with the given SCHEMA and runs each of the
6# TRANSACTIONS (which should be a quoted list of quoted strings)
7# against it with ovsdb-tool one at a time.
8#
9# Checks that the overall output is OUTPUT, but UUIDs in the output
10# are replaced by markers of the form <N> where N is a number. The
11# first unique UUID is replaced by <0>, the next by <1>, and so on.
12# If a given UUID appears more than once it is always replaced by the
13# same marker.
14#
15# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
16m4_define([OVSDB_CHECK_EXECUTION],
17 [AT_SETUP([$1])
18 AT_KEYWORDS([ovsdb file positive $5])
39ab07af 19 $2 > schema
1e19e50e
BP
20 touch .db.~lock~
21 AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
22 m4_foreach([txn], [$3],
23 [AT_CHECK([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore])
24cat stdout >> output
25])
c724bd67 26 AT_CHECK([uuidfilt output], [0], [$4])
1e19e50e
BP
27 AT_CLEANUP])
28
29EXECUTION_EXAMPLES
30
31AT_SETUP([transaction comments])
32AT_KEYWORDS([ovsdb file positive])
39ab07af 33ordinal_schema > schema
1e19e50e
BP
34touch .db.~lock~
35AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
36AT_CHECK([[ovsdb-tool transact db '
37 ["ordinals",
38 {"op": "insert",
39 "table": "ordinals",
40 "row": {"name": "five", "number": 5}},
41 {"op": "comment",
42 "comment": "add row for 5"}]']], [0], [stdout], [ignore])
c724bd67 43AT_CHECK([uuidfilt stdout], [0],
1e19e50e
BP
44 [[[{"uuid":["uuid","<0>"]},{}]
45]])
00961f7c 46AT_CHECK([grep "add row for 5" db], [0], [ignore])
1e19e50e
BP
47AT_CLEANUP
48
49AT_SETUP([ovsdb-tool compact])
50AT_KEYWORDS([ovsdb file positive])
39ab07af 51ordinal_schema > schema
a35ae81c
BP
52dnl Make sure that "ovsdb-tool create" works with a dangling symlink,
53dnl creating the target of the symlink rather than replacing the symlink
54dnl with a regular file, and that the lockfile gets created relative to
55dnl the symlink's target.
56mkdir dir
57: > dir/.db.~lock~
1ae1933f
AS
58if test "$IS_WIN32" = "no"; then
59 ln -s dir/db db
60 AT_SKIP_IF([test ! -h db])
61fi
1e19e50e 62AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
1ae1933f
AS
63if test "$IS_WIN32" = "no"; then
64 AT_CHECK([test ! -e .db.~lock])
65 AT_CHECK([test -h db])
66 AT_CHECK([test -f dir/db])
67fi
1e19e50e
BP
68dnl Do a bunch of random transactions that put crap in the database log.
69AT_CHECK(
70 [[for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do
71 set -- $pair
72 ovsdb-tool transact db '
73 ["ordinals",
74 {"op": "insert",
75 "table": "ordinals",
76 "row": {"name": "'$1'", "number": '$2'}},
77 {"op": "comment",
78 "comment": "add row for '"$pair"'"}]'
79 ovsdb-tool transact db '
80 ["ordinals",
81 {"op": "delete",
82 "table": "ordinals",
83 "where": [["number", "==", '$2']]},
84 {"op": "comment",
85 "comment": "delete row for '"$2"'"}]'
86 ovsdb-tool transact db '
87 ["ordinals",
88 {"op": "insert",
89 "table": "ordinals",
90 "row": {"name": "'$1'", "number": '$2'}},
91 {"op": "comment",
92 "comment": "add back row for '"$pair"'"}]'
93 done]],
94 [0], [stdout], [ignore])
95dnl Check that all the crap is in fact in the database log.
c724bd67 96AT_CHECK([[uuidfilt db | grep -v ^OVSDB | sed 's/"_date":[0-9]*/"_date":0/' | ovstest test-json --multiple -]], [0],
6910a6e6 97 [[{"cksum":"12345678 9","name":"ordinals","tables":{"ordinals":{"columns":{"name":{"type":"string"},"number":{"type":"integer"}},"indexes":[["number"]]}},"version":"5.1.3"}
e86dd676
BP
98{"_comment":"add row for zero 0","_date":0,"ordinals":{"<0>":{"name":"zero"}}}
99{"_comment":"delete row for 0","_date":0,"ordinals":{"<0>":null}}
100{"_comment":"add back row for zero 0","_date":0,"ordinals":{"<1>":{"name":"zero"}}}
101{"_comment":"add row for one 1","_date":0,"ordinals":{"<2>":{"name":"one","number":1}}}
102{"_comment":"delete row for 1","_date":0,"ordinals":{"<2>":null}}
103{"_comment":"add back row for one 1","_date":0,"ordinals":{"<3>":{"name":"one","number":1}}}
104{"_comment":"add row for two 2","_date":0,"ordinals":{"<4>":{"name":"two","number":2}}}
105{"_comment":"delete row for 2","_date":0,"ordinals":{"<4>":null}}
106{"_comment":"add back row for two 2","_date":0,"ordinals":{"<5>":{"name":"two","number":2}}}
107{"_comment":"add row for three 3","_date":0,"ordinals":{"<6>":{"name":"three","number":3}}}
108{"_comment":"delete row for 3","_date":0,"ordinals":{"<6>":null}}
109{"_comment":"add back row for three 3","_date":0,"ordinals":{"<7>":{"name":"three","number":3}}}
110{"_comment":"add row for four 4","_date":0,"ordinals":{"<8>":{"name":"four","number":4}}}
111{"_comment":"delete row for 4","_date":0,"ordinals":{"<8>":null}}
112{"_comment":"add back row for four 4","_date":0,"ordinals":{"<9>":{"name":"four","number":4}}}
113{"_comment":"add row for five 5","_date":0,"ordinals":{"<10>":{"name":"five","number":5}}}
114{"_comment":"delete row for 5","_date":0,"ordinals":{"<10>":null}}
115{"_comment":"add back row for five 5","_date":0,"ordinals":{"<11>":{"name":"five","number":5}}}
1e19e50e 116]])
1ae1933f 117
1e19e50e 118dnl Dump out and check the actual database contents.
1ae1933f
AS
119on_exit 'kill `cat ovsdb-server.pid`'
120AT_CHECK([[ovsdb-server --detach --pidfile --no-chdir --remote=punix:socket db]],
5a0e4aec 121 [0], [stdout], [ignore])
1ae1933f 122AT_CHECK([[ovsdb-client dump unix:socket ordinals]],
5a0e4aec 123 [0], [stdout], [ignore])
1ae1933f
AS
124OVS_APP_EXIT_AND_WAIT([ovsdb-server])
125
c724bd67 126AT_CHECK([uuidfilt stdout], [0], [dnl
370a11b9
BP
127ordinals table
128_uuid name number
1e19e50e 129------------------------------------ ----- ------
e51d0a1d
BP
130<0> five 5
131<1> four 4
132<2> one 1
133<3> three 3
134<4> two 2
135<5> zero 0
1e19e50e
BP
136])
137dnl Now compact the database in-place.
138touch .db.tmp.~lock~
139AT_CHECK([[ovsdb-tool compact db]], [0], [], [ignore])
a35ae81c
BP
140dnl Make sure that "db" is still a symlink to dir/db instead of getting
141dnl replaced by a regular file.
1ae1933f
AS
142if test "$IS_WIN32" = "no"; then
143 AT_CHECK([test ! -e .db.~lock])
144 AT_CHECK([test -h db])
145 AT_CHECK([test -f dir/db])
146fi
1e19e50e
BP
147dnl We can't fully re-check the contents of the database log, because the
148dnl order of the records is not predictable, but there should only be 4 lines
149dnl in it now.
150AT_CAPTURE_FILE([db])
e0c7697c 151AT_CHECK([test `wc -l < db` -eq 4])
1e19e50e 152dnl And check that the dumped data is the same too:
1ae1933f 153AT_CHECK([[ovsdb-server --detach --pidfile --no-chdir --remote=punix:socket db]],
5a0e4aec 154 [0], [stdout], [ignore])
1ae1933f 155AT_CHECK([[ovsdb-client dump unix:socket ordinals]],
5a0e4aec 156 [0], [stdout], [ignore])
1ae1933f
AS
157OVS_APP_EXIT_AND_WAIT([ovsdb-server])
158
c724bd67 159AT_CHECK([uuidfilt stdout], [0], [dnl
370a11b9
BP
160ordinals table
161_uuid name number
1e19e50e 162------------------------------------ ----- ------
e51d0a1d
BP
163<0> five 5
164<1> four 4
165<2> one 1
166<3> three 3
167<4> two 2
168<5> zero 0
1e19e50e
BP
169])
170AT_CLEANUP
171
172AT_SETUP([ovsdb-tool convert -- removing a column])
173AT_KEYWORDS([ovsdb file positive])
39ab07af 174ordinal_schema > schema
1e19e50e
BP
175AT_DATA([new-schema],
176 [[{"name": "ordinals",
177 "tables": {
178 "ordinals": {
179 "columns": {
180 "number": {"type": "integer"}}}}}
181]])
182touch .db.~lock~
183AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
184dnl Put some data in the database.
185AT_CHECK(
186 [[for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do
187 set -- $pair
188 ovsdb-tool transact db '
189 ["ordinals",
190 {"op": "insert",
191 "table": "ordinals",
192 "row": {"name": "'$1'", "number": '$2'}},
193 {"op": "comment",
194 "comment": "add row for '"$pair"'"}]'
195 done]],
196 [0], [stdout], [ignore])
197dnl Dump out and check the actual database contents.
10c119c3
GS
198AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
199 [0])
200AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
c724bd67 201AT_CHECK([uuidfilt stdout], [0], [dnl
370a11b9
BP
202ordinals table
203_uuid name number
1e19e50e 204------------------------------------ ----- ------
e51d0a1d
BP
205<0> five 5
206<1> four 4
207<2> one 1
208<3> three 3
209<4> two 2
210<5> zero 0
1e19e50e 211])
10c119c3 212OVS_APP_EXIT_AND_WAIT([ovsdb-server])
1e19e50e
BP
213dnl Now convert the database in-place.
214touch .db.tmp.~lock~
215AT_CHECK([[ovsdb-tool convert db new-schema]], [0], [], [ignore])
216dnl We can't fully re-check the contents of the database log, because the
217dnl order of the records is not predictable, but there should only be 4 lines
218dnl in it now.
219AT_CAPTURE_FILE([db])
e0c7697c 220AT_CHECK([test `wc -l < db` -eq 4])
1e19e50e 221dnl And check that the dumped data is the same except for the removed column:
10c119c3
GS
222AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
223 [0])
224AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
c724bd67 225AT_CHECK([uuidfilt stdout], [0], [dnl
370a11b9
BP
226ordinals table
227_uuid number
1e19e50e 228------------------------------------ ------
e51d0a1d
BP
229<0> 0
230<1> 1
231<2> 2
232<3> 3
233<4> 4
234<5> 5
1e19e50e 235])
10c119c3 236OVS_APP_EXIT_AND_WAIT([ovsdb-server])
1e19e50e
BP
237AT_CLEANUP
238
239AT_SETUP([ovsdb-tool convert -- adding a column])
240AT_KEYWORDS([ovsdb file positive])
241AT_DATA([schema],
242 [[{"name": "ordinals",
243 "tables": {
244 "ordinals": {
245 "columns": {
246 "number": {"type": "integer"}}}}}
247]])
39ab07af 248ordinal_schema > new-schema
1e19e50e
BP
249touch .db.~lock~
250AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
251dnl Put some data in the database.
252AT_CHECK(
253 [[for number in 0 1 2 3 4 5; do
254 ovsdb-tool transact db '
255 ["ordinals",
256 {"op": "insert",
257 "table": "ordinals",
258 "row": {"number": '$number'}},
259 {"op": "comment",
260 "comment": "add row for '"$number"'"}]'
261 done]],
262 [0], [stdout], [ignore])
263dnl Dump out and check the actual database contents.
10c119c3
GS
264AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
265 [0])
266AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
c724bd67 267AT_CHECK([uuidfilt stdout], [0], [dnl
370a11b9
BP
268ordinals table
269_uuid number
1e19e50e 270------------------------------------ ------
e51d0a1d
BP
271<0> 0
272<1> 1
273<2> 2
274<3> 3
275<4> 4
276<5> 5
1e19e50e 277])
10c119c3 278OVS_APP_EXIT_AND_WAIT([ovsdb-server])
1e19e50e
BP
279dnl Now convert the database in-place.
280touch .db.tmp.~lock~
281AT_CHECK([[ovsdb-tool convert db new-schema]], [0], [], [ignore])
282dnl We can't fully re-check the contents of the database log, because the
283dnl order of the records is not predictable, but there should only be 4 lines
284dnl in it now.
285AT_CAPTURE_FILE([db])
e0c7697c 286AT_CHECK([test `wc -l < db` -eq 4])
1e19e50e 287dnl And check that the dumped data is the same except for the added column:
10c119c3
GS
288AT_CHECK([[ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket db]],
289 [0])
290AT_CHECK([ovsdb-client dump unix:socket ordinals], [0], [stdout], [ignore])
c724bd67 291AT_CHECK([uuidfilt stdout], [0], [dnl
370a11b9
BP
292ordinals table
293_uuid name number
1e19e50e 294------------------------------------ ---- ------
e51d0a1d
BP
295<0> "" 0
296<1> "" 1
297<2> "" 2
298<3> "" 3
299<4> "" 4
300<5> "" 5
1e19e50e 301])
10c119c3 302OVS_APP_EXIT_AND_WAIT([ovsdb-server])
1e19e50e 303AT_CLEANUP
8159b984 304
1b1d2e6d
BP
305AT_SETUP([ovsdb-tool unsupported cluster operations])
306AT_KEYWORDS([ovsdb file negative compact query transact convert])
307ordinal_schema > schema
308AT_CHECK([ovsdb-tool create-cluster db schema unix:s1.raft])
309AT_CHECK([ovsdb-tool compact db], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
310])
311AT_CHECK([ovsdb-tool convert db schema], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
312])
313AT_CHECK([ovsdb-tool needs-conversion db schema], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
314])
315AT_CHECK([ovsdb-tool query db '[[]]'], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
316])
317AT_CHECK([ovsdb-tool transact db '[[]]'], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
318])
319AT_CLEANUP
320
439902cb
BP
321AT_SETUP([ovsdb-tool schema-version, schema-cksum, schema-name])
322AT_KEYWORDS([ovsdb file positive schema-version schema-cksum])
39ab07af 323ordinal_schema > schema
8159b984
BP
324AT_CHECK([ovsdb-tool schema-version schema], [0], [5.1.3
325])
6aa09313
BP
326AT_CHECK([ovsdb-tool schema-cksum schema], [0], [12345678 9
327])
439902cb
BP
328AT_CHECK([ovsdb-tool schema-name schema], [0], [ordinals
329])
6aa09313
BP
330AT_CLEANUP
331
1b1d2e6d
BP
332AT_SETUP([ovsdb-tool database inspection commands - standalone])
333AT_KEYWORDS([ovsdb file positive db-version db-cksum db-name db-cid db-sid db-local-address])
39ab07af 334ordinal_schema > schema
6aa09313
BP
335touch .db.~lock~
336AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
439902cb
BP
337AT_CHECK([ovsdb-tool db-version db], [0], [5.1.3
338])
6aa09313
BP
339AT_CHECK([ovsdb-tool db-cksum db], [0], [12345678 9
340])
439902cb
BP
341AT_CHECK([ovsdb-tool db-name db], [0], [ordinals
342])
1b1d2e6d
BP
343AT_CHECK([ovsdb-tool db-cid db], [1], [], [ovsdb-tool: db: not a clustered database
344])
345AT_CHECK([ovsdb-tool db-sid db], [1], [], [ovsdb-tool: db: not a clustered database
346])
347AT_CHECK([ovsdb-tool db-local-address db], [1], [], [ovsdb-tool: db: not a clustered database
348])
349AT_CLEANUP
350
351AT_SETUP([ovsdb-tool database inspection commands - clustered])
352AT_KEYWORDS([ovsdb file negative db-version db-cksum db-name db-cid db-sid db-local-address cluster])
353ordinal_schema > schema
354touch .db.~lock~
355AT_CHECK([ovsdb-tool create-cluster db schema tcp:1.2.3.4:1234])
356AT_CHECK([ovsdb-tool db-version db], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
357])
358AT_CHECK([ovsdb-tool db-cksum db], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
359])
360AT_CHECK([ovsdb-tool db-name db], [0], [ordinals
361])
362AT_CHECK([(ovsdb-tool db-cid db; ovsdb-tool db-sid db) | uuidfilt], [0], [<0>
363<1>
364])
365AT_CHECK([ovsdb-tool db-local-address db], [0], [tcp:1.2.3.4:1234
366])
367AT_CLEANUP
368
369AT_SETUP([ovsdb-tool database inspection commands - joining a cluster])
370AT_KEYWORDS([ovsdb file positive db-version db-cksum db-name db-cid db-sid db-local-address cluster join joining])
371ordinal_schema > schema
372touch .db.~lock~
373for cid in '' 520cf525-3772-43cc-8268-23bf5b548cf4; do
374 if test -z "$cid"; then
375 cid_option=
376 else
377 cid_option=--cid=$cid
378 fi
379 AT_CHECK([rm -f db && ovsdb-tool $cid_option join-cluster db ordinals tcp:1.2.3.4:1234 tcp:2.3.4.5:1234], [0], [], [ignore])
380 AT_CHECK([ovsdb-tool db-version db], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
381])
382 AT_CHECK([ovsdb-tool db-cksum db], [1], [], [ovsdb-tool: ovsdb error: db: cannot apply this operation to clustered database file
383])
384 AT_CHECK([ovsdb-tool db-name db], [0], [ordinals
385])
386 if test -z "$cid"; then
387 AT_CHECK([ovsdb-tool db-cid db], [2], [], [db: cluster ID not yet known
388])
389 else
390 AT_CHECK_UNQUOTED([ovsdb-tool db-cid db], [0], [$cid
391])
392 fi
393 AT_CHECK([ovsdb-tool db-sid db | uuidfilt], [0], [<0>
394])
395 AT_CHECK([ovsdb-tool db-local-address db], [0], [tcp:1.2.3.4:1234
396])
397done
6aa09313 398AT_CLEANUP
403e3a25
BP
399
400AT_SETUP([ovsdb-tool needs-conversion (no conversion needed)])
401AT_KEYWORDS([ovsdb file positive])
39ab07af 402ordinal_schema > schema
403e3a25
BP
403touch .db.~lock~
404AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
405AT_CHECK([ovsdb-tool needs-conversion db schema], [0], [no
406])
407AT_CLEANUP
408
409AT_SETUP([ovsdb-tool needs-conversion (conversion needed)])
410AT_KEYWORDS([ovsdb file positive])
39ab07af 411ordinal_schema > schema
403e3a25
BP
412touch .db.~lock~
413AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
414sed 's/5\.1\.3/5.1.4/' < schema > schema2
415AT_CHECK([diff schema schema2], [1], [ignore])
416AT_CHECK([ovsdb-tool needs-conversion db schema2], [0], [yes
417])
418AT_CLEANUP
1b1d2e6d
BP
419
420AT_SETUP([ovsdb-tool create-cluster with initial data])
421AT_KEYWORDS([ovsdb file positive])
422
423# Create a standalone database and put some data in it.
424ordinal_schema > schema
425ovsdb-tool create db1 schema
426AT_CHECK(
427 [[for pair in 'zero 0' 'one 1' 'two 2' 'three 3' 'four 4' 'five 5'; do
428 set -- $pair
429 ovsdb-tool transact db1 '
5a0e4aec
BP
430 ["ordinals",
431 {"op": "insert",
432 "table": "ordinals",
433 "row": {"name": "'$1'", "number": '$2'}},
434 {"op": "comment",
435 "comment": "add row for '"$pair"'"}]'
1b1d2e6d
BP
436 done | uuidfilt]], [0],
437[[[{"uuid":["uuid","<0>"]},{}]
438[{"uuid":["uuid","<1>"]},{}]
439[{"uuid":["uuid","<2>"]},{}]
440[{"uuid":["uuid","<3>"]},{}]
441[{"uuid":["uuid","<4>"]},{}]
442[{"uuid":["uuid","<5>"]},{}]
443]], [ignore])
444
445# Dump the data.
3915a9d3 446AT_CHECK([ovsdb-server -vfile -vvlog:off --detach --no-chdir --pidfile --log-file --remote=punix:db.sock db1])
1b1d2e6d
BP
447AT_CHECK([ovsdb-client dump > expout])
448OVS_APP_EXIT_AND_WAIT([ovsdb-server])
449
450# Create a clustered database from the standalone one.
451ovsdb-tool create-cluster db2 db1 unix:s1.raft
452
453# Dump the data.
3915a9d3 454AT_CHECK([ovsdb-server -vconsole:off -vfile -vvlog:off --detach --no-chdir --pidfile --log-file --remote=punix:db.sock db2])
d97af428 455AT_CHECK([ovsdb_client_wait ordinals connected])
1b1d2e6d
BP
456AT_CHECK([ovsdb-client dump > dump2])
457OVS_APP_EXIT_AND_WAIT([ovsdb-server])
458
459# Make sure that the clustered data matched the standalone data.
460AT_CHECK([cat dump2], [0], [expout])
461AT_CLEANUP
00de46f9
AG
462
463AT_SETUP([ovsdb-tool convert-to-standalone])
464AT_KEYWORDS([ovsdb file positive])
465ordinal_schema > schema
466AT_CHECK([ovsdb-tool create-cluster db schema unix:s1.raft], [0], [stdout], [ignore])
467AT_CHECK([ovsdb-server --detach --no-chdir --pidfile --remote=punix:socket --log-file db >/dev/null 2>&1])
468for txn in m4_foreach([txn], [[[["ordinals",
469 {"op": "insert",
470 "table": "ordinals",
471 "row": {"number": 0, "name": "zero"}},
472 {"op": "insert",
473 "table": "ordinals",
474 "row": {"number": 1, "name": "one"}},
475 {"op": "insert",
476 "table": "ordinals",
477 "row": {"number": 2, "name": "two"}}]]]], ['txn' ]); do
478AT_CHECK([ovsdb-client transact unix:socket "$txn"], [0], [ignore], [ignore])
479done
480AT_CHECK([ovsdb-client transact unix:socket '[["ordinals"]]'], [0],
481 [ignore], [ignore])
482AT_CHECK([ovsdb-client dump unix:socket > clusterdump])
483AT_CHECK([ovs-appctl -t ovsdb-server -e exit], [0], [ignore], [ignore])
484
485# Convert to standalone database from clustered database.
486AT_CHECK(ovsdb-tool cluster-to-standalone db1 db)
487
488# Check its standalone db
489AT_CHECK([ovsdb-tool db-is-standalone db1])
490
491# Dump the standalone db data.
492AT_CHECK([ovsdb-server -vconsole:off -vfile -vvlog:off --detach --no-chdir --pidfile --log-file --remote=punix:db.sock db1])
493AT_CHECK([ovsdb_client_wait ordinals connected])
494AT_CHECK([ovsdb-client dump > standalonedump])
495OVS_APP_EXIT_AND_WAIT([ovsdb-server])
496
497# Make sure both standalone and cluster db data matches.
498AT_CHECK([diff standalonedump clusterdump])
499AT_CLEANUP