From nobody Sun Jan 21 18:11:06 2024 X-Original-To: dev-commits-src-branches@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 4TJ1cp538Xz57RGx; Sun, 21 Jan 2024 18:11:06 +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 4TJ1cp2nSJz4PmC; Sun, 21 Jan 2024 18:11:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705860666; 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=AWOgEhHZUVaPw84hLrAItrq0R70KzUMzR5sn2bPVUeU=; b=Q565txS8OMNv2xmtrhMn7SlxDGSJBbOcuLuRv0cqm5vTBcQYB4XmsQF2zGsiPX2YDIBB3d gyA4K85jeDCxNCg2GRNVH64wgZZwScuYUIOCP9MFYSUtvq2kgUo667uz8Wm8jgYLw/6dGw qjR8r3n4i2XhrzvLHKd9jVFkEgwx7TDW6WypATBthh4PKuz10uOwjF6Mz4KI79yZUxbMBo TuICzmnPC4x9QRnfCw822bSeYygo0Rs6fv52MbOyjFy8F1r1noapHQTffY2oaOG4qCq5M0 xfXqh0Lpwh1U6ISQz/dkS7pIVHnHNbc+ycsXZc3qQi9iyfdO7oP8uUfE7L4gDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705860666; 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=AWOgEhHZUVaPw84hLrAItrq0R70KzUMzR5sn2bPVUeU=; b=cvIJ0SOen/MQw66A7LT3BlHLmB4hmZ/I9syQL54DLIzVdI8brrkeHj9fi48UBmEr73IPmg Jp2zkEf6GaQLOEG6HQim6kGskjkTzi+ThygP6eSJzmLFumH1Mb9aMkoV/3hLKCdhcLKpmM 0WkaMq3itpIiEE+gItl2zbMEaM0sLEFIl/kduI/fJe7kLoOFG6tHg9KVFz+PyPY/w7koqw 0pfoYt6+w4CkDHm2SKa5np+i0O4jZ3ycuxFoUqjOQN2dYW00A5SmTjOL9FhXe/1Rpm3f+B uIJcaCsrLYh68dUB7e1naMO01Rf5AxUz2bTigwE/zQxWi1TLuFkiW9LK5hWj8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705860666; a=rsa-sha256; cv=none; b=oQGnm848oYyG6/DKecxEdh8aE8dwQy23NIYAk9KsePPBlTtbuLQg+DAkOaRA00flbdDusn KJ/bD5HxXcCseW6CXojvFIWtSMTvGDOs/RTyksqqTYfIp0Jiia2xHvY9ppwHMIhoobeUET 3YMA5xr4AiQTdM7qJ07AFzJV+s7jlqNjkVfwBcEdTxHe7PrXL9kcWSvnbfubIEuYJe+cfN 3QZngQHlEd91MQm8hDDSD3ESDmOirJlNuHw/ByBzfLXRyg9JCaPfiqKIMHMfqRsDU6rUlz 7tQnrmWRr4PhLk1sM8RDa0i4TsLLBBwiMR3QN0O6J3td7cvw9OzJPRwA+h2SeQ== 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 4TJ1cp1s21zSDD; Sun, 21 Jan 2024 18:11:06 +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 40LIB6q1051869; Sun, 21 Jan 2024 18:11:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40LIB63h051866; Sun, 21 Jan 2024 18:11:06 GMT (envelope-from git) Date: Sun, 21 Jan 2024 18:11:06 GMT Message-Id: <202401211811.40LIB63h051866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 559c7ac87dfb - stable/14 - renice: Clean up the tests a bit. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 559c7ac87dfbd2d6ad224541fed029a78cf50c11 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=559c7ac87dfbd2d6ad224541fed029a78cf50c11 commit 559c7ac87dfbd2d6ad224541fed029a78cf50c11 Author: Dag-Erling Smørgrav AuthorDate: 2023-12-20 16:59:37 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-01-21 16:08:48 +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 (cherry picked from commit afdce0837014fb7a41fced959c9457f89e878052) --- 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