AT_BANNER([OVSDB -- file storage]) # OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS]) # # Creates a database with the given SCHEMA and runs each of the # TRANSACTIONS (which should be a quoted list of quoted strings) # against it with ovsdb-tool one at a time. # # Checks that the overall output is OUTPUT, but UUIDs in the output # are replaced by markers of the form where N is a number. The # first unique UUID is replaced by <0>, the next by <1>, and so on. # If a given UUID appears more than once it is always replaced by the # same marker. # # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS. m4_define([OVSDB_CHECK_EXECUTION], [AT_SETUP([$1]) AT_KEYWORDS([ovsdb file positive $5]) AT_DATA([schema], [$2 ]) touch .db.~lock~ AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore]) m4_foreach([txn], [$3], [AT_CHECK([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore]) cat stdout >> output ]) AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4]) AT_CLEANUP]) EXECUTION_EXAMPLES AT_SETUP([transaction comments]) AT_KEYWORDS([ovsdb file positive]) AT_DATA([schema], [ORDINAL_SCHEMA ]) touch .db.~lock~ AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore]) AT_CHECK([[ovsdb-tool transact db ' [{"op": "insert", "table": "ordinals", "row": {"name": "five", "number": 5}}, {"op": "comment", "comment": "add row for 5"}]']], [0], [stdout], [ignore]) AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [[[{"uuid":["uuid","<0>"]},{}] ]]) AT_CHECK([grep -q "add row for 5" db]) AT_CLEANUP