X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Flibrary.at;h=b0ccd40da393aa5be782003d957bce23b9010cc7;hb=8bfd0fdace852f2208b97430bd8de9aeadbf2fb0;hp=55adcfbf2d08a04e2af8004df9a5662fcf477d5d;hpb=4749f73d12c844b318af7f45cf45e1acac9f7c08;p=sliver-openvswitch.git diff --git a/tests/library.at b/tests/library.at index 55adcfbf2..b0ccd40da 100644 --- a/tests/library.at +++ b/tests/library.at @@ -7,7 +7,7 @@ AT_CHECK([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]) -AT_CHECK([dnl - case `uname` in dnl ( - *[[lL]]inux*) - exit 0 - ;; dnl ( - *) - dnl Magic exit code to tell Autotest to skip this test. - exit 77 - ;; - esac -]) +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([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. -mkdir 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -cd 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 -AT_CHECK([test-unix-socket ../012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789/socket socket]) +longname=012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 +mkdir $longname +cd $longname +AT_CHECK([$PYTHON $abs_srcdir/test-unix-socket.py ../$longname/socket socket]) AT_CLEANUP AT_SETUP([ovs_assert]) @@ -159,3 +181,7 @@ AT_CHECK([sed 's/.*: // ]) AT_CLEANUP + +AT_SETUP([snprintf]) +AT_CHECK([test-util snprintf]) +AT_CLEANUP