From nobody Thu Jan 22 17:17:54 2026 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 4dxnnb1q4vz6Q48g for ; Thu, 22 Jan 2026 17:17:55 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dxnnb0Kkbz3dsQ for ; Thu, 22 Jan 2026 17:17:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769102275; 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=9Q8ggcrhTIb4BcPYUfJeM9zsz06Q1sxubEhpCSICss4=; b=hzlSqYyZkd3Kv+jUm6KyWvnN7qm9B6l10nNVoGkSGc0SdCCvZ2qVPkjvMBjUjfmdZ72OJq FDyFFSbbgn9vWiggN1hWUDjfr34K4ObUush6wjYP/GvAT0ED/2zJQa3w9merhO9t9L6OlU ymq4mWLUFCbEJ96/ZmXTs4P1WbZSYNaEau3pEOHy6swJ7tgDm5XNZtkMifDmNGzcSS/8/5 hkfyvC0jVZG+NLbXGkeSJfqoaO02ny+aR+2dNquXkukZ8XnU9o8mbqOR0EHQMWPkVZZ+oa Bf4Yt8bhDJyBBq/DKafG2zQMXmr6juuYfznz4JJuDodZRDxD3YsZK0awIjGheA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769102275; 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=9Q8ggcrhTIb4BcPYUfJeM9zsz06Q1sxubEhpCSICss4=; b=HRxv82qaNADFBcrYn5PCSWS6zNaxZbO8cWrfB4Lbaa8dvvv8tEKDRMPdglvNvonW/uipOQ EStahCSetY0EfggXiHw10i0z4ssEruL03kmwsxYGCGsPlMCZIp2Tbu6hShAIvmGLgQRf1f DFAIsvTBDmg1WoqhAgbpAa+YRn30J1jzv3DpvIvcdObEfh4AGPktFA8F/drrSWNr+GLGJU L1xxoKtUSzcn2sI/G43LhvDh8LV3FaHK0mUltAbmj69fV5wnYQByd5t5dWxpQUO5lRrzRc 6uH4HhGCsrrFlGw80mBUI0MxX0P64YTyFi2hc3GIhAyQbRPld493cJGVXP5mow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769102275; a=rsa-sha256; cv=none; b=cIstQmeP3tuR9c57BE1l9qwArAWtqUii608j0t9dLRCljo+88L4x+iGA4wJ8TrMOeB//hv Ll3/oK1vsSBso5HB74GI5n9OcxeAlCbBQk14CRH57b+TvV5zkdS6becKQszj3pst0WL9Wf iBoGN6e800Dib+K+kiFsIKhHOglfhOjrii/O1Ui/vF8C+w8xa8fHrKjNi4mSKlljHauQ0h 8oWtsAkWTfTVP/Uak1GVNX9S7zqzniJ6u1kf+k5wnwTle2Kv18mmmbhccGp+01Xe0suKBg 1K534UMtz9nqslF4WjI1XDwSu65HwzFqECfMiTUHMopo3JA4wPr9wfS6wvcXlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dxnnZ6brXzj8w for ; Thu, 22 Jan 2026 17:17:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 373f3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 22 Jan 2026 17:17:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ffdbc1bc2170 - main - syslogd/tests: Use a helper function to log from within a jail 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ffdbc1bc2170226547fcad036f01f379625886dd Auto-Submitted: auto-generated Date: Thu, 22 Jan 2026 17:17:54 +0000 Message-Id: <69725bc2.373f3.631c259e@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ffdbc1bc2170226547fcad036f01f379625886dd commit ffdbc1bc2170226547fcad036f01f379625886dd Author: Mark Johnston AuthorDate: 2026-01-22 15:50:14 +0000 Commit: Mark Johnston CommitDate: 2026-01-22 15:50:14 +0000 syslogd/tests: Use a helper function to log from within a jail This is just for consistency with all other logger(1) invocations, which happen from the syslogd_log() function. No functional change intended. Reviewed by: jlduran MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D54778 --- usr.sbin/syslogd/tests/syslogd_test.sh | 60 ++++++++++++++------------- usr.sbin/syslogd/tests/syslogd_test_common.sh | 7 ++++ 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/usr.sbin/syslogd/tests/syslogd_test.sh b/usr.sbin/syslogd/tests/syslogd_test.sh index 5422e78f6831..fbe390d93aae 100644 --- a/usr.sbin/syslogd/tests/syslogd_test.sh +++ b/usr.sbin/syslogd/tests/syslogd_test.sh @@ -419,15 +419,16 @@ allowed_peer_body() syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32' # Make sure that a message from 169.254.0.2:514 is logged. - atf_check jexec syslogd_client \ - logger -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" + # ... but not a message from port 515. - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" atf_check -o not-match:"test2: hello, world" cat "${logfile}" - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" atf_check -o not-match:"test2: hello, world" cat "${logfile}" syslogd_stop @@ -435,11 +436,11 @@ allowed_peer_body() # Now make sure that we can filter by port. syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32:515' - atf_check jexec syslogd_client \ - logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" atf_check -o not-match:"test3: hello, world" cat "${logfile}" - atf_check jexec syslogd_client \ - logger -p user.debug -t test4 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test4 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" atf_check -o match:"test4: hello, world" cat "${logfile}" syslogd_stop @@ -472,10 +473,10 @@ allowed_peer_forwarding_body() # A message forwarded to 169.254.0.1:514 should be logged, but one # forwarded to 169.254.0.1:515 should not. - atf_check jexec syslogd_client \ - logger -h 169.254.0.2 -p user.debug -t test1 "hello, world" - atf_check jexec syslogd_client \ - logger -h 169.254.0.2 -p mark.debug -t test2 "hello, world" + syslogd_log_jail syslogd_client \ + -h 169.254.0.2 -p user.debug -t test1 "hello, world" + syslogd_log_jail syslogd_client \ + -h 169.254.0.2 -p mark.debug -t test2 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" atf_check -o not-match:"test2: hello, world" cat "${logfile}" @@ -502,19 +503,19 @@ allowed_peer_wildcard_body() syslogd_start -j syslogd_allowed_peer -b 169.254.0.1:514 -a '169.254.0.2/32:*' # Make sure that a message from 169.254.0.2:514 is logged. - atf_check jexec syslogd_client \ - logger -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test1 -h 169.254.0.1 -S 169.254.0.2:514 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" # ... as is a message from 169.254.0.2:515, allowed by the wildcard. - atf_check jexec syslogd_client \ - logger -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test2 -h 169.254.0.1 -S 169.254.0.2:515 "hello, world" atf_check -o match:"test2: hello, world" cat "${logfile}" # ... but not a message from 169.254.0.3. - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:514 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:514 "hello, world" atf_check -o not-match:"test3: hello, world" cat "${logfile}" - atf_check -o ignore jexec syslogd_client \ - logger -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" + syslogd_log_jail syslogd_client \ + -p user.debug -t test3 -h 169.254.0.1 -S 169.254.0.3:515 "hello, world" atf_check -o not-match:"test3: hello, world" cat "${logfile}" syslogd_stop @@ -567,15 +568,16 @@ __EOF__ syslogd_start -j syslogd_server -f ${PWD}/server_config -b 169.254.0.1 -b 169.254.0.2 syslogd_start -j syslogd_client -f ${PWD}/client_config -P ${SYSLOGD_PIDFILE}.2 - atf_check jexec syslogd_client \ - logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p user.debug -t test1 "hello, world" - atf_check jexec syslogd_client \ - logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p mail.debug -t test2 "you've got mail" - atf_check jexec syslogd_client \ - logger -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p ftp.debug -t test3 "transfer complete" - + syslogd_log_jail syslogd_client \ + -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p user.debug -t test1 "hello, world" atf_check -o match:"test1: hello, world" cat "${logfile}" + + syslogd_log_jail syslogd_client \ + -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p mail.debug -t test2 "you've got mail" atf_check -o match:"test2: you've got mail" cat "${logfile}" + + syslogd_log_jail syslogd_client \ + -h 169.254.0.3 -P $SYSLOGD_UDP_PORT -p ftp.debug -t test3 "transfer complete" atf_check -o match:"test3: transfer complete" cat "${logfile}" } forward_cleanup() diff --git a/usr.sbin/syslogd/tests/syslogd_test_common.sh b/usr.sbin/syslogd/tests/syslogd_test_common.sh index f06eb417d423..87e9080d99ca 100644 --- a/usr.sbin/syslogd/tests/syslogd_test_common.sh +++ b/usr.sbin/syslogd/tests/syslogd_test_common.sh @@ -96,6 +96,13 @@ syslogd_log() atf_check -s exit:0 -o empty -e empty logger $* } +syslogd_log_jail() +{ + local jailname=$1 + shift + atf_check -s exit:0 -o empty -e empty jexec ${jailname} logger $* +} + # Make syslogd reload its configuration file. syslogd_reload() {