From nobody Wed Feb 28 22:33:08 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TlTdc5VKgz5CXXq; Wed, 28 Feb 2024 22:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TlTdc4Pnjz4pjR; Wed, 28 Feb 2024 22:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709159588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VwvxG1qlRoc897vlRr5L+AOqUJIketSH+yyhyvJS6PI=; b=ltrJM43+iMW6QqHRaJwhzEwsmPyYDIE3Oth7Kf9Tmgip9/zir7KwymSOE92c3+XmidZ0qS GtCtTT5Ec9QFLzAYnWF9AwcuU9P+222dqm4p+u8/Pog6u617A6HKgp478G1wOl+QsTcf8l zCvId1RcnZv1313Fy2Wz5hkGdZZ6/kyR87gr/6b8Aj98ggpb0Q+lxOWqiggoUhhr8VNguf nAfwmXrGXeKeFqNy5oq7ZGZ2TySct6tsZEattd51c9xwOnchg0Z9bjasZJTsev1p4SxPlA 5dSJjaiox/llvch6GoYogpCTz1JU/WBMkqNRbsQoiRTJYGrQiKDAhgES3u8reg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709159588; a=rsa-sha256; cv=none; b=kIfTuOHgIN30FJJS/p8bdlsC8UGgxNJ4pcekymCaGbUYstxE38FWsd93N1FY7WA4FDfjUt IhRErz9rSfOP9JMAJjAARNOM9dxElL/hiV2d12p7a1M3+UW99P02bwGA+/fVGwwsG9rcuX ah6WHtHKdgS74+aKr67O94U4H2GSLhnvszp3U+OBUx/ksJGb2+Gj1dMI52MVs34SlhKXJ4 jvsEqe7qLBsePTYs9/9CyrL/im/8PSV1lXcalYM3NN4ezshHuzfA+Yn9UDqiFItozvKNdO G9p5vTEX/Dlq3fTjWHOWN2eRKpGwHRRNv2rhyfdCQfNzw7klvts583fKBQsKeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1709159588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VwvxG1qlRoc897vlRr5L+AOqUJIketSH+yyhyvJS6PI=; b=k0OHNVBKqNu2GZZ8HjgF496RooLjwdZWA9kYqLFAs7ei3L9+P3vUJfyhzk6U/FEDzQ04ud cDvqDVN6PZDF1V4MD+SGhXB5vM42VyeVIkPiqfBrPNDO4g7bCt/r8i6gwWsU1+gZD/erWB qbLWs61wakvtuzOG9HW+YYvwZbQDhc0lnK4RdeFeSbPTCd7xfMdy1aJTqBK92XxDG0F9EF 8Xuou3KBy6KU9bHdVDERWjlP+Sxe6hiU4wWcJ65xi4MwXDqEV7zFmioTMu7NPW3dDcmE8z OiOEEtVnGhHvqB4Jc0gze+9Euo+O6HYe+vEYBgE6u/h39e4L+KYAb/mcL5v3bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TlTdc3zVfzG34; Wed, 28 Feb 2024 22:33:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41SMX8ZR010894; Wed, 28 Feb 2024 22:33:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41SMX8Sc010891; Wed, 28 Feb 2024 22:33:08 GMT (envelope-from git) Date: Wed, 28 Feb 2024 22:33:08 GMT Message-Id: <202402282233.41SMX8Sc010891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d6ef9649dd92 - main - tests/unix_seqpacket: remove EMSGSIZE tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6ef9649dd924f12974d66a0c29a4ede71407e7d Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d6ef9649dd924f12974d66a0c29a4ede71407e7d commit d6ef9649dd924f12974d66a0c29a4ede71407e7d Author: Gleb Smirnoff AuthorDate: 2024-02-28 22:32:46 +0000 Commit: Gleb Smirnoff CommitDate: 2024-02-28 22:32:46 +0000 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 --- tests/sys/kern/unix_seqpacket_test.c | 61 ------------------------------------ 1 file changed, 61 deletions(-) diff --git a/tests/sys/kern/unix_seqpacket_test.c b/tests/sys/kern/unix_seqpacket_test.c index a2604d065024..be273fbe1246 100644 --- a/tests/sys/kern/unix_seqpacket_test.c +++ b/tests/sys/kern/unix_seqpacket_test.c @@ -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);