summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorNayana Bidari <nybidari@google.com>2020-12-14 10:20:49 -0800
committergVisor bot <gvisor-bot@google.com>2020-12-14 10:22:32 -0800
commitab593661efe4924369265a6b9f0dc719dcb371ab (patch)
tree9f9af7fb35147df2a1515bc84e57fdfe6bf1880e /test
parent08d36b6c630846c4d9d812c25966639513ecd211 (diff)
Move SO_ERROR and SO_OOBINLINE option to socketops.
SO_OOBINLINE option is set/get as boolean value, which is the same as linux. As we currently do not support disabling this option, we always return it as true. PiperOrigin-RevId: 347413905
Diffstat (limited to 'test')
-rw-r--r--test/syscalls/linux/socket_generic.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/syscalls/linux/socket_generic.cc b/test/syscalls/linux/socket_generic.cc
index 70cc86b16..a28ee2233 100644
--- a/test/syscalls/linux/socket_generic.cc
+++ b/test/syscalls/linux/socket_generic.cc
@@ -853,5 +853,21 @@ TEST_P(AllSocketPairTest, SetAndGetBooleanSocketOptions) {
}
}
+TEST_P(AllSocketPairTest, GetSocketOutOfBandInlineOption) {
+ // We do not support disabling this option. It is always enabled.
+ SKIP_IF(!IsRunningOnGvisor());
+
+ auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair());
+ int enable = -1;
+ socklen_t enableLen = sizeof(enable);
+
+ int want = 1;
+ ASSERT_THAT(getsockopt(sockets->first_fd(), SOL_SOCKET, SO_OOBINLINE, &enable,
+ &enableLen),
+ SyscallSucceeds());
+ ASSERT_EQ(enableLen, sizeof(enable));
+ EXPECT_EQ(enable, want);
+}
+
} // namespace testing
} // namespace gvisor