dnl OVS_VSCTL_CLEANUP
dnl
dnl Kills off the database server.
-m4_define([OVS_VSCTL_CLEANUP], [test ! -e pid || kill `cat pid`])
+m4_define([OVS_VSCTL_CLEANUP], [OVSDB_SERVER_SHUTDOWN])
dnl RUN_OVS_VSCTL(COMMAND, ...)
dnl
AT_KEYWORDS([ovsdb server idl positive $5])
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
[0], [stdout], [ignore])
- AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --pidfile=$PWD/server-pid --remote=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
+ AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --pidfile=$PWD/pid --remote=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
m4_if([$2], [], [],
- [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat server-pid`])])
+ [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
- [0], [stdout], [ignore], [kill `cat server-pid`])
+ [0], [stdout], [ignore], [kill `cat pid`])
AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl], [0], [$4], [],
- [kill `cat server-pid`])
- kill `cat server-pid`
+ [kill `cat pid`])
+ OVSDB_SERVER_SHUTDOWN
AT_CLEANUP])
OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
AT_BANNER([OVSDB -- ovsdb-server transactions (Unix sockets)])
+m4_define([OVSDB_SERVER_SHUTDOWN],
+ [cp pid savepid
+ AT_CHECK([ovs-appctl -t $PWD/unixctl -e exit], [0], [ignore], [ignore])
+ OVS_WAIT_WHILE([kill -0 `cat savepid`], [kill `cat savepid`])])
+
# OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
#
# Creates a database with the given SCHEMA, starts an ovsdb-server on
])
AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [ignore],
[test ! -e pid || kill `cat pid`])
- test ! -e pid || kill `cat pid`
+ OVSDB_SERVER_SHUTDOWN
AT_CLEANUP])
EXECUTION_EXAMPLES
]],
[ignore],
[test ! -e pid || kill `cat pid`])
-test ! -e pid || kill `cat pid`
+OVSDB_SERVER_SHUTDOWN
AT_CLEANUP
\f
AT_BANNER([OVSDB -- ovsdb-server transactions (SSL sockets)])
])
AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [ignore],
[test ! -e pid || kill `cat pid`])
- test ! -e pid || kill `cat pid`
+ OVSDB_SERVER_SHUTDOWN
AT_CLEANUP])
EXECUTION_EXAMPLES