From nobody Thu Feb 23 04:50:48 2023 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 4PMgZd1GB7z3sxmh; Thu, 23 Feb 2023 04:50:49 +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 4PMgZd0r51z4V2y; Thu, 23 Feb 2023 04:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677127849; 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=rEwf7tWUBqVlBKLJlcnyXUqCx/bNR3p/y6gCZ1wvbgg=; b=iqV+E7glUVKNIFN8fr91kabnoWKIllN6whi21Y+430wMNeNz4VcixlFkTYpBeECgsLY4ZN Uyv11Ya7DqxvyCVtJOC61YNzksvugZnn+WPDJufVB0JEigQoYoBl8XtJZvxrjlZonDaanw /F+hO7fKOIr2d1WPi8QS0J5B1HVvZR5nLgi2m1MuY2sO5+B4kBN1/QRUTGQmOD/Vn1sFVX +xml16qyG+RGCndwKiug4oy3r+YY2RTuW9zaih+jtvT4Z34boc6wTftkDTwThajyE4sjQS U1OGIbnsj5VCVWfaedATV2gTX3dLmSLnDgN3phOZSKytcKlM16Zz/Jr1vWQ9YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677127849; 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=rEwf7tWUBqVlBKLJlcnyXUqCx/bNR3p/y6gCZ1wvbgg=; b=ZGFsa2qG2ZZ1iOHotdVWMP6+8rnouSWG9IoyRbuQw8LMbon8dQIy4EeDPoY03ET7nlqk8R t/vyk8hxF18NF7D0Gq06ez/xUStkjm+5Cyu4b4paOyMNXG35NQ/T/tdJl++BBeMfcNYU1F HbRPMnD4UZSo0IpefTheI354FTiWieVNBOH4qv49bPkRZrcpTw5iulW1bftoN8D+QhaVSm eC19Tl22ivHC4lkHJqFf2yye8ZKehPlw+Sd5IwAMxt/gRyJXXPYxYXdI0EfOadCNwa8pkx el5g3NgTGj/ItuQY8koyuSJ5JeONp1pPFQA91kvGIuqUmXGy7Om2yRLIVlO2rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677127849; a=rsa-sha256; cv=none; b=ItiFJ6PUyCBeKif2S4YDW/ggWVE85S7nVKeRXTuVBzCaS0XVVzKiM0Qx26X2iSkDHhd3Cu 1TOtKkD+tdsDsbZju6x/Nk/tjimRnPA/HJRqhgG4ak4qCPLTFUsC3h/UD06nN15fg/TEPd q+emLTLS8msHWAFx/JcNKtR6R62TYClKQZhH8tLjH6S8LHFpJgLtx5xQTSe+ADS0ExLqVk 23gvbWyWPbG3NBtBQNsaMBe6eT8wQ3iVMnfaKmq5QDVLJg+nr6UHJkq3hZeguZNzDamCLk 2SgSXk57MA9//Mv5K27RqgNzL0ijdF7qsDCvevGDkonDuC9cKiat1MuWMQsz2g== 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 4PMgZc6zzpzTrg; Thu, 23 Feb 2023 04:50:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31N4omJb052400; Thu, 23 Feb 2023 04:50:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31N4omBc052399; Thu, 23 Feb 2023 04:50:48 GMT (envelope-from git) Date: Thu, 23 Feb 2023 04:50:48 GMT Message-Id: <202302230450.31N4omBc052399@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: a17065710862 - main - unix/dgram tests: match the kernel behavior 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: a170657108623cd48e3d695ca74c428a564912ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=a170657108623cd48e3d695ca74c428a564912ee commit a170657108623cd48e3d695ca74c428a564912ee Author: Gleb Smirnoff AuthorDate: 2023-02-23 04:44:46 +0000 Commit: Gleb Smirnoff CommitDate: 2023-02-23 04:44:46 +0000 unix/dgram tests: match the kernel behavior In CURRENT for some time an overflowed unix/dgram socket would return EAGAIN if it has O_NONBLOCK set. This proved to be undesired. See 71e70c25c00 for details. Update tests to match the "new" behavior, which actually is the historical behavior. --- tests/sys/kern/unix_dgram.c | 7 +++++-- tests/sys/kern/unix_passfd_test.c | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/unix_dgram.c b/tests/sys/kern/unix_dgram.c index 891cc4a58f5c..9e9d4881a61e 100644 --- a/tests/sys/kern/unix_dgram.c +++ b/tests/sys/kern/unix_dgram.c @@ -156,10 +156,13 @@ ATF_TC_BODY(basic, tc) ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1); ATF_REQUIRE(errno == ENOBUFS); - /* Fail with EAGAIN with O_NONBLOCK set. */ + /* + * Fail with ENOBUFS with O_NONBLOCK set, too. See 71e70c25c00 + * for explanation why this behavior needs to be preserved. + */ ATF_REQUIRE(fcntl(fd[0], F_SETFL, O_NONBLOCK) != -1); ATF_REQUIRE(send(fd[0], buf, maxdgram, 0) == -1); - ATF_REQUIRE(errno == EAGAIN); + ATF_REQUIRE(errno == ENOBUFS); /* Remote side closed -> ECONNRESET. */ close(fd[1]); diff --git a/tests/sys/kern/unix_passfd_test.c b/tests/sys/kern/unix_passfd_test.c index 92b8d73f2f4a..16a9a304bf3a 100644 --- a/tests/sys/kern/unix_passfd_test.c +++ b/tests/sys/kern/unix_passfd_test.c @@ -532,8 +532,13 @@ ATF_TC_BODY(send_overflow, tc) nfiles = openfiles(); tempfile(&putfd); len = sendfd_payload(fd[0], putfd, buf, sendspace); +#if TEST_PROTO == SOCK_STREAM ATF_REQUIRE_MSG(len == -1 && errno == EAGAIN, "sendmsg: %zu bytes sent, errno %d", len, errno); +#elif TEST_PROTO == SOCK_DGRAM + ATF_REQUIRE_MSG(len == -1 && errno == ENOBUFS, + "sendmsg: %zu bytes sent, errno %d", len, errno); +#endif close(putfd); ATF_REQUIRE(nfiles == openfiles()); closesocketpair(fd);