1 AT_BANNER([OVSDB -- ovsdb-server monitors])
3 # OVSDB_CHECK_MONITOR(TITLE, SCHEMA, [PRE-MONITOR-TXN], MONITOR-ARGS,
4 # TRANSACTIONS, OUTPUT, [KEYWORDS])
6 # Creates a database with the given SCHEMA, starts an ovsdb-server on
7 # that database, and runs each of the TRANSACTIONS (which should be a
8 # quoted list of quoted strings) against it with ovsdb-client one at a
11 # Checks that the overall output is OUTPUT, but UUIDs in the output
12 # are replaced by markers of the form <N> where N is a number. The
13 # first unique UUID is replaced by <0>, the next by <1>, and so on.
14 # If a given UUID appears more than once it is always replaced by the
17 # TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
18 m4_define([OVSDB_CHECK_MONITOR],
20 AT_KEYWORDS([ovsdb server monitor positive $7])
23 OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
25 [OVS_CHECK_LCOV([ovsdb-tool transact db '$2'], [0], [ignore], [ignore])])
26 AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db])
27 AT_CHECK([ovsdb-client monitor --format=csv unix:socket $4 > output & echo $! > monitor-pid],
28 [0], [ignore], [ignore], [kill `cat server-pid`])
29 m4_foreach([txn], [$5],
30 [OVS_CHECK_LCOV([ovsdb-client transact unix:socket 'txn'], [0],
31 [ignore], [ignore], [kill `cat server-pid monitor-pid`])])
32 AT_CHECK([ovs-appctl -t $PWD/unixctl -e exit], [0], [ignore], [ignore])
34 AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$6])
37 OVSDB_CHECK_MONITOR([monitor initially empty table],
43 "row": {"number": 0, "name": "zero"}}]]]],
44 [[row,action,name,number,_version
45 <0>,insert,"""zero""",0,"[""uuid"",""<1>""]"