From 876b241fac98e1e23f25ea4ccdca7768e0a7877f Mon Sep 17 00:00:00 2001 From: Jamie Liu Date: Fri, 25 Jan 2019 13:34:19 -0800 Subject: Remove O_CLOEXEC from socket test configurations where irrelevant. The implementation of O_CLOEXEC is orthogonal to every property tested by these tests; removing it significantly reduces the number of redundant tests we run. Also remove no-op calls to VecCat (calls with a single argument). PiperOrigin-RevId: 230959537 Change-Id: I83fe7db24e481ef67ca1f1992228af423f640b5c --- test/syscalls/linux/accept_bind.cc | 6 ++-- test/syscalls/linux/accept_bind_stream.cc | 12 ++++---- test/syscalls/linux/bind.cc | 12 ++++---- test/syscalls/linux/socket_abstract.cc | 5 ++-- test/syscalls/linux/socket_filesystem.cc | 5 ++-- test/syscalls/linux/socket_ip_loopback_blocking.cc | 21 ++++++-------- .../linux/socket_ip_tcp_generic_loopback.cc | 15 ++++------ test/syscalls/linux/socket_ip_tcp_loopback.cc | 15 ++++------ .../linux/socket_ip_tcp_loopback_blocking.cc | 12 ++++---- .../linux/socket_ip_tcp_loopback_nonblock.cc | 13 +++------ test/syscalls/linux/socket_ip_udp_loopback.cc | 15 ++++------ .../linux/socket_ip_udp_loopback_blocking.cc | 11 +++----- .../linux/socket_ip_udp_loopback_nonblock.cc | 13 +++------ test/syscalls/linux/socket_unix_abstract.cc | 5 ++-- .../linux/socket_unix_abstract_nonblock.cc | 5 ++-- test/syscalls/linux/socket_unix_blocking_local.cc | 12 ++------ test/syscalls/linux/socket_unix_dgram_local.cc | 9 ++---- .../linux/socket_unix_dgram_non_blocking.cc | 21 ++++---------- test/syscalls/linux/socket_unix_domain.cc | 5 ++-- test/syscalls/linux/socket_unix_filesystem.cc | 5 ++-- .../linux/socket_unix_filesystem_nonblock.cc | 5 ++-- .../linux/socket_unix_non_stream_blocking_local.cc | 18 ++++-------- test/syscalls/linux/socket_unix_pair.cc | 3 +- test/syscalls/linux/socket_unix_pair_nonblock.cc | 5 ++-- test/syscalls/linux/socket_unix_seqpacket_local.cc | 9 ++---- test/syscalls/linux/socket_unix_stream.cc | 21 ++++++-------- .../linux/socket_unix_stream_blocking_local.cc | 18 ++++-------- test/syscalls/linux/socket_unix_stream_local.cc | 9 ++---- .../linux/socket_unix_stream_nonblock_local.cc | 21 ++++---------- .../syscalls/linux/socket_unix_unbound_abstract.cc | 6 ++-- test/syscalls/linux/socket_unix_unbound_dgram.cc | 12 ++++---- .../linux/socket_unix_unbound_filesystem.cc | 6 ++-- .../linux/socket_unix_unbound_seqpacket.cc | 6 ++-- test/syscalls/linux/socket_unix_unbound_stream.cc | 33 +++++++++------------- 34 files changed, 139 insertions(+), 250 deletions(-) (limited to 'test/syscalls/linux') 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( FilesystemUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))))); + List{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( - ApplyVec( - FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + ApplyVec(FilesystemUnboundUnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_STREAM}, + List{ + 0, SOCK_NONBLOCK})), ApplyVec( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))))); + List{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( ApplyVec( FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, List{0, SOCK_CLOEXEC})), + AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, + SOCK_SEQPACKET}, + List{0, SOCK_NONBLOCK})), ApplyVec( AbstractUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, List{0, SOCK_CLOEXEC}))))); + AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, + SOCK_SEQPACKET}, + List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { return VecCat( - ApplyVec( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), + std::vector{ + IPv6UDPBidirectionalBindSocketPair(0), + IPv4UDPBidirectionalBindSocketPair(0), + }, ApplyVecToVec( std::vector{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat( - ApplyVec( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC}))))); + std::vector{ + 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 GetSocketPairs() { return ApplyVecToVec( std::vector{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat( - ApplyVec( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - DualStackTCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})))); + std::vector{ + 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 GetSocketPairs() { - return VecCat( - ApplyVec( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - DualStackTCPAcceptBindSocketPair, - AllBitwiseCombinations(List{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 GetSocketPairs() { return ApplyVecToVec( std::vector{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat( - ApplyVec( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})))); + std::vector{ + 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 GetSocketPairs() { return ApplyVecToVec( std::vector{ NoOp, SetSockOpt(IPPROTO_TCP, TCP_NODELAY, &kSockOptOn)}, - VecCat( - ApplyVec( - IPv6TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4TCPAcceptBindSocketPair, - AllBitwiseCombinations(List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))); + std::vector{ + 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 GetSocketPairs() { - return VecCat( - ApplyVec( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - DualStackUDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{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 GetSocketPairs() { - return VecCat( - ApplyVec( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{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 GetSocketPairs() { - return VecCat( - ApplyVec( - IPv6UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - IPv4UDPBidirectionalBindSocketPair, - AllBitwiseCombinations(List{SOCK_NONBLOCK}, - List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { return VecCat( ApplyVec( UnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List{0, SOCK_CLOEXEC})), + std::vector{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}), ApplyVec( FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List{0, SOCK_CLOEXEC})), + std::vector{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}), ApplyVec( AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List{0, SOCK_CLOEXEC}))); + std::vector{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 GetSocketPairs() { ApplyVec( UnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))); + List{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( - ApplyVec( - UnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))))); + ::testing::ValuesIn(IncludeReversals(std::vector{ + 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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( UnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { return VecCat( - ApplyVec( - UnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_CLOEXEC}))); + ApplyVec(UnixDomainSocketPair, + std::vector{SOCK_DGRAM, SOCK_SEQPACKET}), + ApplyVec(FilesystemBoundUnixDomainSocketPair, + std::vector{SOCK_DGRAM, SOCK_SEQPACKET}), + ApplyVec(AbstractBoundUnixDomainSocketPair, + std::vector{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 GetSocketPairs() { return VecCat(ApplyVec( UnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { - return VecCat(ApplyVec( + return ApplyVec( UnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { ApplyVec( UnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))); + List{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( - ApplyVec( - UnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + ApplyVec(UnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_STREAM}, + List{ + 0, SOCK_NONBLOCK})), + ApplyVec(FilesystemBoundUnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_STREAM}, + List{ + 0, SOCK_NONBLOCK})), ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))))); + List{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 GetSocketPairs() { - return VecCat( - ApplyVec( - UnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{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 GetSocketPairs() { ApplyVec( UnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( FilesystemBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))); + List{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 GetSocketPairs() { - return VecCat( - ApplyVec( - UnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - AbstractBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{SOCK_NONBLOCK}, - List{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( AbstractUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, List{0, SOCK_CLOEXEC})))); + AllBitwiseCombinations(List{SOCK_STREAM, SOCK_SEQPACKET, + SOCK_DGRAM}, + List{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( - ApplyVec( - FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + ApplyVec(FilesystemUnboundUnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_DGRAM}, + List{ + 0, SOCK_NONBLOCK})), ApplyVec( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC}))))); + List{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( FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations( - List{SOCK_STREAM, SOCK_SEQPACKET, SOCK_DGRAM}, - List{0, SOCK_NONBLOCK}, List{0, SOCK_CLOEXEC})))); + AllBitwiseCombinations(List{SOCK_STREAM, SOCK_SEQPACKET, + SOCK_DGRAM}, + List{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( FilesystemUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + List{0, SOCK_NONBLOCK})), ApplyVec( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_SEQPACKET}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))))); + List{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( - ApplyVec( - UnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), - ApplyVec( - FilesystemBoundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + ApplyVec(UnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_STREAM}, + List{ + 0, SOCK_NONBLOCK})), + ApplyVec(FilesystemBoundUnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_STREAM}, + List{ + 0, SOCK_NONBLOCK})), ApplyVec( AbstractBoundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))))); + List{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( - ApplyVec( - FilesystemUnboundUnixDomainSocketPair, - AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})), + ApplyVec(FilesystemUnboundUnixDomainSocketPair, + AllBitwiseCombinations(List{SOCK_STREAM}, + List{ + 0, SOCK_NONBLOCK})), ApplyVec( AbstractUnboundUnixDomainSocketPair, AllBitwiseCombinations(List{SOCK_STREAM}, - List{0, SOCK_NONBLOCK}, - List{0, SOCK_CLOEXEC})))))); + List{0, SOCK_NONBLOCK})))))); } // namespace -- cgit v1.2.3