diff --git a/test/syscalls/linux/socket_unix.cc b/test/syscalls/linux/socket_unix.cc index c60a965ae..8815ad849 100644 --- a/test/syscalls/linux/socket_unix.cc +++ b/test/syscalls/linux/socket_unix.cc @@ -14,6 +14,7 @@ #include "test/syscalls/linux/socket_unix.h" +#include #include #include #include @@ -1175,6 +1176,17 @@ TEST_P(UnixSocketPairTest, SocketShutdown) { EXPECT_EQ(data, absl::string_view(buf, 3)); } +// TODO: We should be returning ENXIO and NOT EIO. +TEST_P(UnixSocketPairTest, DISABLED_SocketReopenFromProcfs) { + auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); + + // Opening a socket pair via /proc/self/fd/X is a ENXIO. + for (const int fd : {sockets->first_fd(), sockets->second_fd()}) { + ASSERT_THAT(Open(absl::StrCat("/proc/self/fd/", fd), O_WRONLY), + PosixErrorIs(ENXIO, ::testing::_)); + } +} + } // namespace } // namespace testing