diff options
Diffstat (limited to 'test/syscalls/linux')
34 files changed, 139 insertions, 250 deletions
diff --git a/test/syscalls/linux/accept_bind.cc b/test/syscalls/linux/accept_bind.cc index 7c6e92317..cd92003a6 100644 --- a/test/syscalls/linux/accept_bind.cc +++ b/test/syscalls/linux/accept_bind.cc @@ -586,13 +586,11 @@ INSTANTIATE_TEST_CASE_P( ApplyVec<SocketPairKind>( FilesystemUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))))); + List<int>{0, SOCK_NONBLOCK}))))); } // namespace diff --git a/test/syscalls/linux/accept_bind_stream.cc b/test/syscalls/linux/accept_bind_stream.cc index f7113a6fc..8e6ef2bca 100644 --- a/test/syscalls/linux/accept_bind_stream.cc +++ b/test/syscalls/linux/accept_bind_stream.cc @@ -76,16 +76,14 @@ TEST_P(AllSocketPairTest, BoundSenderAddrCoalesced) { INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, AllSocketPairTest, ::testing::ValuesIn(VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + ApplyVec<SocketPairKind>(FilesystemUnboundUnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_STREAM}, + List<int>{ + 0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))))); + List<int>{0, SOCK_NONBLOCK}))))); } // namespace diff --git a/test/syscalls/linux/bind.cc b/test/syscalls/linux/bind.cc index 354e8e53c..c16bd682e 100644 --- a/test/syscalls/linux/bind.cc +++ b/test/syscalls/linux/bind.cc @@ -131,14 +131,14 @@ INSTANTIATE_TEST_CASE_P( ::testing::ValuesIn(VecCat<SocketPairKind>( ApplyVec<SocketPairKind>( FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, List<int>{0, SOCK_CLOEXEC})), + AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, + SOCK_SEQPACKET}, + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, List<int>{0, SOCK_CLOEXEC}))))); + AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, + SOCK_SEQPACKET}, + List<int>{0, SOCK_NONBLOCK}))))); } // namespace diff --git a/test/syscalls/linux/socket_abstract.cc b/test/syscalls/linux/socket_abstract.cc index 7b111a2dd..3c5859302 100644 --- a/test/syscalls/linux/socket_abstract.cc +++ b/test/syscalls/linux/socket_abstract.cc @@ -24,11 +24,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_filesystem.cc b/test/syscalls/linux/socket_filesystem.cc index eea6f2810..65128dc01 100644 --- a/test/syscalls/linux/socket_filesystem.cc +++ b/test/syscalls/linux/socket_filesystem.cc @@ -24,11 +24,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_loopback_blocking.cc b/test/syscalls/linux/socket_ip_loopback_blocking.cc index a7effeab0..b85d5448f 100644 --- a/test/syscalls/linux/socket_ip_loopback_blocking.cc +++ b/test/syscalls/linux/socket_ip_loopback_blocking.cc @@ -25,22 +25,17 @@ namespace testing { std::vector<SocketPairKind> GetSocketPairs() { return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), + std::vector<SocketPairKind>{ + IPv6UDPBidirectionalBindSocketPair(0), + IPv4UDPBidirectionalBindSocketPair(0), + }, ApplyVecToVec<SocketPairKind>( std::vector<Middleware>{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC}))))); + std::vector<SocketPairKind>{ + IPv6TCPAcceptBindSocketPair(0), + IPv4TCPAcceptBindSocketPair(0), + })); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_tcp_generic_loopback.cc b/test/syscalls/linux/socket_ip_tcp_generic_loopback.cc index 9e10dea30..dc9a8c8d3 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic_loopback.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic_loopback.cc @@ -27,16 +27,11 @@ std::vector<SocketPairKind> GetSocketPairs() { return ApplyVecToVec<SocketPairKind>( std::vector<Middleware>{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - DualStackTCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})))); + std::vector<SocketPairKind>{ + IPv6TCPAcceptBindSocketPair(0), + IPv4TCPAcceptBindSocketPair(0), + DualStackTCPAcceptBindSocketPair(0), + }); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_tcp_loopback.cc b/test/syscalls/linux/socket_ip_tcp_loopback.cc index f95061506..3ea9c2d1e 100644 --- a/test/syscalls/linux/socket_ip_tcp_loopback.cc +++ b/test/syscalls/linux/socket_ip_tcp_loopback.cc @@ -23,16 +23,11 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - DualStackTCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC}))); + return { + IPv6TCPAcceptBindSocketPair(0), + IPv4TCPAcceptBindSocketPair(0), + DualStackTCPAcceptBindSocketPair(0), + }; } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_tcp_loopback_blocking.cc b/test/syscalls/linux/socket_ip_tcp_loopback_blocking.cc index bb419e3a8..57c6953e4 100644 --- a/test/syscalls/linux/socket_ip_tcp_loopback_blocking.cc +++ b/test/syscalls/linux/socket_ip_tcp_loopback_blocking.cc @@ -27,13 +27,11 @@ std::vector<SocketPairKind> GetSocketPairs() { return ApplyVecToVec<SocketPairKind>( std::vector<Middleware>{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})))); + std::vector<SocketPairKind>{ + IPv6TCPAcceptBindSocketPair(0), + IPv4TCPAcceptBindSocketPair(0), + DualStackTCPAcceptBindSocketPair(0), + }); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_tcp_loopback_nonblock.cc b/test/syscalls/linux/socket_ip_tcp_loopback_nonblock.cc index af6fd635e..7aebab9ae 100644 --- a/test/syscalls/linux/socket_ip_tcp_loopback_nonblock.cc +++ b/test/syscalls/linux/socket_ip_tcp_loopback_nonblock.cc @@ -27,15 +27,10 @@ std::vector<SocketPairKind> GetSocketPairs() { return ApplyVecToVec<SocketPairKind>( std::vector<Middleware>{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))); + std::vector<SocketPairKind>{ + IPv6TCPAcceptBindSocketPair(SOCK_NONBLOCK), + IPv4TCPAcceptBindSocketPair(SOCK_NONBLOCK), + }); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_udp_loopback.cc b/test/syscalls/linux/socket_ip_udp_loopback.cc index f3548469f..63b103b8b 100644 --- a/test/syscalls/linux/socket_ip_udp_loopback.cc +++ b/test/syscalls/linux/socket_ip_udp_loopback.cc @@ -25,16 +25,11 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - DualStackUDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC}))); + return { + IPv6UDPBidirectionalBindSocketPair(0), + IPv4UDPBidirectionalBindSocketPair(0), + DualStackUDPBidirectionalBindSocketPair(0), + }; } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_udp_loopback_blocking.cc b/test/syscalls/linux/socket_ip_udp_loopback_blocking.cc index 08ff3e656..1224ffe03 100644 --- a/test/syscalls/linux/socket_ip_udp_loopback_blocking.cc +++ b/test/syscalls/linux/socket_ip_udp_loopback_blocking.cc @@ -23,13 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{0, SOCK_CLOEXEC}))); + return { + IPv6UDPBidirectionalBindSocketPair(0), + IPv4UDPBidirectionalBindSocketPair(0), + }; } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_ip_udp_loopback_nonblock.cc b/test/syscalls/linux/socket_ip_udp_loopback_nonblock.cc index 256bcfccf..683cf4a6e 100644 --- a/test/syscalls/linux/socket_ip_udp_loopback_nonblock.cc +++ b/test/syscalls/linux/socket_ip_udp_loopback_nonblock.cc @@ -23,15 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + return { + IPv6UDPBidirectionalBindSocketPair(SOCK_NONBLOCK), + IPv4UDPBidirectionalBindSocketPair(SOCK_NONBLOCK), + }; } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_abstract.cc b/test/syscalls/linux/socket_unix_abstract.cc index 0878f63ff..b5d23fd47 100644 --- a/test/syscalls/linux/socket_unix_abstract.cc +++ b/test/syscalls/linux/socket_unix_abstract.cc @@ -23,11 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_abstract_nonblock.cc b/test/syscalls/linux/socket_unix_abstract_nonblock.cc index 93fb33832..5b514d893 100644 --- a/test/syscalls/linux/socket_unix_abstract_nonblock.cc +++ b/test/syscalls/linux/socket_unix_abstract_nonblock.cc @@ -23,11 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_blocking_local.cc b/test/syscalls/linux/socket_unix_blocking_local.cc index 3c2105cc7..ce9c48ebb 100644 --- a/test/syscalls/linux/socket_unix_blocking_local.cc +++ b/test/syscalls/linux/socket_unix_blocking_local.cc @@ -27,19 +27,13 @@ std::vector<SocketPairKind> GetSocketPairs() { return VecCat<SocketPairKind>( ApplyVec<SocketPairKind>( UnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List<int>{0, SOCK_CLOEXEC})), + std::vector<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}), ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List<int>{0, SOCK_CLOEXEC})), + std::vector<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}), ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List<int>{0, SOCK_CLOEXEC}))); + std::vector<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_dgram_local.cc b/test/syscalls/linux/socket_unix_dgram_local.cc index b2fa72b5e..0c761021c 100644 --- a/test/syscalls/linux/socket_unix_dgram_local.cc +++ b/test/syscalls/linux/socket_unix_dgram_local.cc @@ -29,18 +29,15 @@ std::vector<SocketPairKind> GetSocketPairs() { ApplyVec<SocketPairKind>( UnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))); + List<int>{0, SOCK_NONBLOCK})))); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_dgram_non_blocking.cc b/test/syscalls/linux/socket_unix_dgram_non_blocking.cc index 9152c229c..bec0f9cfa 100644 --- a/test/syscalls/linux/socket_unix_dgram_non_blocking.cc +++ b/test/syscalls/linux/socket_unix_dgram_non_blocking.cc @@ -45,22 +45,11 @@ TEST_P(NonBlockingDgramUnixSocketPairTest, ReadOneSideClosed) { INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, NonBlockingDgramUnixSocketPairTest, - ::testing::ValuesIn(IncludeReversals(VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - UnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))))); + ::testing::ValuesIn(IncludeReversals(std::vector<SocketPairKind>{ + UnixDomainSocketPair(SOCK_DGRAM | SOCK_NONBLOCK), + FilesystemBoundUnixDomainSocketPair(SOCK_DGRAM | SOCK_NONBLOCK), + AbstractBoundUnixDomainSocketPair(SOCK_DGRAM | SOCK_NONBLOCK), + }))); } // namespace diff --git a/test/syscalls/linux/socket_unix_domain.cc b/test/syscalls/linux/socket_unix_domain.cc index f8f0d01eb..5c9be7b1c 100644 --- a/test/syscalls/linux/socket_unix_domain.cc +++ b/test/syscalls/linux/socket_unix_domain.cc @@ -23,11 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( UnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_filesystem.cc b/test/syscalls/linux/socket_unix_filesystem.cc index be873edcb..6d7a0b659 100644 --- a/test/syscalls/linux/socket_unix_filesystem.cc +++ b/test/syscalls/linux/socket_unix_filesystem.cc @@ -23,11 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_filesystem_nonblock.cc b/test/syscalls/linux/socket_unix_filesystem_nonblock.cc index 63e85ac11..84914e129 100644 --- a/test/syscalls/linux/socket_unix_filesystem_nonblock.cc +++ b/test/syscalls/linux/socket_unix_filesystem_nonblock.cc @@ -23,11 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_non_stream_blocking_local.cc b/test/syscalls/linux/socket_unix_non_stream_blocking_local.cc index c5d525dde..7c6af99b5 100644 --- a/test/syscalls/linux/socket_unix_non_stream_blocking_local.cc +++ b/test/syscalls/linux/socket_unix_non_stream_blocking_local.cc @@ -25,18 +25,12 @@ namespace testing { std::vector<SocketPairKind> GetSocketPairs() { return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - UnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_CLOEXEC}))); + ApplyVec<SocketPairKind>(UnixDomainSocketPair, + std::vector<int>{SOCK_DGRAM, SOCK_SEQPACKET}), + ApplyVec<SocketPairKind>(FilesystemBoundUnixDomainSocketPair, + std::vector<int>{SOCK_DGRAM, SOCK_SEQPACKET}), + ApplyVec<SocketPairKind>(AbstractBoundUnixDomainSocketPair, + std::vector<int>{SOCK_DGRAM, SOCK_SEQPACKET})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_pair.cc b/test/syscalls/linux/socket_unix_pair.cc index 85dd3711b..4006094fb 100644 --- a/test/syscalls/linux/socket_unix_pair.cc +++ b/test/syscalls/linux/socket_unix_pair.cc @@ -26,8 +26,7 @@ std::vector<SocketPairKind> GetSocketPairs() { return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( UnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK}))); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_pair_nonblock.cc b/test/syscalls/linux/socket_unix_pair_nonblock.cc index 6a40fe68c..2e321ffd8 100644 --- a/test/syscalls/linux/socket_unix_pair_nonblock.cc +++ b/test/syscalls/linux/socket_unix_pair_nonblock.cc @@ -23,11 +23,10 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>(ApplyVec<SocketPairKind>( + return ApplyVec<SocketPairKind>( UnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{SOCK_NONBLOCK})); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_seqpacket_local.cc b/test/syscalls/linux/socket_unix_seqpacket_local.cc index f9139a754..d9f7844db 100644 --- a/test/syscalls/linux/socket_unix_seqpacket_local.cc +++ b/test/syscalls/linux/socket_unix_seqpacket_local.cc @@ -29,18 +29,15 @@ std::vector<SocketPairKind> GetSocketPairs() { ApplyVec<SocketPairKind>( UnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))); + List<int>{0, SOCK_NONBLOCK})))); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_stream.cc b/test/syscalls/linux/socket_unix_stream.cc index 8232c9e35..fec18ff07 100644 --- a/test/syscalls/linux/socket_unix_stream.cc +++ b/test/syscalls/linux/socket_unix_stream.cc @@ -47,21 +47,18 @@ TEST_P(StreamUnixSocketPairTest, ReadOneSideClosed) { INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, StreamUnixSocketPairTest, ::testing::ValuesIn(IncludeReversals(VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - UnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + ApplyVec<SocketPairKind>(UnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_STREAM}, + List<int>{ + 0, SOCK_NONBLOCK})), + ApplyVec<SocketPairKind>(FilesystemBoundUnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_STREAM}, + List<int>{ + 0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))))); + List<int>{0, SOCK_NONBLOCK})))))); } // namespace diff --git a/test/syscalls/linux/socket_unix_stream_blocking_local.cc b/test/syscalls/linux/socket_unix_stream_blocking_local.cc index 1cdeadd27..18e49487f 100644 --- a/test/syscalls/linux/socket_unix_stream_blocking_local.cc +++ b/test/syscalls/linux/socket_unix_stream_blocking_local.cc @@ -24,19 +24,11 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - UnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_CLOEXEC}))); + return { + UnixDomainSocketPair(SOCK_STREAM), + FilesystemBoundUnixDomainSocketPair(SOCK_STREAM), + AbstractBoundUnixDomainSocketPair(SOCK_STREAM), + }; } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_stream_local.cc b/test/syscalls/linux/socket_unix_stream_local.cc index 9f11e2d49..5f6c206ca 100644 --- a/test/syscalls/linux/socket_unix_stream_local.cc +++ b/test/syscalls/linux/socket_unix_stream_local.cc @@ -27,18 +27,15 @@ std::vector<SocketPairKind> GetSocketPairs() { ApplyVec<SocketPairKind>( UnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + List<int>{0, SOCK_NONBLOCK}))); } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_stream_nonblock_local.cc b/test/syscalls/linux/socket_unix_stream_nonblock_local.cc index 4c3d3a187..0c6f71b48 100644 --- a/test/syscalls/linux/socket_unix_stream_nonblock_local.cc +++ b/test/syscalls/linux/socket_unix_stream_nonblock_local.cc @@ -23,22 +23,11 @@ namespace gvisor { namespace testing { std::vector<SocketPairKind> GetSocketPairs() { - return VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - UnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))); + return { + UnixDomainSocketPair(SOCK_STREAM | SOCK_NONBLOCK), + FilesystemBoundUnixDomainSocketPair(SOCK_STREAM | SOCK_NONBLOCK), + AbstractBoundUnixDomainSocketPair(SOCK_STREAM | SOCK_NONBLOCK), + }; } INSTANTIATE_TEST_CASE_P( diff --git a/test/syscalls/linux/socket_unix_unbound_abstract.cc b/test/syscalls/linux/socket_unix_unbound_abstract.cc index a35b3b9bd..0e4a5911e 100644 --- a/test/syscalls/linux/socket_unix_unbound_abstract.cc +++ b/test/syscalls/linux/socket_unix_unbound_abstract.cc @@ -106,9 +106,9 @@ INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, UnboundAbstractUnixSocketPairTest, ::testing::ValuesIn(ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, List<int>{0, SOCK_CLOEXEC})))); + AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_SEQPACKET, + SOCK_DGRAM}, + List<int>{0, SOCK_NONBLOCK})))); } // namespace diff --git a/test/syscalls/linux/socket_unix_unbound_dgram.cc b/test/syscalls/linux/socket_unix_unbound_dgram.cc index a01b7f644..155d8974a 100644 --- a/test/syscalls/linux/socket_unix_unbound_dgram.cc +++ b/test/syscalls/linux/socket_unix_unbound_dgram.cc @@ -145,16 +145,14 @@ TEST_P(UnboundDgramUnixSocketPairTest, SendtoWithoutConnect) { INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, UnboundDgramUnixSocketPairTest, ::testing::ValuesIn(VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + ApplyVec<SocketPairKind>(FilesystemUnboundUnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_DGRAM}, + List<int>{ + 0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC}))))); + List<int>{0, SOCK_NONBLOCK}))))); } // namespace diff --git a/test/syscalls/linux/socket_unix_unbound_filesystem.cc b/test/syscalls/linux/socket_unix_unbound_filesystem.cc index 56d882643..0da66834d 100644 --- a/test/syscalls/linux/socket_unix_unbound_filesystem.cc +++ b/test/syscalls/linux/socket_unix_unbound_filesystem.cc @@ -74,9 +74,9 @@ INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, UnboundFilesystemUnixSocketPairTest, ::testing::ValuesIn(ApplyVec<SocketPairKind>( FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List<int>{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List<int>{0, SOCK_NONBLOCK}, List<int>{0, SOCK_CLOEXEC})))); + AllBitwiseCombinations(List<int>{SOCK_STREAM, SOCK_SEQPACKET, + SOCK_DGRAM}, + List<int>{0, SOCK_NONBLOCK})))); } // namespace diff --git a/test/syscalls/linux/socket_unix_unbound_seqpacket.cc b/test/syscalls/linux/socket_unix_unbound_seqpacket.cc index fa3b99490..65efde7f9 100644 --- a/test/syscalls/linux/socket_unix_unbound_seqpacket.cc +++ b/test/syscalls/linux/socket_unix_unbound_seqpacket.cc @@ -77,13 +77,11 @@ INSTANTIATE_TEST_CASE_P( ApplyVec<SocketPairKind>( FilesystemUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + List<int>{0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_SEQPACKET}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))))); + List<int>{0, SOCK_NONBLOCK})))))); } // namespace diff --git a/test/syscalls/linux/socket_unix_unbound_stream.cc b/test/syscalls/linux/socket_unix_unbound_stream.cc index 99636b221..56fe6b969 100644 --- a/test/syscalls/linux/socket_unix_unbound_stream.cc +++ b/test/syscalls/linux/socket_unix_unbound_stream.cc @@ -656,21 +656,18 @@ TEST_P(UnixStreamSocketPairTest, CoalescedDifferingCreds) { INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, UnixStreamSocketPairTest, ::testing::ValuesIn(IncludeReversals(VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - UnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), - ApplyVec<SocketPairKind>( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + ApplyVec<SocketPairKind>(UnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_STREAM}, + List<int>{ + 0, SOCK_NONBLOCK})), + ApplyVec<SocketPairKind>(FilesystemBoundUnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_STREAM}, + List<int>{ + 0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))))); + List<int>{0, SOCK_NONBLOCK})))))); // Test fixture for tests that apply to pairs of unbound unix stream sockets. using UnboundUnixStreamSocketPairTest = SocketPairTest; @@ -721,16 +718,14 @@ TEST_P(UnboundUnixStreamSocketPairTest, SendtoWithoutConnectIgnoresAddr) { INSTANTIATE_TEST_CASE_P( AllUnixDomainSockets, UnboundUnixStreamSocketPairTest, ::testing::ValuesIn(IncludeReversals(VecCat<SocketPairKind>( - ApplyVec<SocketPairKind>( - FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})), + ApplyVec<SocketPairKind>(FilesystemUnboundUnixDomainSocketPair, + AllBitwiseCombinations(List<int>{SOCK_STREAM}, + List<int>{ + 0, SOCK_NONBLOCK})), ApplyVec<SocketPairKind>( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List<int>{SOCK_STREAM}, - List<int>{0, SOCK_NONBLOCK}, - List<int>{0, SOCK_CLOEXEC})))))); + List<int>{0, SOCK_NONBLOCK})))))); } // namespace |