summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/socket_inet_loopback.cc
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2020-08-27 14:09:25 -0700
committergVisor bot <gvisor-bot@google.com>2020-08-27 14:11:23 -0700
commit26c588f06368c21130bb356c6088b76ea715d1ef (patch)
treebb4045e1f9b281f8db54f280c91246bf0cbe2e7a /test/syscalls/linux/socket_inet_loopback.cc
parenta5f1e742601aa0281cb2a170a97160dc35220ec3 (diff)
Fix BadSocketPair for open source.
BadSocketPair test will return several errnos (EPREM, ESOCKTNOSUPPORT, EAFNOSUPPORT) meaning the test is just too specific. Checking the syscall fails is appropriate. PiperOrigin-RevId: 328813071
Diffstat (limited to 'test/syscalls/linux/socket_inet_loopback.cc')
-rw-r--r--test/syscalls/linux/socket_inet_loopback.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/syscalls/linux/socket_inet_loopback.cc b/test/syscalls/linux/socket_inet_loopback.cc
index 7c1d6a414..67893033c 100644
--- a/test/syscalls/linux/socket_inet_loopback.cc
+++ b/test/syscalls/linux/socket_inet_loopback.cc
@@ -97,13 +97,9 @@ TEST(BadSocketPairArgs, ValidateErrForBadCallsToSocketPair) {
ASSERT_THAT(socketpair(AF_INET6, 0, 0, fd),
SyscallFailsWithErrno(ESOCKTNOSUPPORT));
- // Invalid AF will return ENOAFSUPPORT or EPERM.
- ASSERT_THAT(socketpair(AF_MAX, 0, 0, fd),
- ::testing::AnyOf(SyscallFailsWithErrno(EAFNOSUPPORT),
- SyscallFailsWithErrno(EPERM)));
- ASSERT_THAT(socketpair(8675309, 0, 0, fd),
- ::testing::AnyOf(SyscallFailsWithErrno(EAFNOSUPPORT),
- SyscallFailsWithErrno(EPERM)));
+ // Invalid AF will fail.
+ ASSERT_THAT(socketpair(AF_MAX, 0, 0, fd), SyscallFails());
+ ASSERT_THAT(socketpair(8675309, 0, 0, fd), SyscallFails());
}
enum class Operation {