X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb.at;h=d64d75e54acadc3176e0ce6ccb9bce40c39cdbfa;hb=3594990b070f8cd6df9d7693cacb8ff4d91429fe;hp=1ee9c03785b3d37c3ba722bc10c9daf107e6a993;hpb=a0bc29a541fc7dc6e20137d5558e2094d614e6ab;p=sliver-openvswitch.git diff --git a/tests/ovsdb.at b/tests/ovsdb.at index 1ee9c0378..d64d75e54 100644 --- a/tests/ovsdb.at +++ b/tests/ovsdb.at @@ -11,6 +11,33 @@ m4_define([OVSDB_CHECK_POSITIVE], ], []) AT_CLEANUP]) +# OVSDB_CHECK_POSITIVE_PY(TITLE, TEST-OVSDB-ARGS, OUTPUT, [KEYWORDS], [PREREQ], +# [XFAIL]) +# +# Runs "test-ovsdb.py TEST-OVSDB-ARGS" and checks that it exits with +# status 0 and prints OUTPUT on stdout. +# +# If XFAIL is nonempty then the test is expected to fail (presumably because +# this test works in the C implementation but does not work in Python yet) +# +# 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]) + m4_if([$6], [], [], [AT_XFAIL_IF([:])]) + 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-XFAIL]) +# +# 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 @@ -31,6 +58,35 @@ 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]) @@ -48,3 +104,4 @@ m4_include([tests/ovsdb-tool.at]) m4_include([tests/ovsdb-server.at]) m4_include([tests/ovsdb-monitor.at]) m4_include([tests/ovsdb-idl.at]) +m4_include([tests/ovsdb-idl-py.at])