From nobody Fri Nov 13 00:13:07 2026 X-Original-To: dev-commits-src-all@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 4jQd502plmz6xs8w; Fri, 13 Nov 2026 00:13:08 +0000 (UTC) (envelope-from siva@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jQd502H1Cz4ZYL; Fri, 13 Nov 2026 00:13:08 +0000 (UTC) (envelope-from siva@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794528788; 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: in-reply-to:in-reply-to:references:references; bh=xzM5/P9uJuARHl+UTnaFUenG+jKHrAoHAwpBnQ0Gz/g=; b=p3QTYykLQAbXhMOIlxicKjdD+QoYuZC6zCLo5zDgTbloNimTImA4PNZbvGC0vfMj8/IL+X PqDEx9G5lAEMEI0No/D3mixuJEKKqHWKYnkxyG+BlE1xGri7S24Ovj8WRpvdoHIK6nbZzE LS/yIkNKAL8oxjs9Z/vZDvSmikhI6hs/krs8WAaG2H0stW2aR6YECZGx4BbTV+QLcdjgOc xFnfnqbTiQDw1558PhBaqLPJwBfYPHVZM02pa4ZsYcBBoGm+PnE5x+IxnradbTkkdPfs9D EwKDWYI1gUx4UyovLARUQVFdYL1fLx0/WKeInqLNPJ4IJM60UhWO3V+bEtqOKg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1794528788; b=SsfwWsB3W/YniMS2tNc7f9H7LlX7HdPCqC4d8XPD2PLhC20NKvjmJ7vzs5dVMPiyBXK99g 0omYAV7MtXA4Wi8g6HvJmw3XZGESQZxbaI1nbvYyDtazwkWY8qHPOGVAc1By9ybB8oo5Ft Znirg6nki+P1aZVat/3JxO8cnsNmgjUzDIVnTuZkkjnyFCe8XV/dmoMiUmQQu9NEWwFZac OWGVhEpQvdabaQqPnQc5lBcf1828kyzmAvTAJQbPvYSsSFHpaGEUJIAl/Pb8p2OF3Hs8Hu XwFdUHvYSatFmr7bTqZvG3W03mYJ/qldjSHgeXGuJHQbwrBYpWaTeITjGvSFAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1794528788; 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: in-reply-to:in-reply-to:references:references; bh=xzM5/P9uJuARHl+UTnaFUenG+jKHrAoHAwpBnQ0Gz/g=; b=b5k0k2jiMrdStwW3cXB5i5pAARJS+Xn/TDznIMANMyD2Wmt26rbF3lfboGplpUrcSgAe6B 94awCLHck1YPR5wWRf+ZP/2Kxtchss1tBoB6r24TbhgsU4EiQJ/enj9fG51Q1Zje31h+xl OxAlin0v9K8tP2AS+7e0phje9BLBwVeAwPjIsn0zeBlkooI7MxU9S5qT0IsVT29K9RjVoF PGoS7dbxrKqpN0e/vFz01ErmZaWtKHCXudjK45aG0sjU+gICC/KlFYgG5rqAlCjQPVrFG7 ktYTtKMDnd73TmgMRvfaibiAWdhzGcXliJqATEIYoZLCWDfce0x7ql4voaUzYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from localhost (unknown [IPv6:2606:6d00:f3a:e420:e3b9:d08:d2fa:caec]) (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) (Authenticated sender: siva/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4jQd5012m6z1DYf; Fri, 13 Nov 2026 00:13:08 +0000 (UTC) (envelope-from siva@FreeBSD.org) List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 12 Nov 2026 19:13:07 -0500 Message-Id: Subject: Re: git: de6328af0c8c - main - tests/sys/kern/ssl_sendfile: :eagain_vs_eof: improve failure messaging From: "Siva Mahadevan" To: "Enji Cooper" , , , X-Mailer: aerc 0.22.0 References: <6af652f6.10773.23c7dab7@gitrepo.freebsd.org> In-Reply-To: <6af652f6.10773.23c7dab7@gitrepo.freebsd.org> On Thu Nov 12, 2026 at 116:00 UTC, Enji Cooper wrote: > The branch main has been updated by ngie: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Dde6328af0c8c0284d28574364d= b3b8d98d51e005 > > commit de6328af0c8c0284d28574364db3b8d98d51e005 > Author: Enji Cooper > AuthorDate: 2026-11-12 23:55:46 +0000 > Commit: Enji Cooper > CommitDate: 2026-11-12 23:59:37 +0000 > > tests/sys/kern/ssl_sendfile: :eagain_vs_eof: improve failure messagin= g > =20 > Convert many raw `ATF_REQUIRE(..)` macro calls to `ATF_REQUIRE_MSG(..= )` > and output the sbytes attached to the context in provide meaningful > information with failure messages. > =20 > While here, fix a typo in a comment and some indentation in another > testcase (:random). > =20 > PR: 299447 > MFC after: 1 week > --- > tests/sys/kern/ssl_sendfile.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/tests/sys/kern/ssl_sendfile.c b/tests/sys/kern/ssl_sendfile.= c > index ad938b65ef19..d44296c90750 100644 > --- a/tests/sys/kern/ssl_sendfile.c > +++ b/tests/sys/kern/ssl_sendfile.c > @@ -350,7 +350,7 @@ ATF_TC_BODY(random, tc) > require_sbytes(&c, (ssize_t)expect); > } > =20 > - common_cleanup(&c); > + common_cleanup(&c); > } > =20 > /* Truncate the file while sendfile(2) is working on it. */ > @@ -470,11 +470,12 @@ ATF_TC_BODY(eagain_vs_eof, tc) > =20 > /* > * Exercise short write due to no buffer space on non-blocking > - * socket. Internall sendfile(2) returns -1 and errno =3D=3D EAGAIN. > + * socket. Internal sendfile(2) returns -1 and errno =3D=3D EAGAIN. > */ > ATF_REQUIRE(pthread_mutex_lock(&c.mtx) =3D=3D 0); > sendme_locked_wait(&c, 0, FSIZE, true); > - ATF_REQUIRE(c.sbytes > 0); > + ATF_REQUIRE_MSG(c.sbytes > 0, "c.sbytes <=3D 0: %jd", > + (ossl_ssize_t)c.sbytes); > ATF_REQUIRE(SSL_get_error(c.srv, c.sbytes) =3D=3D 0); > #if 0 /* see https://github.com/openssl/openssl/issues/29742 */ > ATF_REQUIRE(BIO_should_retry(SSL_get_wbio(c.srv))); > @@ -484,7 +485,8 @@ ATF_TC_BODY(eagain_vs_eof, tc) > * Exercise second attempt on already full buffer. > */ > sendme_locked_wait(&c, 0, FSIZE, true); > - ATF_REQUIRE(c.sbytes =3D=3D -1); > + ATF_REQUIRE_MSG(c.sbytes =3D=3D -1, "c.sbytes !=3D -1: %jd", > + (ossl_ssize_t)c.sbytes); In the future, please use the narrower ATF_REQUIRE_*EQ or ATF_REQUIRE_*EQ_MSG macros, as they will include the expected/actual values in the message directly in a uniform way. In this file, ATF_REQUIRE_INTEQ_MSG would've worked well in many cases. I have a local WIP sweeping change patch to change all trivial equality checks using ATF_REQUIRE to the narrower macros, I'll post that for review sometime. > ATF_REQUIRE(SSL_get_error(c.srv, c.sbytes) =3D=3D SSL_ERROR_WANT_WRITE)= ; > ATF_REQUIRE(BIO_should_retry(SSL_get_wbio(c.srv))); > =20 > @@ -505,7 +507,8 @@ ATF_TC_BODY(eagain_vs_eof, tc) > * rather than asserts that this is a correct behavior. > */ > sendme_locked_wait(&c, FSIZE, 0, true); > - ATF_REQUIRE(c.sbytes =3D=3D 0); > + ATF_REQUIRE_MSG(c.sbytes =3D=3D 0, "c.sbytes !=3D 0: %jd", > + (ossl_ssize_t)c.sbytes); > ATF_REQUIRE(SSL_get_error(c.srv, c.sbytes) =3D=3D SSL_ERROR_SYSCALL); > #if 0 /* see https://github.com/openssl/openssl/issues/29742 */ > ATF_REQUIRE(!BIO_should_retry(SSL_get_wbio(c.srv))); > @@ -515,7 +518,8 @@ ATF_TC_BODY(eagain_vs_eof, tc) > * Exercise short write due to end of file. > */ > sendme_locked_wait(&c, FSIZE - 100, 0, true); > - ATF_REQUIRE(c.sbytes =3D=3D 100); > + ATF_REQUIRE_MSG(c.sbytes =3D=3D 100, "c.sbytes !=3D 100: %jd", > + (ossl_ssize_t)c.sbytes); > ATF_REQUIRE(SSL_get_error(c.srv, c.sbytes) =3D=3D 0); > #if 0 /* see https://github.com/openssl/openssl/issues/29742 */ > ATF_REQUIRE(!BIO_should_retry(SSL_get_wbio(c.srv)));