X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=tests%2Flibrary.at;h=6e04991cea36216aa16c6a5a0a72870f8bed255f;hb=38876d31;hp=c48828e9d00830b1778b5e91b55dadb67a217458;hpb=f1acd62b54376a425a975f9af501c4c8c5689b39;p=cascardo%2Fovs.git diff --git a/tests/library.at b/tests/library.at index c48828e9d..6e04991ce 100644 --- a/tests/library.at +++ b/tests/library.at @@ -2,38 +2,214 @@ 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 . We do not have a workaround +dnl for other platforms, so we skip the test there. +AT_SETUP([test unix socket, long pathname - C]) +AT_SKIP_IF([test "$IS_WIN32" = "yes"]) +dnl Linux has a 108 byte limit; this is 150 bytes long. +longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +mkdir $longname +cd $longname +AT_CHECK([ovstest test-unix-socket ../$longname/socket socket]) +AT_CLEANUP + +AT_SETUP([test unix socket, short pathname - Python]) +AT_SKIP_IF([test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes"]) +AT_CHECK([$PYTHON $srcdir/test-unix-socket.py x]) +AT_CLEANUP + +dnl Unix sockets with long names are problematic because the name has to +dnl go in a fixed-length field in struct sockaddr_un. Generally the limit +dnl is about 100 bytes. On Linux, we work around this by indirecting through +dnl a directory fd using /proc/self/fd/. We do not have a workaround +dnl for other platforms, so we skip the test there. +AT_SETUP([test unix socket, long pathname - Python]) +AT_SKIP_IF([test $HAVE_PYTHON = no || test "$IS_WIN32" = "yes"]) +dnl Linux has a 108 byte limit; this is 150 bytes long. +longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +mkdir $longname +cd $longname +AT_CHECK([$PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket]) +AT_CLEANUP + +AT_SETUP([ovs_assert]) +OVS_LOGDIR=`pwd`; export OVS_LOGDIR +if test "$IS_WIN32" = "yes"; then + exit_status=9 +else + # SIGABRT + 128 + exit_status=134 +fi +AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert], + [$exit_status], [], [stderr]) + +AT_CHECK([sed 's/\(opened log file\) .*/\1/ +s/|[[^|]]*: /|/' test-util.log], [0], [dnl +vlog|INFO|opened log file +util|EMER|assertion false failed in test_assert() +]) + +AT_CHECK([sed 's/.*: // +1q' stderr], [0], + [assertion false failed in test_assert() +]) + +AT_CLEANUP + +AT_SETUP([snprintf]) +AT_CHECK([ovstest test-util snprintf]) +AT_CLEANUP + +AT_SETUP([test bitmap functions]) +AT_CHECK([ovstest test-bitmap check], [0], [.. +]) +AT_CLEANUP + +AT_SETUP([use of public headers]) +AT_CHECK([test-lib], [0], []) AT_CLEANUP -AT_SETUP([test vconn library]) -OVS_CHECK_LCOV([test-vconn], [0], [ignore]) +AT_SETUP([test ofpbuf module]) +AT_CHECK([ovstest test-ofpbuf], [0], []) AT_CLEANUP