X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Flibrary.at;h=650fef3f413a796d5a821ca7d233edac6ee263cd;hb=d978fa4832bbc5176e05edd05bcdf2452a8dded2;hp=ca5f29ca8f16b9c3cec7ef9471fd45fd66f23a02;hpb=711e0157cf345f1473247ec90c6ff39eb9f7743c;p=sliver-openvswitch.git diff --git a/tests/library.at b/tests/library.at index ca5f29ca8..650fef3f4 100644 --- a/tests/library.at +++ b/tests/library.at @@ -100,12 +100,41 @@ nibble 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ]) AT_CLEANUP -AT_SETUP([test log_2_floor]) -AT_CHECK([test-util]) +m4_foreach( + [testname], + [[ctz], + [popcount], + [log_2_floor], + [bitwise_copy], + [bitwise_zero], + [bitwise_one], + [bitwise_is_all_zeros]], + [AT_SETUP([testname[()] function]) + AT_KEYWORDS([testname]) + AT_CHECK([test-util testname], [0], [], []) + AT_CLEANUP]) + +AT_SETUP([test unix socket, short pathname - C]) +AT_CHECK([test-unix-socket x]) AT_CLEANUP -AT_SETUP([test unix socket -- short pathname]) -AT_CHECK([test-unix-socket x]) +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 - C]) +AT_SKIP_IF([test ! -d /proc/self/fd]) +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 @@ -113,20 +142,31 @@ 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]) -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 - Python]) +AT_SKIP_IF([test $HAVE_PYTHON = no]) +AT_SKIP_IF([test ! -d /proc/self/fd]) 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]) +OVS_LOGDIR=`pwd`; export OVS_LOGDIR +AT_CHECK([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