From nobody Fri Feb 23 12:11:21 2024 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 4Th84V0B49z5CM6n; Fri, 23 Feb 2024 12:11:22 +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 4Th84T4Q9rz4mrK; Fri, 23 Feb 2024 12:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708690281; 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=dD34J4Z5+JjMQBRd2d1tghx38rJsy/JtgaTFuVBoc5s=; b=a8oGqtnf/QLch6PT8DZh0KfTGwhHQ8c3RFxM6CvpIamm+iTQBgfzNBWwZuPPbCyDvn5Q6u cdumLfxhW4jrCEPQlo/EhTgrPIEYdTwwOhRKBbqY0A0zawcMTVmjHZB8M0FebJ2XA2PUg1 nP4GyaEo0Y/+5vXaWG4XiAbHQMSuh4JyU7CqD4FdV+RzhPRUPEsA0aHgHv0IgDz1sWGPHo vtyx3I2pEfcp/0umHi4JD2Y0op9oki1HGUY0J2FbmIX8IQaNAc9Mw9mHuVW1SYjEAWdrlJ vkHTcXz3cPTJntfTM9XHxRu+UHOm1S/nQnJNyE3n8ekMz2ZscFHzcE8dwj/z+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708690281; a=rsa-sha256; cv=none; b=L5kEF2tzs+g6gmaW7cYkvwogz6fdY3YAQ+i1pC2B7ekIWnp0zsmOSBjjYPGAKyGLbqzSgJ gRAr+eguD1td3p3FGMxkR56jLaxQjOs0nBCBOKxBgS8FsVu/qqNnGchOhHxlgTYmtvfqOF M2SYF5SUvuJ7Jx9zJfy6r3oQs9lq/BY3QkPaQ7HQfKqdNschM2rFYwO5XBgwDDW25Dk9Cc BtRdExNku7mab4gOkEWX9FjHtBpzdtBmNKOWn4/dpMDiXXeB/PEINhefSQat3xGHho1rFh vu/ys5y7c9vTyTcpKMAw8NgiKup8f3yz0fzF00FtLgmG5xVfXcbIhfEHOpNAsA== 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=1708690281; 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=dD34J4Z5+JjMQBRd2d1tghx38rJsy/JtgaTFuVBoc5s=; b=VpRhp2sA5ls/e2Ago7Gb9kgmwSRWNY6DUG1ZE+CPCo798DtH8qf3aI1bPuXw9hqfMs+pZJ 74r3MlGD7552lBxZbhXTAto35jTKQnbDD+Ndxqn61CRtdPYz+pZdoAqEfb1xzpC2XDP9Pw 9Kto6FjOeGLvR6b6ZfpAytDXQ1Z1aSUM0kFjVuAh5algV45em9hsJSR/dDMDa/EsSzkP0t q2+KRSYw3RskzcmTgFSEPPz4sjS4fd3IHaZtm98ChuDQvNB42/B/9mLmrcdkHrPhiipR1/ YcwJJUHCtONOsM4NOFHDutzKUOe6lwyma5jg1DDm13cyIvSZRJPq26oS9lR2bg== 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 4Th84T3NHZzFkV; Fri, 23 Feb 2024 12:11:21 +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 41NCBLAW030671; Fri, 23 Feb 2024 12:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NCBLPw030667; Fri, 23 Feb 2024 12:11:21 GMT (envelope-from git) Date: Fri, 23 Feb 2024 12:11:21 GMT Message-Id: <202402231211.41NCBLPw030667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: 161984ade1fa - main - tests: Fixing incomplete atf_skip if missing jail condition 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: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 161984ade1fa0638b732dc9c60bc9bb346e60be9 Auto-Submitted: auto-generated The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/src/commit/?id=161984ade1fa0638b732dc9c60bc9bb346e60be9 commit 161984ade1fa0638b732dc9c60bc9bb346e60be9 Author: Olivier Cochard AuthorDate: 2024-02-23 12:02:40 +0000 Commit: Olivier Cochard CommitDate: 2024-02-23 12:08:09 +0000 tests: Fixing incomplete atf_skip if missing jail condition Testing the scripts outside kyua(1) was a bad idea: It didn't allow me to detect that they were faulty. Sponsored by: Netflix --- bin/hostname/tests/hostname_test.sh | 3 +++ sys/kern/sysctl_security_jail_children.sh | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/hostname/tests/hostname_test.sh b/bin/hostname/tests/hostname_test.sh index 2ad6a1a5c358..a4d4d54bb052 100644 --- a/bin/hostname/tests/hostname_test.sh +++ b/bin/hostname/tests/hostname_test.sh @@ -81,6 +81,9 @@ basic_body() } basic_cleanup() { + if ! which -s jail; then + atf_skip "This test requires jail" + fi recycle } diff --git a/sys/kern/sysctl_security_jail_children.sh b/sys/kern/sysctl_security_jail_children.sh index 6ac6aa904dbc..d4c57915880f 100644 --- a/sys/kern/sysctl_security_jail_children.sh +++ b/sys/kern/sysctl_security_jail_children.sh @@ -33,12 +33,12 @@ max_cur_head() { atf_set descr 'Test maximum and current number of child jails' atf_set require.user root - if ! which -s jail; then - atf_skip "This test requires jail" - fi } max_cur_body() { + if ! which -s jail; then + atf_skip "This test requires jail" + fi origin_max=$(sysctl -n security.jail.children.max) origin_cur=$(sysctl -n security.jail.children.cur)