1 AT_BANNER([OVSDB -- file storage])
3 # OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
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.
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
15 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
16 m4_define([OVSDB_CHECK_EXECUTION],
18 AT_KEYWORDS([ovsdb file positive $5])
22 OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
23 m4_foreach([txn], [$3],
24 [OVS_CHECK_LCOV([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore])
27 AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4])
32 AT_SETUP([transaction comments])
33 AT_KEYWORDS([ovsdb file positive])
34 AT_DATA([schema], [ORDINAL_SCHEMA
37 OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [], [ignore])
38 OVS_CHECK_LCOV([[ovsdb-tool transact db '
41 "row": {"name": "five", "number": 5}},
43 "comment": "add row for 5"}]']], [0], [stdout], [ignore])
44 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0],
45 [[[{"uuid":["uuid","<0>"]},{}]
47 AT_CHECK([grep -q "add row for 5" db])