X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb.at;h=3e9918ab4a024414b5dae7562f7b76f7ff226ca7;hb=cfc50ae514f805dcd9c14589f21158185424daf6;hp=6e3f63d852d4880eb57a9953d97e45494b4bcac2;hpb=c3bb4bd7f1d9c045a5e5d7062b09d4dac4e48195;p=sliver-openvswitch.git diff --git a/tests/ovsdb.at b/tests/ovsdb.at index 6e3f63d85..3e9918ab4 100644 --- a/tests/ovsdb.at +++ b/tests/ovsdb.at @@ -3,18 +3,41 @@ # Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with # status 0 and prints OUTPUT on stdout. # -# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS. If -# PREREQ is specified then the test is skipped if the Autoconf version -# is less than PREREQ. +# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS. m4_define([OVSDB_CHECK_POSITIVE], [AT_SETUP([$1]) - 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]) +# OVSDB_CHECK_POSITIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ], +# [PY-CHECK]) +# +# Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with +# status 0 and prints OUTPUT on stdout. +# +# PY-CHECK is expanded before the check. It can check for features of the +# Python implementation that are required for the test to pass. +# +# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS. +m4_define([OVSDB_CHECK_POSITIVE_PY], + [AT_SETUP([$1]) + AT_SKIP_IF([test $HAVE_PYTHON = no]) + $6 + AT_KEYWORDS([ovsdb positive Python $4]) + AT_CHECK([$PYTHON $srcdir/test-ovsdb.py $2], [0], [$3 +], []) + AT_CLEANUP]) + +# OVSDB_CHECK_POSITIVE_CPY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], +# [PREREQ], [PY-CHECK]) +# +# Runs identical C and Python tests, as specified. +m4_define([OVSDB_CHECK_POSITIVE_CPY], + [OVSDB_CHECK_POSITIVE([$1 - C], [$2], [$3], [$4], [$5]) + OVSDB_CHECK_POSITIVE_PY([$1 - Python], [$2], [$3], [$4], [$5], [$6])]) + # OVSDB_CHECK_NEGATIVE(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ]) # # Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with @@ -23,7 +46,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 @@ -35,18 +58,49 @@ m4_define([OVSDB_CHECK_NEGATIVE], [0], [ignore], [ignore]) AT_CLEANUP]) +# OVSDB_CHECK_NEGATIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ]) +# +# Runs "test-ovsdb TEST-OVSDB-ARGS" and checks that it exits with +# status 1 and that its output on stdout contains substring OUTPUT. +# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS. +m4_define([OVSDB_CHECK_NEGATIVE_PY], + [AT_SETUP([$1]) + AT_SKIP_IF([test $HAVE_PYTHON = no]) + AT_KEYWORDS([ovsdb negative $4]) + AT_CHECK([$PYTHON $srcdir/test-ovsdb.py $2], [1], [], [stderr]) + m4_assert(m4_len([$3])) + AT_CHECK( + [if grep -F -e "AS_ESCAPE([$3])" stderr + then + : + else + exit 99 + fi], + [0], [ignore], [ignore]) + AT_CLEANUP]) + +# OVSDB_CHECK_NEGATIVE_CPY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], +# [PREREQ]) +# +# Runs identical C and Python tests, as specified. +m4_define([OVSDB_CHECK_NEGATIVE_CPY], + [OVSDB_CHECK_NEGATIVE([$1 - C], [$2], [$3], [$4], [$5]) + OVSDB_CHECK_NEGATIVE_PY([$1 - Python], [$2], [$3], [$4], [$5])]) + m4_include([tests/ovsdb-log.at]) m4_include([tests/ovsdb-types.at]) m4_include([tests/ovsdb-data.at]) m4_include([tests/ovsdb-column.at]) m4_include([tests/ovsdb-table.at]) m4_include([tests/ovsdb-row.at]) +m4_include([tests/ovsdb-schema.at]) m4_include([tests/ovsdb-condition.at]) +m4_include([tests/ovsdb-mutation.at]) m4_include([tests/ovsdb-query.at]) m4_include([tests/ovsdb-transaction.at]) m4_include([tests/ovsdb-execution.at]) m4_include([tests/ovsdb-trigger.at]) -m4_include([tests/ovsdb-file.at]) +m4_include([tests/ovsdb-tool.at]) m4_include([tests/ovsdb-server.at]) m4_include([tests/ovsdb-monitor.at]) m4_include([tests/ovsdb-idl.at])