From nobody Tue Nov 16 17:56:28 2021 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 5E2701850B78; Tue, 16 Nov 2021 17:56:29 +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 4HttzK1Rh3z3kxp; Tue, 16 Nov 2021 17:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 E420011F8D; Tue, 16 Nov 2021 17:56:28 +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 1AGHuSRP038265; Tue, 16 Nov 2021 17:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AGHuSLM038264; Tue, 16 Nov 2021 17:56:28 GMT (envelope-from git) Date: Tue, 16 Nov 2021 17:56:28 GMT Message-Id: <202111161756.1AGHuSLM038264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 694c708d6a0d - main - ktls tests: Check the return values of close(). List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 694c708d6a0d00f84fa53357a1cc8a72272a26e3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=694c708d6a0d00f84fa53357a1cc8a72272a26e3 commit 694c708d6a0d00f84fa53357a1cc8a72272a26e3 Author: John Baldwin AuthorDate: 2021-11-16 17:56:15 +0000 Commit: John Baldwin CommitDate: 2021-11-16 17:56:15 +0000 ktls tests: Check the return values of close(). Suggested by: markj Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33004 --- tests/sys/kern/ktls_test.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index 64e26bb27f37..9942e78091b1 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -945,9 +945,9 @@ test_ktls_transmit_app_data(struct tls_enable *en, uint64_t seqno, size_t len) free(decrypted); free(plaintext); - close(sockets[1]); - close(sockets[0]); - close(kq); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); + ATF_REQUIRE(close(kq) == 0); } static void @@ -1031,8 +1031,8 @@ test_ktls_transmit_control(struct tls_enable *en, uint64_t seqno, uint8_t type, free(decrypted); free(plaintext); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } static void @@ -1083,8 +1083,8 @@ test_ktls_transmit_empty_fragment(struct tls_enable *en, uint64_t seqno) free(outbuf); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } static size_t @@ -1218,9 +1218,9 @@ test_ktls_receive_app_data(struct tls_enable *en, uint64_t seqno, size_t len) free(received); free(plaintext); - close(sockets[1]); - close(sockets[0]); - close(kq); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); + ATF_REQUIRE(close(kq) == 0); } #define TLS_10_TESTS(M) \ @@ -1474,8 +1474,8 @@ test_ktls_invalid_transmit_cipher_suite(struct tls_enable *en) sizeof(*en)) == -1); ATF_REQUIRE(errno == EINVAL); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } #define GEN_INVALID_TRANSMIT_TEST(name, cipher_alg, key_size, auth_alg, \ @@ -1591,8 +1591,8 @@ test_ktls_invalid_receive_cipher_suite(struct tls_enable *en) */ ATF_REQUIRE(errno == EINVAL || errno == ENOTSUP); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } #define GEN_INVALID_RECEIVE_TEST(name, cipher_alg, key_size, auth_alg, \ @@ -1631,8 +1631,8 @@ test_ktls_unsupported_receive_cipher_suite(struct tls_enable *en) sizeof(*en)) == -1); ATF_REQUIRE(errno == EPROTONOSUPPORT || errno == ENOTSUP); - close(sockets[1]); - close(sockets[0]); + ATF_REQUIRE(close(sockets[1]) == 0); + ATF_REQUIRE(close(sockets[0]) == 0); } #define GEN_UNSUPPORTED_RECEIVE_TEST(name, cipher_alg, key_size, \