mirror of
https://github.com/openvswitch/ovs
synced 2025-08-22 01:51:26 +00:00
Rework and simplify the "lcov" support for the testsuite.
This commit is contained in:
parent
a778696338
commit
7c126fbb8a
19
README-gcov
19
README-gcov
@ -15,17 +15,10 @@ code-coverage related options:
|
||||
--enable-coverage
|
||||
--enable-coverage=yes
|
||||
|
||||
Build with gcov code coverage support, but do not assume that any
|
||||
coverage-related tools are installed and do not add special
|
||||
coverage support to the test suite.
|
||||
Build with gcov code coverage support.
|
||||
|
||||
--enable-coverage=lcov
|
||||
|
||||
Build with gcov code coverage support, as above, but also add
|
||||
support for coverage analysis to the test suite. Running "make
|
||||
check" will produce a directory "tests/coverage.html" in the build
|
||||
directory with an analysis of the test suite's coverage.
|
||||
|
||||
This setting requires the lcov suite of utilities to be installed.
|
||||
The "lcov" and "genhtml" programs from lcov must be in PATH. lcov
|
||||
is available at: http://ltp.sourceforge.net/coverage/lcov.php
|
||||
If you enable coverage and you have the "lcov" and "genhtml"
|
||||
programs in PATH, then you may run "make check-lcov" to produce a
|
||||
directory "tests/coverage.html" in the build directory with an
|
||||
analysis of the test suite's coverage. lcov is available at
|
||||
http://ltp.sourceforge.net/coverage/lcov.php
|
||||
|
@ -22,22 +22,15 @@ AC_DEFUN([OVS_CHECK_COVERAGE],
|
||||
[AC_HELP_STRING([--enable-coverage],
|
||||
[Enable gcov coverage tool.])],
|
||||
[case "${enableval}" in
|
||||
(lcov) coverage=true lcov=true ;;
|
||||
(yes) coverage=true lcov=false ;;
|
||||
(no) coverage=false lcov=false ;;
|
||||
(lcov|yes) coverage=true ;;
|
||||
(no) coverage=false ;;
|
||||
(*) AC_MSG_ERROR([bad value ${enableval} for --enable-coverage]) ;;
|
||||
esac],
|
||||
[coverage=false lcov=false])
|
||||
[coverage=false])
|
||||
if $coverage; then
|
||||
CFLAGS="$CFLAGS -O0 --coverage"
|
||||
LDFLAGS="$LDFLAGS --coverage"
|
||||
fi
|
||||
if $lcov; then
|
||||
if lcov --version >/dev/null 2>&1; then :; else
|
||||
AC_MSG_ERROR([--enable-coverage=lcov was specified but lcov is not in \$PATH])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([LCOV], [$lcov])])
|
||||
fi])
|
||||
|
||||
dnl Checks for --enable-ndebug and defines NDEBUG if it is specified.
|
||||
AC_DEFUN([OVS_CHECK_NDEBUG],
|
||||
|
@ -3,7 +3,7 @@ AT_BANNER([AES-128 unit tests])
|
||||
m4_define([AES128_CHECK],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([aes128])
|
||||
OVS_CHECK_LCOV([test-aes128 $2 $3], [0], [$4
|
||||
AT_CHECK([test-aes128 $2 $3], [0], [$4
|
||||
], [])
|
||||
AT_CLEANUP])
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
# -*- shell-script -*-
|
||||
HAVE_OPENSSL='@HAVE_OPENSSL@'
|
||||
HAVE_PYTHON='@HAVE_PYTHON@'
|
||||
LCOV='@LCOV@'
|
||||
PERL='@PERL@'
|
||||
PYTHON='@PYTHON@'
|
||||
|
@ -7,7 +7,6 @@ EXTRA_DIST += \
|
||||
TESTSUITE_AT = \
|
||||
tests/testsuite.at \
|
||||
tests/ovsdb-macros.at \
|
||||
tests/lcov-pre.at \
|
||||
tests/library.at \
|
||||
tests/check-structs.at \
|
||||
tests/daemon.at \
|
||||
@ -38,14 +37,64 @@ TESTSUITE_AT = \
|
||||
tests/ovsdb-monitor.at \
|
||||
tests/ovsdb-idl.at \
|
||||
tests/stp.at \
|
||||
tests/ovs-vsctl.at \
|
||||
tests/lcov-post.at
|
||||
tests/ovs-vsctl.at
|
||||
TESTSUITE = $(srcdir)/tests/testsuite
|
||||
DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
|
||||
|
||||
check-local: tests/atconfig tests/atlocal $(TESTSUITE)
|
||||
$(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH='utilities:vswitchd:ovsdb:tests' $(TESTSUITEFLAGS)
|
||||
AUTOTEST_PATH = utilities:vswitchd:ovsdb:tests
|
||||
|
||||
check-local: tests/atconfig tests/atlocal $(TESTSUITE)
|
||||
$(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
|
||||
|
||||
# lcov support
|
||||
|
||||
lcov_wrappers = \
|
||||
tests/lcov/ovs-appctl \
|
||||
tests/lcov/ovs-vsctl \
|
||||
tests/lcov/ovsdb-client \
|
||||
tests/lcov/ovsdb-server \
|
||||
tests/lcov/ovsdb-tool \
|
||||
tests/lcov/test-aes128 \
|
||||
tests/lcov/test-classifier \
|
||||
tests/lcov/test-csum \
|
||||
tests/lcov/test-dhcp-client \
|
||||
tests/lcov/test-dir_name \
|
||||
tests/lcov/test-flows \
|
||||
tests/lcov/test-hash \
|
||||
tests/lcov/test-hmap \
|
||||
tests/lcov/test-json \
|
||||
tests/lcov/test-jsonrpc \
|
||||
tests/lcov/test-list \
|
||||
tests/lcov/test-lockfile \
|
||||
tests/lcov/test-ovsdb \
|
||||
tests/lcov/test-reconnect \
|
||||
tests/lcov/test-sha1 \
|
||||
tests/lcov/test-stp \
|
||||
tests/lcov/test-timeval \
|
||||
tests/lcov/test-type-props \
|
||||
tests/lcov/test-uuid \
|
||||
tests/lcov/test-vconn
|
||||
|
||||
$(lcov_wrappers): tests/lcov-wrapper.in
|
||||
@test -d tests/lcov || mkdir tests/lcov
|
||||
sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
|
||||
-e 's,[@]wrap_program[@],$@,' \
|
||||
$(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
|
||||
chmod +x $@.tmp
|
||||
mv $@.tmp $@
|
||||
CLEANFILES += $(lcov_wrappers)
|
||||
EXTRA_DIST += tests/lcov-wrapper.in
|
||||
|
||||
LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
|
||||
check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
|
||||
rm -fr tests/coverage.html tests/coverage.info
|
||||
$(LCOV) -c -i -o - > tests/coverage.info
|
||||
$(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
|
||||
rc=$$?; \
|
||||
echo "Producing coverage.html..."; \
|
||||
cd tests && genhtml -q -o coverage.html coverage.info; \
|
||||
exit $$rc
|
||||
|
||||
clean-local:
|
||||
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
AT_BANNER([daemon unit tests])
|
||||
|
||||
AT_SETUP([daemon])
|
||||
AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
|
||||
OVSDB_INIT([db])
|
||||
AT_CAPTURE_FILE([pid])
|
||||
AT_CAPTURE_FILE([expected])
|
||||
@ -19,6 +20,7 @@ AT_CHECK([test ! -e pid])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([daemon --monitor])
|
||||
AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
|
||||
OVSDB_INIT([db])
|
||||
AT_CAPTURE_FILE([pid])
|
||||
AT_CAPTURE_FILE([parent])
|
||||
@ -62,6 +64,7 @@ OVS_WAIT_WHILE([kill -0 `cat parent` || kill -0 `cat newpid` || test -e pid],
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([daemon --detach])
|
||||
AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
|
||||
AT_CAPTURE_FILE([pid])
|
||||
OVSDB_INIT([db])
|
||||
# Start the daemon and make sure that the pidfile exists immediately.
|
||||
@ -78,6 +81,7 @@ AT_CHECK([test ! -e pid])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([daemon --detach --monitor])
|
||||
AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov wrapper make pids differ
|
||||
m4_define([CHECK],
|
||||
[AT_CHECK([$1], [$2], [$3], [$4], [kill `cat daemon monitor`])])
|
||||
OVSDB_INIT([db])
|
||||
@ -129,7 +133,7 @@ AT_CLEANUP
|
||||
AT_SETUP([daemon --detach startup errors])
|
||||
AT_CAPTURE_FILE([pid])
|
||||
OVSDB_INIT([db])
|
||||
OVS_CHECK_LCOV([ovsdb-server --detach --pidfile=$PWD/pid --unixctl=$PWD/nonexistent/unixctl db], [1], [], [stderr])
|
||||
AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --unixctl=$PWD/nonexistent/unixctl db], [1], [], [stderr])
|
||||
AT_CHECK([grep 'ovsdb-server: could not initialize control socket' stderr],
|
||||
[0], [ignore], [])
|
||||
AT_CHECK([test ! -s pid])
|
||||
@ -138,7 +142,7 @@ AT_CLEANUP
|
||||
AT_SETUP([daemon --detach --monitor startup errors])
|
||||
AT_CAPTURE_FILE([pid])
|
||||
OVSDB_INIT([db])
|
||||
OVS_CHECK_LCOV([ovsdb-server --detach --pidfile=$PWD/pid --monitor --unixctl=$PWD/nonexistent/unixctl db], [1], [], [stderr])
|
||||
AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --monitor --unixctl=$PWD/nonexistent/unixctl db], [1], [], [stderr])
|
||||
AT_CHECK([grep 'ovsdb-server: could not initialize control socket' stderr],
|
||||
[0], [ignore], [])
|
||||
AT_CHECK([test ! -s pid])
|
||||
|
@ -3,7 +3,7 @@ AT_BANNER([test dir_name function])
|
||||
m4_define([CHECK_DIR_NAME],
|
||||
[AT_SETUP([dir_name("$1") returns "$2"])
|
||||
AT_KEYWORDS([dir_name])
|
||||
OVS_CHECK_LCOV([test-dir_name "AS_ESCAPE($1)"], [0], [$2
|
||||
AT_CHECK([test-dir_name "AS_ESCAPE($1)"], [0], [$2
|
||||
])
|
||||
AT_CLEANUP])
|
||||
|
||||
|
@ -3,7 +3,7 @@ m4_define([JSON_CHECK_POSITIVE],
|
||||
AT_KEYWORDS([json positive])
|
||||
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
|
||||
AT_CAPTURE_FILE([input])
|
||||
OVS_CHECK_LCOV([test-json $4 input], [0], [stdout], [])
|
||||
AT_CHECK([test-json $4 input], [0], [stdout], [])
|
||||
AT_CHECK([cat stdout], [0], [$3
|
||||
])
|
||||
AT_CLEANUP])
|
||||
@ -13,7 +13,7 @@ m4_define([JSON_CHECK_NEGATIVE],
|
||||
AT_KEYWORDS([json negative])
|
||||
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
|
||||
AT_CAPTURE_FILE([input])
|
||||
OVS_CHECK_LCOV([test-json $4 input], [1], [stdout], [])
|
||||
AT_CHECK([test-json $4 input], [1], [stdout], [])
|
||||
AT_CHECK([[sed 's/^error: [^:]*:/error:/' < stdout]], [0], [$3
|
||||
])
|
||||
AT_CLEANUP])
|
||||
|
@ -28,7 +28,7 @@ AT_CHECK([test -s pid])
|
||||
# When a daemon dies it deletes its pidfile, so make a copy.
|
||||
AT_CHECK([cp pid pid2])
|
||||
AT_CHECK([kill -0 `cat pid2`])
|
||||
OVS_CHECK_LCOV([[test-jsonrpc notify unix:socket shutdown '[]']], [0], [],
|
||||
AT_CHECK([[test-jsonrpc notify unix:socket shutdown '[]']], [0], [],
|
||||
[ignore], [kill `cat pid2`])
|
||||
AT_CHECK(
|
||||
[pid=`cat pid2`
|
||||
|
@ -1,6 +0,0 @@
|
||||
AT_BANNER([code coverage])
|
||||
|
||||
AT_SETUP([generate coverage.html with lcov])
|
||||
AT_CHECK([$LCOV || exit 77])
|
||||
AT_CHECK([cd $abs_builddir && genhtml -o coverage.html coverage.info], [0], [ignore], [ignore])
|
||||
AT_CLEANUP
|
@ -1,21 +0,0 @@
|
||||
AT_BANNER([code coverage])
|
||||
|
||||
m4_define([_OVS_RUN_LCOV], [test $LCOV = false || lcov -b $abs_top_builddir -d $abs_top_builddir $1])
|
||||
|
||||
AT_SETUP([initialize lcov])
|
||||
AT_CHECK([rm -fr $abs_builddir/coverage.html])
|
||||
AT_CHECK([rm -f $abs_builddir/coverage.info])
|
||||
AT_CHECK([$LCOV || exit 77])
|
||||
AT_CHECK([_OVS_RUN_LCOV([-c -i -o - > $abs_builddir/coverage.info])], [0], [ignore], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
# OVS_CHECK_LCOV(COMMAND, [STATUS = `0'], [STDOUT = `'], [STDERR = `'],
|
||||
# [RUN-IF-FAIL], [RUN-IF-PASS])
|
||||
#
|
||||
# This macro is equivalent to AT_CHECK, except that COMMAND should be a single
|
||||
# shell command that invokes a program whose code coverage is to be measured
|
||||
# (if configure was invoked with --coverage).
|
||||
m4_define([OVS_CHECK_LCOV],
|
||||
[AT_CHECK([_OVS_RUN_LCOV([-z])], [0], [ignore], [ignore])
|
||||
AT_CHECK($@)
|
||||
AT_CHECK([_OVS_RUN_LCOV([-c -o - >> $abs_builddir/coverage.info])], [0], [ignore], [ignore])])
|
58
tests/lcov-wrapper.in
Executable file
58
tests/lcov-wrapper.in
Executable file
@ -0,0 +1,58 @@
|
||||
#! /bin/sh
|
||||
|
||||
abs_top_builddir='@abs_top_builddir@'
|
||||
wrap_program=`basename '@wrap_program@'`
|
||||
|
||||
# Strip the first directory from $PATH that contains $wrap_program,
|
||||
# so that below we run the real $wrap_program, not ourselves.
|
||||
not_found=true
|
||||
new_path=
|
||||
first=true
|
||||
save_IFS=$IFS
|
||||
IFS=:
|
||||
for dir in $PATH; do
|
||||
IFS=$save_IFS
|
||||
if $not_found && test -x "$dir/$wrap_program"; then
|
||||
not_found=false
|
||||
else
|
||||
if $first; then
|
||||
first=false
|
||||
new_path=$dir
|
||||
else
|
||||
new_path=$new_path:$dir
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
if $not_found; then
|
||||
echo "$0: error: cannot find $wrap_program in \$PATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
PATH=$new_path
|
||||
export PATH
|
||||
|
||||
# XXX Probably want some kind of synchronization here to deal with
|
||||
# programs running in parallel.
|
||||
LCOV="lcov -b $abs_top_builddir -d $abs_top_builddir -q"
|
||||
$LCOV -z
|
||||
|
||||
# Run the subprocess and propagate signals to it.
|
||||
for signal in 1 2 3 5 15; do
|
||||
trap "kill -$signal \$! # Propagate signal
|
||||
trap - $signal # Reset signal to default
|
||||
wait # Wait for child to die
|
||||
kill -$signal $$ # Kill ourselves with same signal
|
||||
exit 1 # Exit in case 'kill' failed" $signal
|
||||
done
|
||||
$wrap_program 0<&0 "$@" & # 0<&0 prevents shell from closing stdin
|
||||
exec 0</dev/null # Don't hold stdin open unnecessarily
|
||||
wait $!; rc=$?
|
||||
|
||||
# Run lcov, but only if some .gcda files were produced, since lcov
|
||||
# complains otherwise.
|
||||
for file in `find "$abs_top_builddir" -name '*.gcda'`; do
|
||||
$LCOV -c -o - >> "$abs_top_builddir/tests/coverage.info"
|
||||
break
|
||||
done
|
||||
|
||||
exit $rc
|
@ -2,35 +2,35 @@ AT_BANNER([library unit tests])
|
||||
|
||||
AT_SETUP([test flow extractor])
|
||||
AT_CHECK([$PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap])
|
||||
OVS_CHECK_LCOV([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
|
||||
AT_CHECK([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
|
||||
])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test TCP/IP checksumming])
|
||||
OVS_CHECK_LCOV([test-csum], [0], [ignore])
|
||||
AT_CHECK([test-csum], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test flow classifier])
|
||||
AT_KEYWORDS([slow])
|
||||
OVS_CHECK_LCOV([test-classifier], [0], [ignore])
|
||||
AT_CHECK([test-classifier], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test hash functions])
|
||||
OVS_CHECK_LCOV([test-hash], [0], [ignore])
|
||||
AT_CHECK([test-hash], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test hash map])
|
||||
OVS_CHECK_LCOV([test-hmap], [0], [ignore])
|
||||
AT_CHECK([test-hmap], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test linked lists])
|
||||
OVS_CHECK_LCOV([test-list], [0], [ignore])
|
||||
AT_CHECK([test-list], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test SHA-1])
|
||||
OVS_CHECK_LCOV([test-sha1], [0], [ignore])
|
||||
AT_CHECK([test-sha1], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([test type properties])
|
||||
OVS_CHECK_LCOV([test-type-props], [0], [ignore])
|
||||
AT_CHECK([test-type-props], [0], [ignore])
|
||||
AT_CLEANUP
|
||||
|
@ -3,7 +3,7 @@ AT_BANNER([lockfile unit tests])
|
||||
m4_define([CHECK_LOCKFILE],
|
||||
[AT_SETUP([m4_translit([$1], [_], [ ])])
|
||||
AT_KEYWORDS([lockfile])
|
||||
OVS_CHECK_LCOV([test-lockfile $1], [0], [$1: success (m4_if(
|
||||
AT_CHECK([test-lockfile $1], [0], [$1: success (m4_if(
|
||||
[$2], [1], [$2 child], [$2 children]))
|
||||
])
|
||||
AT_CLEANUP])
|
||||
|
@ -74,7 +74,7 @@ OVSDB_CHECK_POSITIVE([conditions on scalars],
|
||||
|
||||
AT_SETUP([disallowed conditions on scalars])
|
||||
AT_KEYWORDS([ovsdb negative condition])
|
||||
OVS_CHECK_LCOV([[test-ovsdb parse-conditions \
|
||||
AT_CHECK([[test-ovsdb parse-conditions \
|
||||
'{"columns":
|
||||
{"i": {"type": "integer"},
|
||||
"r": {"type": "real"},
|
||||
|
@ -23,7 +23,7 @@ m4_define([ORDINAL_SCHEMA],
|
||||
m4_define([OVSDB_CHECK_EXECUTION],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([ovsdb execute execution positive $5])
|
||||
OVS_CHECK_LCOV([test-ovsdb execute '$2' m4_foreach([txn], [$3], [ 'txn'])],
|
||||
AT_CHECK([test-ovsdb execute '$2' m4_foreach([txn], [$3], [ 'txn'])],
|
||||
[0], [stdout], [])
|
||||
AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [$4])
|
||||
AT_CLEANUP])
|
||||
|
@ -19,9 +19,9 @@ m4_define([OVSDB_CHECK_EXECUTION],
|
||||
AT_DATA([schema], [$2
|
||||
])
|
||||
touch .db.~lock~
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
m4_foreach([txn], [$3],
|
||||
[OVS_CHECK_LCOV([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore])
|
||||
[AT_CHECK([ovsdb-tool transact db 'txn'], [0], [stdout], [ignore])
|
||||
cat stdout >> output
|
||||
])
|
||||
AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4])
|
||||
@ -34,8 +34,8 @@ AT_KEYWORDS([ovsdb file positive])
|
||||
AT_DATA([schema], [ORDINAL_SCHEMA
|
||||
])
|
||||
touch .db.~lock~
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [], [ignore])
|
||||
OVS_CHECK_LCOV([[ovsdb-tool transact db '
|
||||
AT_CHECK([ovsdb-tool create db schema], [0], [], [ignore])
|
||||
AT_CHECK([[ovsdb-tool transact db '
|
||||
[{"op": "insert",
|
||||
"table": "ordinals",
|
||||
"row": {"name": "five", "number": 5}},
|
||||
|
@ -17,11 +17,11 @@ AT_BANNER([OVSDB -- interface description language (IDL)])
|
||||
m4_define([OVSDB_CHECK_IDL],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([ovsdb server idl positive $5])
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
|
||||
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])
|
||||
m4_if([$2], [], [],
|
||||
[OVS_CHECK_LCOV([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 server-pid`])])
|
||||
AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
|
||||
[0], [stdout], [ignore], [kill `cat server-pid`])
|
||||
AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl], [0], [$4], [],
|
||||
|
@ -3,11 +3,11 @@ AT_BANNER([OVSDB -- logging])
|
||||
AT_SETUP([create empty, reread])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([log])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_CREAT|O_RDWR'], [0],
|
||||
[file: open successful
|
||||
], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read], [0],
|
||||
[file: open successful
|
||||
file: read: end of log
|
||||
@ -18,12 +18,12 @@ AT_CLEANUP
|
||||
AT_SETUP([write one, reread])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -35,17 +35,17 @@ AT_CLEANUP
|
||||
AT_SETUP([check that O_EXCL works])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[1]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[1] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read], [0],
|
||||
[[file: open successful
|
||||
file: read: [1]
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_CREAT|O_RDWR|O_EXCL' read], [1],
|
||||
[], [test-ovsdb: I/O error: create: file failed (File exists)
|
||||
])
|
||||
@ -55,14 +55,14 @@ AT_CLEANUP
|
||||
AT_SETUP([write one, reread])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
file: write:[1] successful
|
||||
file: write:[2] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -76,14 +76,14 @@ AT_CLEANUP
|
||||
AT_SETUP([write one, reread, append])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
file: write:[1] successful
|
||||
file: write:[2] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_RDWR' read read read 'write:["append"]']], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -91,7 +91,7 @@ file: read: [1]
|
||||
file: read: [2]
|
||||
file: write:["append"] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -106,20 +106,20 @@ AT_CLEANUP
|
||||
AT_SETUP([write, reread one, overwrite])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
file: write:[1] successful
|
||||
file: write:[2] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_RDWR' read 'write:["more data"]']], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
file: write:["more data"] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -132,7 +132,7 @@ AT_CLEANUP
|
||||
AT_SETUP([write, add corrupted data, read])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
@ -140,7 +140,7 @@ file: write:[1] successful
|
||||
file: write:[2] successful
|
||||
]], [ignore])
|
||||
AT_CHECK([echo 'xxx' >> file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -154,7 +154,7 @@ AT_CLEANUP
|
||||
AT_SETUP([write, add corrupted data, read, overwrite])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
@ -162,7 +162,7 @@ file: write:[1] successful
|
||||
file: write:[2] successful
|
||||
]], [ignore])
|
||||
AT_CHECK([echo 'xxx' >> file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_RDWR' read read read read 'write:[3]']], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -171,7 +171,7 @@ file: read: [2]
|
||||
file: read failed: syntax error: file: parse error at offset 174 in header line "xxx"
|
||||
file: write:[3] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -186,7 +186,7 @@ AT_CLEANUP
|
||||
AT_SETUP([write, corrupt some data, read, overwrite])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
@ -197,7 +197,7 @@ AT_CHECK([[sed 's/\[2]/[3]/' < file > file.tmp]])
|
||||
AT_CHECK([mv file.tmp file])
|
||||
AT_CHECK([[grep -c '\[3]' file]], [0], [1
|
||||
])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_RDWR' read read read 'write:["longer data"]']], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -205,7 +205,7 @@ file: read: [1]
|
||||
file: read failed: syntax error: file: 4 bytes starting at offset 170 have SHA-1 hash 5c031e5c0d3a9338cc127ebe40bb2748b6a67e78 but should have hash 98f55556e7ffd432381b56a19bd485b3e6446442
|
||||
file: write:["longer data"] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -219,7 +219,7 @@ AT_CLEANUP
|
||||
AT_SETUP([write, truncate file, read, overwrite])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
@ -230,7 +230,7 @@ AT_CHECK([[sed 's/\[2]/2/' < file > file.tmp]])
|
||||
AT_CHECK([mv file.tmp file])
|
||||
AT_CHECK([[grep -c '^2$' file]], [0], [1
|
||||
])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_RDWR' read read read 'write:["longer data"]']], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -238,7 +238,7 @@ file: read: [1]
|
||||
file: read failed: I/O error: file: error reading 4 bytes starting at offset 170 (unexpected end of file)
|
||||
file: write:["longer data"] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -252,7 +252,7 @@ AT_CLEANUP
|
||||
AT_SETUP([write bad JSON, read, overwrite])
|
||||
AT_KEYWORDS([ovsdb log])
|
||||
AT_CAPTURE_FILE([file])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_CREAT|O_RDWR' 'write:[0]' 'write:[1]' 'write:[2]']], [0],
|
||||
[[file: open successful
|
||||
file: write:[0] successful
|
||||
@ -260,7 +260,7 @@ file: write:[1] successful
|
||||
file: write:[2] successful
|
||||
]], [ignore])
|
||||
AT_CHECK([[printf '%s\n%s\n' 'OVSDB JSON 5 d910b02871075d3156ec8675dfc95b7d5d640aa6' 'null' >> file]])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[test-ovsdb log-io file 'O_RDWR' read read read read 'write:["replacement data"]']], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
@ -269,7 +269,7 @@ file: read: [2]
|
||||
file: read failed: syntax error: file: 5 bytes starting at offset 228 are not valid JSON (line 1, column 0, byte 5: syntax error at beginning of input)
|
||||
file: write:["replacement data"] successful
|
||||
]], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[test-ovsdb log-io file 'O_RDONLY' read read read read read], [0],
|
||||
[[file: open successful
|
||||
file: read: [0]
|
||||
|
@ -2,10 +2,10 @@ dnl OVSDB_INIT([$1])
|
||||
dnl
|
||||
dnl Creates an empty database named $1.
|
||||
m4_define([OVSDB_INIT],
|
||||
[OVS_CHECK_LCOV(
|
||||
[AT_CHECK(
|
||||
[ovsdb-tool create $1 $abs_top_srcdir/vswitchd/vswitch.ovsschema],
|
||||
[0], [stdout], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[ovsdb-tool transact $1 \
|
||||
'[{"op": "insert",
|
||||
"table": "Open_vSwitch",
|
||||
|
@ -20,17 +20,17 @@ m4_define([OVSDB_CHECK_MONITOR],
|
||||
AT_KEYWORDS([ovsdb server monitor positive $7])
|
||||
AT_DATA([schema], [$2
|
||||
])
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
AT_CHECK([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-tool transact db 'txn'], [0], [ignore], [ignore])])
|
||||
AT_CHECK([ovsdb-server --detach --pidfile=$PWD/server-pid --remote=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],
|
||||
[AT_CHECK([ovsdb-client transact unix:socket 'txn'], [0],
|
||||
[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([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])
|
||||
OVS_WAIT_UNTIL([test ! -e server-pid && test ! -e client-pid])
|
||||
AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$6], [ignore])
|
||||
|
@ -36,7 +36,7 @@ OVSDB_CHECK_POSITIVE([mutations on scalars],
|
||||
|
||||
AT_SETUP([disallowed mutations on scalars])
|
||||
AT_KEYWORDS([ovsdb negative mutation])
|
||||
OVS_CHECK_LCOV([[test-ovsdb parse-mutations \
|
||||
AT_CHECK([[test-ovsdb parse-mutations \
|
||||
'{"columns":
|
||||
{"i": {"type": "integer"},
|
||||
"r": {"type": "real"},
|
||||
|
@ -19,10 +19,10 @@ m4_define([OVSDB_CHECK_EXECUTION],
|
||||
AT_KEYWORDS([ovsdb server positive $5])
|
||||
AT_DATA([schema], [$2
|
||||
])
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --remote=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],
|
||||
[AT_CHECK([ovsdb-client transact unix:socket 'txn'], [0], [stdout], [ignore],
|
||||
[test ! -e pid || kill `cat pid`])
|
||||
cat stdout >> output
|
||||
])
|
||||
@ -42,14 +42,14 @@ AT_DATA([schema],
|
||||
"columns": {
|
||||
"manager": {"type": "string"}}}}}
|
||||
]])
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [ignore], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK([ovsdb-tool create db schema], [0], [ignore], [ignore])
|
||||
AT_CHECK(
|
||||
[[ovsdb-tool transact db \
|
||||
'[{"op": "insert",
|
||||
"table": "Manager",
|
||||
"row": {"manager": "punix:socket"}}]']], [0], [ignore], [ignore])
|
||||
AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --remote=db:Manager,manager --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
|
||||
OVS_CHECK_LCOV(
|
||||
AT_CHECK(
|
||||
[[ovsdb-client transact unix:socket \
|
||||
'[{"op": "select",
|
||||
"table": "Manager",
|
||||
@ -91,10 +91,10 @@ m4_define([OVSDB_CHECK_EXECUTION],
|
||||
])
|
||||
SSL_PORT=`expr 32767 + \( $RANDOM % 32767 \)`
|
||||
PKIDIR=$abs_top_srcdir/tests
|
||||
OVS_CHECK_LCOV([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
|
||||
AT_CHECK([ovsdb-server --detach --pidfile=$PWD/pid --private-key=$PKIDIR/testpki-privkey2.pem --certificate=$PKIDIR/testpki-cert2.pem --ca-cert=$PKIDIR/testpki-cacert.pem --remote=pssl:$SSL_PORT:127.0.0.1 --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
|
||||
m4_foreach([txn], [$3],
|
||||
[OVS_CHECK_LCOV([ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT 'txn'], [0], [stdout], [ignore],
|
||||
[AT_CHECK([ovsdb-client --private-key=$PKIDIR/testpki-privkey.pem --certificate=$PKIDIR/testpki-cert.pem --ca-cert=$PKIDIR/testpki-cacert.pem transact ssl:127.0.0.1:$SSL_PORT 'txn'], [0], [stdout], [ignore],
|
||||
[test ! -e pid || kill `cat pid`])
|
||||
cat stdout >> output
|
||||
])
|
||||
|
@ -8,7 +8,7 @@ AT_BANNER([OVSDB -- triggers])
|
||||
m4_define([OVSDB_CHECK_TRIGGER],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([ovsdb execute execution trigger positive $4])
|
||||
OVS_CHECK_LCOV([test-ovsdb trigger $2], [0], [stdout], [])
|
||||
AT_CHECK([test-ovsdb trigger $2], [0], [stdout], [])
|
||||
AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [$3])
|
||||
AT_CLEANUP])
|
||||
|
||||
|
@ -11,7 +11,7 @@ m4_define([OVSDB_CHECK_POSITIVE],
|
||||
m4_if([$5], [], [],
|
||||
[AT_XFAIL_IF([m4_version_prereq([$5], [false], [true])])])
|
||||
AT_KEYWORDS([ovsdb positive $4])
|
||||
OVS_CHECK_LCOV([test-ovsdb $2], [0], [$3
|
||||
AT_CHECK([test-ovsdb $2], [0], [$3
|
||||
], [])
|
||||
AT_CLEANUP])
|
||||
|
||||
@ -23,7 +23,7 @@ m4_define([OVSDB_CHECK_POSITIVE],
|
||||
m4_define([OVSDB_CHECK_NEGATIVE],
|
||||
[AT_SETUP([$1])
|
||||
AT_KEYWORDS([ovsdb negative $4])
|
||||
OVS_CHECK_LCOV([test-ovsdb $2], [1], [], [stderr])
|
||||
AT_CHECK([test-ovsdb $2], [1], [], [stderr])
|
||||
m4_assert(m4_len([$3]))
|
||||
AT_CHECK(
|
||||
[if grep -F -e "AS_ESCAPE([$3])" stderr
|
||||
|
@ -6,7 +6,7 @@ AT_KEYWORDS([reconnect])
|
||||
AT_DATA([input], [run
|
||||
timeout
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
run
|
||||
timeout
|
||||
@ -32,7 +32,7 @@ timeout
|
||||
run
|
||||
disconnected
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -95,7 +95,7 @@ timeout
|
||||
run
|
||||
disconnected
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -208,7 +208,7 @@ timeout
|
||||
run
|
||||
connect-failed
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -552,7 +552,7 @@ run
|
||||
timeout
|
||||
run
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -695,7 +695,7 @@ run
|
||||
timeout
|
||||
run
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -859,7 +859,7 @@ run
|
||||
timeout
|
||||
run
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -992,7 +992,7 @@ connect-failed ECONNREFUSED
|
||||
run
|
||||
timeout
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
enable
|
||||
in BACKOFF for 0 ms (0 ms backoff)
|
||||
@ -1048,7 +1048,7 @@ timeout
|
||||
run
|
||||
disconnected
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
set-max-tries 1
|
||||
1 tries left
|
||||
@ -1099,7 +1099,7 @@ enable
|
||||
run
|
||||
timeout
|
||||
])
|
||||
OVS_CHECK_LCOV([test-reconnect < input], [0],
|
||||
AT_CHECK([test-reconnect < input], [0],
|
||||
[### t=1000 ###
|
||||
set-max-tries 0
|
||||
0 tries left
|
||||
|
26
tests/stp.at
26
tests/stp.at
@ -15,7 +15,7 @@ check 2 = F:10 B
|
||||
check 3 = F:5 F
|
||||
check 4 = F:5 B
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-ieee802.1d-1998])
|
||||
AT_CHECK([test-stp test-stp-ieee802.1d-1998])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP example from IEEE 802.1D-2004 figures 17.4 and 17.5])
|
||||
@ -52,7 +52,7 @@ check 5 = F:20 B F F
|
||||
check 6 = F:20 B F F
|
||||
check 7 = F:20 B F B
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-ieee802.1d-2004-fig17.4])
|
||||
AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.4])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.6])
|
||||
@ -72,7 +72,7 @@ check 3 = F:30 F B
|
||||
check 4 = F:20 F F
|
||||
check 5 = F:10 F F
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-ieee802.1d-2004-fig17.6])
|
||||
AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.6])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.7])
|
||||
@ -95,7 +95,7 @@ check 0 = root
|
||||
check 1 = F F:10 F F F F F F
|
||||
check 2 = F:20 D F F F F F F
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-ieee802.1d-2004-fig17.7])
|
||||
AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.7])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.io.1.1: Link Failure])
|
||||
@ -128,7 +128,7 @@ run 1000
|
||||
check 0 = root
|
||||
check 1 = D D F:10
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-io-1.1])
|
||||
AT_CHECK([test-stp test-stp-iol-io-1.1])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.io.1.2: Repeated Network])
|
||||
@ -148,7 +148,7 @@ run 1000
|
||||
check 0 = rootid:0x111 F B
|
||||
check 1 = rootid:0x111 B F:10
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-io-1.2])
|
||||
AT_CHECK([test-stp test-stp-iol-io-1.2])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.io.1.4: Network Initialization])
|
||||
@ -168,7 +168,7 @@ check 1 = F:10 F F
|
||||
check 2 = F:10 B F
|
||||
check 3 = F:10 B B
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-io-1.4])
|
||||
AT_CHECK([test-stp test-stp-iol-io-1.4])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.io.1.5: Topology Change])
|
||||
@ -215,7 +215,7 @@ check 1 = F:10 B F F
|
||||
check 2 = B F:10 F F
|
||||
check 3 = B F:20 B B
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-io-1.5])
|
||||
AT_CHECK([test-stp test-stp-iol-io-1.5])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.op.1.1 and STP.op.1.2])
|
||||
@ -229,7 +229,7 @@ AT_DATA([test-stp-iol-op-1.1],
|
||||
bridge 0 0x123 =
|
||||
check 0 = root
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-op-1.1])
|
||||
AT_CHECK([test-stp test-stp-iol-op-1.1])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.op.1.4: All Ports Initialized to Designated Ports])
|
||||
@ -244,7 +244,7 @@ check 0 = Li Li Li Li Li Li
|
||||
run 1000
|
||||
check 0 = F F F F F F
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-op-1.4])
|
||||
AT_CHECK([test-stp test-stp-iol-op-1.4])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.op.3.1: Root Bridge Selection: Root ID Values])
|
||||
@ -262,7 +262,7 @@ run 1000
|
||||
check 0 = rootid:0x111 root
|
||||
check 1 = rootid:0x111 F:10
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-op-3.1])
|
||||
AT_CHECK([test-stp test-stp-iol-op-3.1])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
|
||||
@ -280,7 +280,7 @@ check 0 = rootid:0x333^0x6000 root
|
||||
check 1 = rootid:0x333^0x6000 F:20
|
||||
check 2 = rootid:0x333^0x6000 F:10 F
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-op-3.3])
|
||||
AT_CHECK([test-stp test-stp-iol-op-3.3])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
|
||||
@ -298,6 +298,6 @@ check 0 = rootid:0x333^0x6000 root
|
||||
check 1 = rootid:0x333^0x6000 F:20
|
||||
check 2 = rootid:0x333^0x6000 F:10 F
|
||||
])
|
||||
OVS_CHECK_LCOV([test-stp test-stp-iol-op-3.4])
|
||||
AT_CHECK([test-stp test-stp-iol-op-3.4])
|
||||
AT_CLEANUP
|
||||
|
||||
|
@ -36,7 +36,6 @@ m4_define([OVS_WAIT_UNTIL], [OVS_WAIT([if $1; then exit 0; fi], [$2])])
|
||||
m4_define([OVS_WAIT_WHILE], [OVS_WAIT([if $1; then :; else exit 0; fi], [$2])])
|
||||
|
||||
m4_include([tests/ovsdb-macros.at])
|
||||
m4_include([tests/lcov-pre.at])
|
||||
|
||||
m4_include([tests/library.at])
|
||||
m4_include([tests/check-structs.at])
|
||||
@ -53,5 +52,3 @@ m4_include([tests/reconnect.at])
|
||||
m4_include([tests/ovsdb.at])
|
||||
m4_include([tests/stp.at])
|
||||
m4_include([tests/ovs-vsctl.at])
|
||||
|
||||
m4_include([tests/lcov-post.at])
|
||||
|
@ -2,12 +2,12 @@ AT_BANNER([timeval unit tests])
|
||||
|
||||
AT_SETUP([check that time advances])
|
||||
AT_KEYWORDS([timeval])
|
||||
OVS_CHECK_LCOV([test-timeval plain], [0])
|
||||
AT_CHECK([test-timeval plain], [0])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([check that time advances after daemonize()])
|
||||
AT_KEYWORDS([timeval])
|
||||
OVS_CHECK_LCOV([test-timeval daemon], [0])
|
||||
AT_CHECK([test-timeval daemon], [0])
|
||||
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
|
||||
|
@ -13,25 +13,26 @@ m4_define([CHECK_UUID],
|
||||
fi])
|
||||
|
||||
# This test is a strict subset of the larger test down below, but it
|
||||
# allows us to get test coverage data via OVS_CHECK_LCOV.
|
||||
# completes in a realistic amount of time with the "lcov" wrapper.
|
||||
AT_SETUP([UUID generation])
|
||||
AT_KEYWORDS([UUID])
|
||||
OVS_CHECK_LCOV([test-uuid > uuid])
|
||||
AT_CHECK([test-uuid > uuid])
|
||||
AT_CHECK([
|
||||
uuid=`cat uuid`
|
||||
CHECK_UUID])
|
||||
AT_CLEANUP
|
||||
|
||||
# This test is a strict subset of the larger test down below, but it
|
||||
# allows us to get test coverage data via OVS_CHECK_LCOV.
|
||||
# completes in a realistic amount of time with the "lcov" wrapper.
|
||||
AT_SETUP([UUID parsing and serialization])
|
||||
AT_KEYWORDS([UUID])
|
||||
OVS_CHECK_LCOV([test-uuid f47ac10b-58cc-4372-a567-0e02b2c3d479], [0],
|
||||
[f47ac10b-58cc-4372-a567-0e02b2c3d479
|
||||
AT_CHECK([test-uuid f47ac10b-58cc-4372-a567-0e02b2c3d479], [0],
|
||||
[f47ac10b-58cc-4372-a567-0e02b2c3d479
|
||||
])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([UUID generation, parsing, serialization])
|
||||
AT_SKIP_IF([test "$CHECK_LCOV" = true]) # lcov makes this test absurdly slow
|
||||
AT_KEYWORDS([UUID])
|
||||
AT_CHECK([
|
||||
uuids=
|
||||
|
@ -14,7 +14,7 @@ m4_define([TEST_VCONN_CLASS],
|
||||
m4_if([$1], [ssl], [
|
||||
AT_SKIP_IF([test "$HAVE_OPENSSL" = no])
|
||||
AT_CHECK([cp $abs_top_srcdir/tests/testpki*.pem .])])
|
||||
OVS_CHECK_LCOV([test-vconn testname $1], [0], [], [ignore])
|
||||
AT_CHECK([test-vconn testname $1], [0], [], [ignore])
|
||||
AT_CLEANUP])])
|
||||
|
||||
TEST_VCONN_CLASS([unix])
|
||||
|
Loading…
x
Reference in New Issue
Block a user