Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Apr 2026 02:12:56 +0000
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 8dc56cb5c4cd - main - security/openssh-portable: Fix `make test`
Message-ID:  <69eec628.33386.4f16a6c4@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by bdrewery:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8dc56cb5c4cd68ebfcc9ef2dec8b2adfe2eb7310

commit 8dc56cb5c4cd68ebfcc9ef2dec8b2adfe2eb7310
Author:     Bryan Drewery <bdrewery@FreeBSD.org>
AuthorDate: 2026-04-27 02:11:06 +0000
Commit:     Bryan Drewery <bdrewery@FreeBSD.org>
CommitDate: 2026-04-27 02:12:23 +0000

    security/openssh-portable: Fix `make test`
    
    No changes here affect the build or package.
---
 security/openssh-portable/Makefile | 36 ++++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/security/openssh-portable/Makefile b/security/openssh-portable/Makefile
index cb44c111823a..0b2b33626d6e 100644
--- a/security/openssh-portable/Makefile
+++ b/security/openssh-portable/Makefile
@@ -233,15 +233,39 @@ post-install:
 	${INSTALL_DATA} ${WRKSRC}/HPN-README ${STAGEDIR}${DOCSDIR}
 .endif
 
+# percent test does not work unless user's $HOME is set properly.
+SKIP_LTESTS= percent
+
+# A tempdir is used to avoid unix socket namelen issues.
+# TEST_SSH_UNSAFE_PERMISSIONS is because /tmp is world-writable, but
+# the actual test dir is not.
+# Some TEST_SSH_* paths are passed in because test-exec.sh defaults to base
+# versions for them due to being outside of PATH.
 test: build
-	cd ${WRKSRC} && ${SETENV} -i \
-		OBJ=${WRKDIR} ${MAKE_ENV:NHOME=*} \
+	@rtmp=$$(mktemp -dt ssh-regress); \
+	chmod o-rx "$${rtmp}"; \
+	trap "'${RM} $${rtmp}'; exit 1" 1 2 3 5 10 13 15; \
+	${TAR} -cf - -C ${WRKSRC} . | ${TAR} -xf - -C $${rtmp}; \
+	cd $${rtmp} && ${SETENV} -i \
+		${MAKE_ENV:NHOME=*:NPATH=*} \
 		TEST_SHELL=${SH} \
-		SUDO="${SUDO}" \
+		${SUDO:DSUDO="${SUDO}"} \
 		LOGNAME="${LOGNAME}" \
-		HOME="${HOME}" \
+		HOME="$${rtmp}" \
+		TEST_SSH_UNSAFE_PERMISSIONS=1 \
 		TEST_SSH_TRACE=yes \
-		PATH=${WRKSRC}:${PREFIX}/bin:${PREFIX}/sbin:${PATH} \
-		${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} tests
+		TEST_SSH_FAIL_FATAL=yes \
+		TEST_SSH_SFTPSERVER=$${rtmp}/sftp-server \
+		TEST_SSH_SSHD_SESSION=$${rtmp}/sshd-session \
+		TEST_SSH_SSHD_AUTH=$${rtmp}/sshd-auth \
+		PATH=$${rtmp}:${PREFIX}/bin:${PREFIX}/sbin:${PATH} \
+		${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} tests \
+		BUILDDIR="$${rtmp}" \
+		abs_top_srcdir="$${rtmp}" \
+		abs_top_builddir="$${rtmp}" \
+		.OBJDIR="$${rtmp}" \
+		${LTESTS:DLTESTS="${LTESTS}"} \
+		${SKIP_LTESTS:DSKIP_LTESTS="${SKIP_LTESTS}"}; \
+	${RM} -R "$${rtmp}"
 
 .include <bsd.port.post.mk>


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69eec628.33386.4f16a6c4>