X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Flibrary.at;h=8aeec482fe396536a87d6af9000d0f862f5dc76d;hb=HEAD;hp=a9a5bea51b0f64a02fb4a9043acb18b516c2862c;hpb=78f172aa4ea3acd28085a457059ad82ba2f2c79a;p=sliver-openvswitch.git diff --git a/tests/library.at b/tests/library.at index a9a5bea51..8aeec482f 100644 --- a/tests/library.at +++ b/tests/library.at @@ -2,42 +2,186 @@ 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]) +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]) +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]) +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 +AT_CHECK([ovstest test-util -voff -vfile:info '-vPATTERN:file:%c|%p|%m' --log-file assert || kill -l $?], + [0], [ABRT +], [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