ofp-actions: Assert variable actions have len>0.
[cascardo/ovs.git] / tests / library.at
index 2507688..d82113f 100644 (file)
@@ -7,7 +7,7 @@ AT_CHECK([ovstest test-flows flows pcap], [0], [checked 247 packets, 0 errors
 AT_CLEANUP
 
 AT_SETUP([test TCP/IP checksumming])
-AT_CHECK([ovstest test-csum], [0], [....#....#....###................................#................................#
+AT_CHECK([ovstest test-csum], [0], [....#....#....####................................#................................#
 ])
 AT_CLEANUP
 
@@ -38,7 +38,7 @@ AT_CHECK([ovstest test-atomic])
 AT_CLEANUP
 
 AT_SETUP([test linked lists])
-AT_CHECK([ovstest test-list], [0], [..
+AT_CHECK([ovstest test-list], [0], [...
 ])
 AT_CLEANUP
 
@@ -147,34 +147,50 @@ dnl a directory fd using /proc/self/fd/<dirfd>.  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
+dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
+dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
+longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+
+dnl Skip the test if the directory can't be created (presumably the file
+dnl system doesn't support such long names).
+AT_CHECK([mkdir $longname || exit 77])
 
-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_CHECK([cd $longname && ovstest test-unix-socket ../$longname/socket socket])
 AT_CLEANUP
 
+m4_define([UNIX_SOCKET_SHORT_PATHNAME_PYN],
+  [AT_SETUP([test unix socket, short pathname - $1])
+   AT_SKIP_IF([test $2 = no || test "$IS_WIN32" = "yes"])
+   AT_KEYWORDS([python unixsocket])
+   AT_CHECK([$3 $srcdir/test-unix-socket.py x])
+   AT_CLEANUP])
+
+UNIX_SOCKET_SHORT_PATHNAME_PYN([Python2], [$HAVE_PYTHON], [$PYTHON])
+UNIX_SOCKET_SHORT_PATHNAME_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
+
 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/<dirfd>.  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
+m4_define([UNIX_SOCKET_LONG_PATHNAME_PYN],
+  [AT_SETUP([test unix socket, long pathname - $1])
+   AT_SKIP_IF([test $2 = no || test "$IS_WIN32" = "yes"])
+   AT_KEYWORDS([python unixsocket])
+   dnl Linux sockaddr_un has a 108-byte limit, so this needs to be longer.
+   dnl Linux "ecryptfs" has a 143-byte limit, so we use that many bytes.
+   longname=01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+
+   dnl Skip the test if the directory can't be created (presumably the file
+   dnl system doesn't support such long names).
+   AT_CHECK([mkdir $longname || exit 77])
+   AT_CHECK([cd $longname && $3 $abs_srcdir/test-unix-socket.py ../$longname/socket socket])
+   AT_CLEANUP])
+
+UNIX_SOCKET_LONG_PATHNAME_PYN([Python2], [$HAVE_PYTHON], [$PYTHON])
+UNIX_SOCKET_LONG_PATHNAME_PYN([Python3], [$HAVE_PYTHON3], [$PYTHON3])
 
 AT_SETUP([ovs_assert])
-OVS_LOGDIR=`pwd`; export OVS_LOGDIR
 if test "$IS_WIN32" = "yes"; then
   exit_status=9
 else
@@ -209,3 +225,7 @@ AT_CLEANUP
 AT_SETUP([use of public headers])
 AT_CHECK([test-lib], [0], [])
 AT_CLEANUP
+
+AT_SETUP([test ofpbuf module])
+AT_CHECK([ovstest test-ofpbuf], [0], [])
+AT_CLEANUP