From nobody Wed Mar 2 21:57:24 2022 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 E592319E0875; Wed, 2 Mar 2022 21:57:27 +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 4K87JP6sDcz3KXM; Wed, 2 Mar 2022 21:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646258246; 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=HgSzSgNRGmfWRc+M+yVbNrECKb/SFKztM5z91AdaIGM=; b=SPVbKzr7nLITcw32U82stoy7u6YWRFcIUdxu3hRAWD2kRkp5thFpCDnaznkMtxtrt/exou t1/H+TjdDgAot2ALR+nhv+doigZxceiqsiRnN6oYmoJTMbgdDbTfQn26glx2tutoVQuLmo KBmCgUt6mA7tm2oYx4Vg1SjPAIMUkNkGdEAX7SoB/5zZAqZxpLrzl16B64iR1Pc3rv5Nn1 ifsHYbtuZxBxhthNiyd4ZsffAa2J2l+kWu4jEUx+IGk9FfwK2xFrIAfXXQS1JGZ1g11RLp sMzrOlRzgM7+TbeWxFkcxe5Pb2kBldYeq9j4KIX/eMCSnpjcAKh804rVV6hPYw== 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 EC1C83467; Wed, 2 Mar 2022 21:57:24 +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 222LvO4F065192; Wed, 2 Mar 2022 21:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 222LvOko065191; Wed, 2 Mar 2022 21:57:24 GMT (envelope-from git) Date: Wed, 2 Mar 2022 21:57:24 GMT Message-Id: <202203022157.222LvOko065191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric van Gyzen Subject: git: b49682bb0658 - stable/13 - sem_clockwait_np test: fix usage of ATF API 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: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b49682bb0658bbccaef2547c4fac2b58756acdc2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646258246; 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=HgSzSgNRGmfWRc+M+yVbNrECKb/SFKztM5z91AdaIGM=; b=Jddm7frshahsRvDntzrUz3K2IWOH57JmYj63hLui1/220TnBTBR8Lmkx3VJ6L2n9DFWBf8 EJAXUsR+LO68e7F9tHOz/k2c5gydVoxRb1ToAdp2kTJH0p5Ib/LwyINONaZmuMdpxm4Vaq ArxfmFm/2Vjo3dsYAlUp6egwfz6EBGyA0Fz/cY0nFVRZ90K4erIyI7g9sYGZiD4CWLvPlE HA13NJi7I6dWgRwj3okuwIJhqp9TqXOjarQv/EDHoyN6ir2qPjxbYysMK6KJ7WsIiSMRQ/ q9WxOF8A92/68PWUw+6FLQ41DaWrjFRwqzOAIpD5vFJvxfbP2nIoeQOsmhdVKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646258246; a=rsa-sha256; cv=none; b=VwzWG/oN+K1lAIr4gTY5q8QvyEvtOgz/biBj1rklUzjLGz8kiwacVitXDVVysg9LIuca8b glmvvsblkRLr+IBbpxE+Q1D4+VcOLvZU3WOdLfIgJ28ANoUlsK+3ZD9cPVU4TPphh96CNB 3k5IBtKQN41oTBtwJexXPTy00I265RafYNlEnrCNwq4z+oTddfwKLVzg8feu3M1OWghNOd FsbFdrCp5A4Ur0/9aijYzIJapZ9DA7PCiCXW9wzWH2zgaWV48Af20MDCF+86NMmFWdALNP sWJix2Q2vGY4TtieqYQSfUIT3yGexfjZmiQgoB1/di8jsDS2xG9N5XP4RMwRXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=b49682bb0658bbccaef2547c4fac2b58756acdc2 commit b49682bb0658bbccaef2547c4fac2b58756acdc2 Author: Eric van Gyzen AuthorDate: 2021-10-01 11:25:48 +0000 Commit: Eric van Gyzen CommitDate: 2022-03-02 21:56:30 +0000 sem_clockwait_np test: fix usage of ATF API ATF_REQUIRE_ERRNO requires the given errno iff the given expression is true. These test cases used it incorrectly, potentially allowing sem_clockwait_np to succeed when it was expected to fail. Use separate ATF calls to require failure and the expected errno. MFC after: 1 week Sponsored by: Dell EMC Isilon (cherry picked from commit 35e4527e88d3843cccf2f15a32b1fa041a01d693) --- contrib/netbsd-tests/lib/librt/t_sem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/netbsd-tests/lib/librt/t_sem.c b/contrib/netbsd-tests/lib/librt/t_sem.c index 3156b11e9bf3..1c4290c0b3fb 100644 --- a/contrib/netbsd-tests/lib/librt/t_sem.c +++ b/contrib/netbsd-tests/lib/librt/t_sem.c @@ -366,8 +366,9 @@ ATF_TC_BODY(clockwait_absolute_intr_remaining, tc) ATF_REQUIRE_MSG(clock_gettime(CLOCK_MONOTONIC, &ts) == 0, "%s", strerror(errno)); timespec_add_ms(&ts, 100); - ATF_REQUIRE_ERRNO(EINTR, sem_clockwait_np(&sem, CLOCK_MONOTONIC, + ATF_REQUIRE_EQ(-1, sem_clockwait_np(&sem, CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, &remain)); + ATF_REQUIRE_ERRNO(EINTR, 1); ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); ATF_REQUIRE_MSG(remain.tv_sec == 42 && remain.tv_nsec == 1000*1000*1000, "an absolute clockwait modified the remaining time on EINTR"); @@ -397,8 +398,9 @@ ATF_TC_BODY(clockwait_relative_intr_remaining, tc) "%s", strerror(errno)); ts.tv_sec = 0; ts.tv_nsec = 100*1000*1000; - ATF_REQUIRE_ERRNO(EINTR, sem_clockwait_np(&sem, CLOCK_MONOTONIC, 0, &ts, + ATF_REQUIRE_EQ(-1, sem_clockwait_np(&sem, CLOCK_MONOTONIC, 0, &ts, &remain)); + ATF_REQUIRE_ERRNO(EINTR, 1); ATF_REQUIRE_MSG(got_sigalrm, "did not get SIGALRM"); ATF_REQUIRE_MSG(remain.tv_sec == 0 && (remain.tv_nsec >= 25*1000*1000 || machine_is_virtual()) &&