mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 21:05:08 +00:00
tests/unix_seqpacket: remove EMSGSIZE tests
These tests were not testing conformance to the specification, rather than the limitation of our implementation. The specification doesn't say that a SOCK_SEQPACKET shall ever return EMSGSIZE. It says: The SOCK_SEQPACKET socket type is similar to the SOCK_STREAM type, and is also connection-oriented. The only difference between these types is that record boundaries are maintained using the SOCK_SEQPACKET type. A record can be sent using one or more output operations and received using one or more input operations, but a single operation never transfers parts of more than one record. Record boundaries are visible to the receiver via the MSG_EOR flag in the received message flags returned by the recvmsg() function. It is protocol-specific whether a maximum record size is imposed. The EMSGSIZE is specified as 'message is too large to be sent all at once, as the socket requires'. Indeed existing implementation that has unix/seqpacket marked as PR_ATOMIC has such a limitation. But future implementation won't have, thus remove the tests. Reviewed by: tuexen, asomers Differential Revision: https://reviews.freebsd.org/D43756
This commit is contained in:
parent
152a6d410e
commit
d6ef9649dd
|
@ -868,65 +868,6 @@ ATF_TC_BODY(send_recv_nonblocking, tc)
|
|||
close(sv[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
* We should get EMSGSIZE if we try to send a message larger than the socket
|
||||
* buffer, with blocking sockets
|
||||
*/
|
||||
ATF_TC_WITHOUT_HEAD(emsgsize);
|
||||
ATF_TC_BODY(emsgsize, tc)
|
||||
{
|
||||
int sv[2];
|
||||
const int sndbufsize = 8192;
|
||||
const int rcvbufsize = 8192;
|
||||
const size_t pktsize = (sndbufsize + rcvbufsize) * 2;
|
||||
char sndbuf[pktsize];
|
||||
ssize_t ssize;
|
||||
|
||||
/* setup the socket pair */
|
||||
do_socketpair(sv);
|
||||
/* Setup the buffers */
|
||||
ATF_REQUIRE_EQ(0, setsockopt(sv[0], SOL_SOCKET, SO_SNDBUF, &sndbufsize,
|
||||
sizeof(sndbufsize)));
|
||||
ATF_REQUIRE_EQ(0, setsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rcvbufsize,
|
||||
sizeof(rcvbufsize)));
|
||||
|
||||
ssize = send(sv[0], sndbuf, pktsize, MSG_EOR);
|
||||
ATF_CHECK_EQ(EMSGSIZE, errno);
|
||||
ATF_CHECK_EQ(-1, ssize);
|
||||
close(sv[0]);
|
||||
close(sv[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
* We should get EMSGSIZE if we try to send a message larger than the socket
|
||||
* buffer, with nonblocking sockets
|
||||
*/
|
||||
ATF_TC_WITHOUT_HEAD(emsgsize_nonblocking);
|
||||
ATF_TC_BODY(emsgsize_nonblocking, tc)
|
||||
{
|
||||
int sv[2];
|
||||
const int sndbufsize = 8192;
|
||||
const int rcvbufsize = 8192;
|
||||
const size_t pktsize = (sndbufsize + rcvbufsize) * 2;
|
||||
char sndbuf[pktsize];
|
||||
ssize_t ssize;
|
||||
|
||||
/* setup the socket pair */
|
||||
do_socketpair_nonblocking(sv);
|
||||
/* Setup the buffers */
|
||||
ATF_REQUIRE_EQ(0, setsockopt(sv[0], SOL_SOCKET, SO_SNDBUF, &sndbufsize,
|
||||
sizeof(sndbufsize)));
|
||||
ATF_REQUIRE_EQ(0, setsockopt(sv[1], SOL_SOCKET, SO_RCVBUF, &rcvbufsize,
|
||||
sizeof(rcvbufsize)));
|
||||
|
||||
ssize = send(sv[0], sndbuf, pktsize, MSG_EOR);
|
||||
ATF_CHECK_EQ(EMSGSIZE, errno);
|
||||
ATF_CHECK_EQ(-1, ssize);
|
||||
close(sv[0]);
|
||||
close(sv[1]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* We should get EAGAIN if we try to send a message larger than the socket
|
||||
* buffer, with nonblocking sockets. Test with several different sockbuf sizes
|
||||
|
@ -1160,8 +1101,6 @@ ATF_TP_ADD_TCS(tp)
|
|||
ATF_TP_ADD_TC(tp, sendto_recvfrom);
|
||||
ATF_TP_ADD_TC(tp, shutdown_send);
|
||||
ATF_TP_ADD_TC(tp, shutdown_send_sigpipe);
|
||||
ATF_TP_ADD_TC(tp, emsgsize);
|
||||
ATF_TP_ADD_TC(tp, emsgsize_nonblocking);
|
||||
ATF_TP_ADD_TC(tp, eagain_8k_8k);
|
||||
ATF_TP_ADD_TC(tp, eagain_8k_128k);
|
||||
ATF_TP_ADD_TC(tp, eagain_128k_8k);
|
||||
|
|
Loading…
Reference in a new issue