diff options
author | Ian Gudger <igudger@google.com> | 2018-12-21 19:45:43 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-12-21 19:46:55 -0800 |
commit | 0df0df35fc4aa4d69dc01f7c7e2d9e0530a34db7 (patch) | |
tree | 06dfc7a32b55346d4a47c1de196c752180955822 /test/syscalls | |
parent | d2f8586a1f412aa69876ec9698160dcf23c6bca3 (diff) |
Stub out SO_OOBINLINE.
We don't explicitly support out-of-band data and treat it like normal in-band
data. This is equilivent to SO_OOBINLINE being enabled, so always report that
it is enabled.
PiperOrigin-RevId: 226572742
Change-Id: I4c30ccb83265e76c30dea631cbf86822e6ee1c1b
Diffstat (limited to 'test/syscalls')
-rw-r--r-- | test/syscalls/linux/socket_ip_tcp_generic.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc index 81508263b..e8a6210e1 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic.cc @@ -522,5 +522,21 @@ TEST_P(TCPSocketPairTest, SetTCPKeepintvlToMax) { EXPECT_EQ(get, MAX_TCP_KEEPINTVL); } +TEST_P(TCPSocketPairTest, SetOOBInline) { + auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); + + EXPECT_THAT(setsockopt(sockets->first_fd(), SOL_SOCKET, SO_OOBINLINE, + &kSockOptOn, sizeof(kSockOptOn)), + SyscallSucceeds()); + + int get = -1; + socklen_t get_len = sizeof(get); + EXPECT_THAT( + getsockopt(sockets->first_fd(), SOL_SOCKET, SO_OOBINLINE, &get, &get_len), + SyscallSucceedsWithValue(0)); + EXPECT_EQ(get_len, sizeof(get)); + EXPECT_EQ(get, kSockOptOn); +} + } // namespace testing } // namespace gvisor |