summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-12-10 17:55:45 -0800
committerShentubot <shentubot@google.com>2018-12-10 17:56:34 -0800
commit5d87d8865f8771c00b84717d40f27f8f93dda7ca (patch)
tree86362c16f38874bf4bf3b98e7c47fc1cbba7e396 /test
parentd3bc79bc8438206ac6a14fde4eaa288fc07eee82 (diff)
Implement MSG_WAITALL
MSG_WAITALL requests that recv family calls do not perform short reads. It only has an effect for SOCK_STREAM sockets, other types ignore it. PiperOrigin-RevId: 224918540 Change-Id: Id97fbf972f1f7cbd4e08eec0138f8cbdf1c94fe7
Diffstat (limited to 'test')
-rw-r--r--test/syscalls/linux/socket_generic.cc11
-rw-r--r--test/syscalls/linux/socket_non_stream_blocking.cc2
-rw-r--r--test/syscalls/linux/socket_stream_blocking.cc2
3 files changed, 9 insertions, 6 deletions
diff --git a/test/syscalls/linux/socket_generic.cc b/test/syscalls/linux/socket_generic.cc
index fbc3bebed..fdc346d4d 100644
--- a/test/syscalls/linux/socket_generic.cc
+++ b/test/syscalls/linux/socket_generic.cc
@@ -383,8 +383,6 @@ TEST_P(AllSocketPairTest, RecvmsgTimeoutOneSecondSucceeds) {
}
TEST_P(AllSocketPairTest, RecvWaitAll) {
- SKIP_IF(IsRunningOnGvisor()); // FIXME: Support MSG_WAITALL.
-
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
char sent_data[100];
@@ -399,5 +397,14 @@ TEST_P(AllSocketPairTest, RecvWaitAll) {
SyscallSucceedsWithValue(sizeof(sent_data)));
}
+TEST_P(AllSocketPairTest, RecvWaitAllDontWait) {
+ auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
+
+ char data[100] = {};
+ ASSERT_THAT(RetryEINTR(recv)(sockets->second_fd(), data, sizeof(data),
+ MSG_WAITALL | MSG_DONTWAIT),
+ SyscallFailsWithErrno(EAGAIN));
+}
+
} // namespace testing
} // namespace gvisor
diff --git a/test/syscalls/linux/socket_non_stream_blocking.cc b/test/syscalls/linux/socket_non_stream_blocking.cc
index d64b181c9..9e92628c3 100644
--- a/test/syscalls/linux/socket_non_stream_blocking.cc
+++ b/test/syscalls/linux/socket_non_stream_blocking.cc
@@ -31,8 +31,6 @@ namespace gvisor {
namespace testing {
TEST_P(BlockingNonStreamSocketPairTest, RecvLessThanBufferWaitAll) {
- SKIP_IF(IsRunningOnGvisor()); // FIXME: Support MSG_WAITALL.
-
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
char sent_data[100];
diff --git a/test/syscalls/linux/socket_stream_blocking.cc b/test/syscalls/linux/socket_stream_blocking.cc
index dd209c67c..3fbbe54d8 100644
--- a/test/syscalls/linux/socket_stream_blocking.cc
+++ b/test/syscalls/linux/socket_stream_blocking.cc
@@ -99,8 +99,6 @@ TEST_P(BlockingStreamSocketPairTest, RecvLessThanBuffer) {
}
TEST_P(BlockingStreamSocketPairTest, RecvLessThanBufferWaitAll) {
- SKIP_IF(IsRunningOnGvisor()); // FIXME: Support MSG_WAITALL.
-
auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
char sent_data[100];