From nobody Wed Dec 20 16:59:50 2023 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 4SwKYM2dBsz558Gv; Wed, 20 Dec 2023 16:59:51 +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 4SwKYM1wQFz4pSY; Wed, 20 Dec 2023 16:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703091591; 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=LGWgCZEWmtqWNcSDxj4PwwkjbpJf3fqOgBF4vunWZ2I=; b=f+4L14LZ+swOZEI1tkhMNv/DbYXz5xE9N/QUrtu3EOU4Ly8reO2gRlnmbxWItFGcfeVDrM eY+yWvTxA/TQW/vJXCe1Cb5wZpmGWt+N1R/pNwK+o0BipNuO2ooujRVCkYk9q/8bG9LxoE hwA82WwFQwsfp+a6c9hAsB0kneQWQcawEgXeo4uUzodXutO2UqU+LwQnPobFfUYGASB0ok WwZFpkqRdNZHmQFYHET+tjkSk+s8HpcQHmGdorT5c88RJIvtOiUWJ5sxhJnujeSE3Q8shu KrQPsJ0CvCrPsae56DIxYaxAZAAxylNAWMyI9TEWOWLtSKVzoEJg8Etu2v+X7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703091591; a=rsa-sha256; cv=none; b=akz1byg05wV81dKNc387L4oChmT3S1sV27okN0NdHAsvSG6/WfL4JShC1GLtooJPBqI7k5 BK+KWcSPDN9+e8q1ubjwfE6aIChXlyHjWsoaQEUtdbR5dEJSv8aK2EA4q/8ZEcu+JK5CK2 1JZUW0ge3Uk610q/SdVQl5lgB9AtVK8Sue3KODwf32EM5XNfTWN7mC8FTyJzdrP0BgTZdm OTcLAldXXYSllEYqNZt7xXZZYOVgUWEYPDpyxZyeoKTB7Y9o2KFGot6KB+bnCKoxDBao4D 2p0ezXsEEnmrJkqQmwJOm/qzyw00ZcioCZ6153G+sCm5pAR/4LbN4Xyj/eTI5g== 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=1703091591; 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=LGWgCZEWmtqWNcSDxj4PwwkjbpJf3fqOgBF4vunWZ2I=; b=CIPnMzWKl2WUWj0UlPMk5QBV8pZhoQ5q7PXjnpQdFou/n+M+Q8amg70dDLl5bPuk5RQxM8 3VF0tZq0N/nBw88zteLxnIGhFPsW9W4AxeWa32XSOXWNH4+SxLjCCCTbUjvBu7Zvww0WUX OomNNBhDOnaeJiTvdUgOySPVe/H6ET8DPU0WAylUI5xxPgjt5XZFHJFJSOe0SXd6bMk6tv I9HezwzQKUnuurLV665R97EpdZ2Rx1bbFSTdA5vvxlz82I3M5KeSFtVDdvGMq/SmVVVIDN RqI5DfqM4SVdvaSUU1JoMb1bhJqL40skjEOlABRmd4Muoheju2QDddGSzNYEOQ== 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 4SwKYM0sKvzwtN; Wed, 20 Dec 2023 16:59:51 +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 3BKGxo4D083635; Wed, 20 Dec 2023 16:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BKGxopf083632; Wed, 20 Dec 2023 16:59:50 GMT (envelope-from git) Date: Wed, 20 Dec 2023 16:59:50 GMT Message-Id: <202312201659.3BKGxopf083632@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: afdce0837014 - main - renice: Clean up the tests a bit. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afdce0837014fb7a41fced959c9457f89e878052 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=afdce0837014fb7a41fced959c9457f89e878052 commit afdce0837014fb7a41fced959c9457f89e878052 Author: Dag-Erling Smørgrav AuthorDate: 2023-12-20 16:59:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-20 16:59:37 +0000 renice: Clean up the tests a bit. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: ngie, asomers Differential Revision: https://reviews.freebsd.org/D43087 --- usr.bin/renice/tests/renice_test.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/usr.bin/renice/tests/renice_test.sh b/usr.bin/renice/tests/renice_test.sh index 8a4df7879ad4..7983eb594716 100755 --- a/usr.bin/renice/tests/renice_test.sh +++ b/usr.bin/renice/tests/renice_test.sh @@ -14,8 +14,9 @@ _renice() { atf_check_nice_value() { local pid=$1 - local nice=$2 - atf_check test "$(ps -o nice= -p $pid)" -eq "$nice" + local expected=$2 + local actual="$(ps -o nice= -p $pid)" + atf_check test "$actual" -eq "$expected" } atf_test_case renice_abs_pid @@ -57,7 +58,7 @@ renice_abs_pgid_head() { renice_abs_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours - pid=$(sh -mc "sleep 60 >/dev/null & echo \$!") + pid="$(sh -mc "sleep 60 >/dev/null & echo \$!")" pgid="$(ps -o pgid= -p $pid)" nice="$(ps -o nice= -p $pid)" incr=3 @@ -73,7 +74,7 @@ renice_rel_pgid_head() { renice_rel_pgid_body() { local pid pgid nice incr # make sure target runs in a different pgrp than ours - pid=$(sh -mc "sleep 60 >/dev/null & echo \$!") + pid="$(sh -mc "sleep 60 >/dev/null & echo \$!")" pgid="$(ps -o pgid= -p $pid)" nice="$(ps -o nice= -p $pid)" incr=3 @@ -90,7 +91,7 @@ renice_abs_user_head() { } renice_abs_user_body() { local user pid nice incr - pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'") + pid="$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")" nice="$(ps -o nice= -p $pid)" incr=3 _renice $((nice+incr)) -u $TEST_USER @@ -105,7 +106,7 @@ renice_rel_user_head() { } renice_rel_user_body() { local user pid nice incr - pid=$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'") + pid="$(su -m $TEST_USER -c "/bin/sh -c 'sleep 60 >/dev/null & echo \$!'")" nice="$(ps -o nice= -p $pid)" incr=3 _renice -u -n $incr $TEST_USER