AT_KEYWORDS([ovsdb server idl positive $5])
OVS_CHECK_LCOV([ovsdb-tool create db $abs_builddir/idltest.ovsschema],
[0], [stdout], [ignore])
- AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db])
+ AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
m4_if([$2], [], [],
[OVS_CHECK_LCOV([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat server-pid`])])
AT_CHECK([test-ovsdb -vjsonrpc -t10 idl unix:socket $3],
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
m4_foreach([txn], [$3],
[OVS_CHECK_LCOV([ovsdb-tool transact db 'txn'], [0], [ignore], [ignore])])
- AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db])
- AT_CHECK([ovsdb-client monitor --format=csv unix:socket $4 > output & echo $! > monitor-pid],
+ AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --listen=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
+ AT_CHECK([ovsdb-client --detach --pidfile=$PWD/client-pid monitor --format=csv unix:socket $4 > output],
[0], [ignore], [ignore], [kill `cat server-pid`])
m4_foreach([txn], [$5],
[OVS_CHECK_LCOV([ovsdb-client transact unix:socket 'txn'], [0],
- [ignore], [ignore], [kill `cat server-pid monitor-pid`])])
+ [ignore], [ignore], [kill `cat server-pid client-pid`])])
+ OVS_CHECK_LCOV([ovsdb-client transact unix:socket '[[]]'], [0],
+ [ignore], [ignore], [kill `cat server-pid client-pid`])
AT_CHECK([ovs-appctl -t $PWD/unixctl -e exit], [0], [ignore], [ignore])
- wait
- AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$6])
+ OVS_WAIT_UNTIL([test ! -e server-pid && test ! -e client-pid && exit 0])
+ AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$6], [ignore])
AT_CLEANUP])
OVSDB_CHECK_MONITOR([monitor insert into empty table],
AT_DATA([schema], [$2
])
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
- AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --listen=punix:socket --unixctl=$PWD/unixctl db])
+ AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --listen=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
m4_foreach([txn], [$3],
[OVS_CHECK_LCOV([ovsdb-client transact unix:socket 'txn'], [0], [stdout], [ignore],
[test ! -e pid || kill `cat pid`])
cat stdout >> output
])
- AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [],
+ AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [ignore],
[test ! -e pid || kill `cat pid`])
test ! -e pid || kill `cat pid`
AT_CLEANUP])
AT_TESTED([ovs-vsctl])
AT_TESTED([perl])
+m4_define([OVS_WAIT_UNTIL],
+ [AT_CHECK(
+ [# First try a quick sleep, so that the test completes very quickly
+ # in the normal case. POSIX doesn't require fractional times to
+ # work, so this might not work.
+ sleep 0.1
+ $1
+ # Then wait up to 10 seconds.
+ for d in 0 1 2 3 4 5 6 7 8 9; do
+ sleep 1
+ $1
+ done
+ exit 1], [0], [ignore], [ignore])])
+
m4_include([tests/lcov-pre.at])
m4_include([tests/library.at])
m4_include([tests/dir_name.at])