]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
shutdownStreamTest fails on RHEL6.1
authorVMware, Inc <>
Mon, 26 Sep 2011 18:21:08 +0000 (11:21 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Sep 2011 18:21:08 +0000 (11:21 -0700)
The problem is that the test is broken for Linux, and it
appears to work with INET but actually it doesn't.

What happens with /st is that when we do the send(), we
actually get a SIG_PIPE, and the process exits, but there's
no error message, so it looks like the test passes.  Based
on this pass, when running the same test for vSockets, it
seems like we don't match the behavior because we fail.

But fixing the signal problem, by passing MSG_NOSIGNAL to
the send, makes it fail for INET too.  So now the test
fails for both system sockets and vSockets

The correct behavior on Linux is for the final recv() to
succeed.  Even with a local shutdown, the socket should
return 0 after a recv().

This change fixes the test to expect 0 on Linux (and
failure only for Windows, which is correct).

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/vsock/linux/vsockSocketWrapper.h

index 597edeefe751c83d055fc13aefa5dcc067031d9f..9f212fddb478d89a30be1e9b76ac6268fd675cee 100644 (file)
 #  define EHOSTDOWN           WSAEHOSTDOWN
 #  define EHOSTUNREACH        WSAEHOSTUNREACH
 #  define __ELOCALSHUTDOWN    ESHUTDOWN
+#  define __ELOCALRCVSHUTDOWN __ELOCALSHUTDOWN
 #  define __EPEERSHUTDOWN     ECONNABORTED
 #  define __ECONNINPROGRESS   EWOULDBLOCK
 #  define __ESNDRCVTIMEDOUT   ETIMEDOUT
 #  define EHOSTUNREACH        VMK_EHOSTUNREACH
 #  define EPIPE               VMK_BROKEN_PIPE
 #  define __ELOCALSHUTDOWN    EPIPE
+#  define __ELOCALRCVSHUTDOWN 0
 #  define __EPEERSHUTDOWN     EPIPE
 #  define __ECONNINPROGRESS   EINPROGRESS
 #  define __ESNDRCVTIMEDOUT   VMK_WOULD_BLOCK
 #  define ESYSNOTREADY        VMK_NOT_SUPPORTED
 #elif defined(__APPLE__)
 #  define __ELOCALSHUTDOWN    ESHUTDOWN
+#  define __ELOCALRCVSHUTDOWN 0
 #  define __EPEERSHUTDOWN     ECONNABORTED
 #  define __ECONNINPROGRESS   EINPROGRESS
 #  define __ESNDRCVTIMEDOUT   EAGAIN