X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb-idl.at;h=89752f0f617946baf0461a7a372ca51cd2ed5cf5;hb=0ef165ecb57943e17a8ee8270df68ffb8d032e29;hp=ce220107a87f4ca9e704067ae1b147d75788d581;hpb=e06d06a7b3386cd7a60fae1b77ae0acedf42c3e3;p=sliver-openvswitch.git diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at index ce220107a..89752f0f6 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -1,5 +1,6 @@ AT_BANNER([OVSDB -- interface description language (IDL)]) +OVS_RUNDIR=`pwd`; export OVS_RUNDIR # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS], # [FILTER]) # @@ -19,6 +20,7 @@ AT_BANNER([OVSDB -- interface description language (IDL)]) m4_define([OVSDB_CHECK_IDL_C], [AT_SETUP([$1 - C]) AT_KEYWORDS([ovsdb server idl positive $5]) + OVS_RUNDIR=`pwd`; export OVS_RUNDIR AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema], [0], [stdout], [ignore]) AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore]) @@ -26,7 +28,7 @@ m4_define([OVSDB_CHECK_IDL_C], [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 pid`]) - AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), [0], [$4], [], [kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -36,6 +38,7 @@ m4_define([OVSDB_CHECK_IDL_PY], [AT_SETUP([$1 - Python]) AT_SKIP_IF([test $HAVE_PYTHON = no]) AT_KEYWORDS([ovsdb server idl positive Python $5]) + OVS_RUNDIR=`pwd`; export OVS_RUNDIR AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema], [0], [stdout], [ignore]) AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore]) @@ -43,7 +46,7 @@ m4_define([OVSDB_CHECK_IDL_PY], [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])]) AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3], [0], [stdout], [ignore], [kill `cat pid`]) - AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), [0], [$4], [], [kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -53,16 +56,40 @@ m4_define([OVSDB_CHECK_IDL_TCP_PY], [AT_SETUP([$1 - Python tcp]) AT_SKIP_IF([test $HAVE_PYTHON = no]) AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5]) + OVS_RUNDIR=`pwd`; export OVS_RUNDIR + OVS_LOGDIR=`pwd`; export OVS_LOGDIR AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema], [0], [stdout], [ignore]) - AT_CHECK([perl $srcdir/choose-port.pl], [0], [stdout]) - TCP_PORT=`cat stdout` - AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:$TCP_PORT:127.0.0.1 --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore]) + AT_CHECK([ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore]) + TCP_PORT=`parse_listening_port < ovsdb-server.log` + m4_if([$2], [], [], [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore], [kill `cat pid`])]) AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3], [0], [stdout], [ignore], [kill `cat pid`]) - AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), + [0], [$4], [], [kill `cat pid`]) + OVSDB_SERVER_SHUTDOWN + AT_CLEANUP]) + +# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6 +m4_define([OVSDB_CHECK_IDL_TCP6_PY], + [AT_SETUP([$1 - Python tcp6]) + AT_SKIP_IF([test $HAVE_PYTHON = no]) + AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5]) + OVS_RUNDIR=`pwd`; export OVS_RUNDIR + OVS_LOGDIR=`pwd`; export OVS_LOGDIR + AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema], + [0], [stdout], [ignore]) + AT_CHECK([ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[[::1]] --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore]) + TCP_PORT=`parse_listening_port < ovsdb-server.log` + echo "TCP_PORT=$TCP_PORT" + + m4_if([$2], [], [], + [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore], [kill `cat pid`])]) + AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3], + [0], [stdout], [ignore], [kill `cat pid`]) + AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]), [0], [$4], [], [kill `cat pid`]) OVSDB_SERVER_SHUTDOWN AT_CLEANUP]) @@ -70,7 +97,8 @@ m4_define([OVSDB_CHECK_IDL_TCP_PY], m4_define([OVSDB_CHECK_IDL], [OVSDB_CHECK_IDL_C($@) OVSDB_CHECK_IDL_PY($@) - OVSDB_CHECK_IDL_TCP_PY($@)]) + OVSDB_CHECK_IDL_TCP_PY($@) + OVSDB_CHECK_IDL_TCP6_PY($@)]) OVSDB_CHECK_IDL([simple idl, initially empty, no ops], [],