From nobody Thu Jul 04 21:29:10 2024 X-Original-To: dev-commits-ports-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 4WFVCB324Zz5PqCY; Thu, 04 Jul 2024 21:29:10 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WFVCB2Ydhz4QD3; Thu, 4 Jul 2024 21:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720128550; 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=lBuGn/Ke+ggw0X1cfQI73yjUo6dovFVzpaDsCPNnZL8=; b=eprh1++/hDG/zO/P0el05yPXAp6j0h5jE/hNhjtZO1QIL2KJXHVE/mxDbC1gtsYw8/xhuW mUTVEwf7UIONVG3Wm4hVXvSxmiR2mIgeZ9r1Y6gtNV0N2zb/CeCQO5k/3AXTebjxgCD/K+ hEIMdLwAUPRajv4iJA/dLICq07lML+jWIQNb7LatcE4N7926NrfENx5XA2meJFQfDFYUjt xO+CFaPO76GqV0Ow6gbWK+KqLRJa3cEsYtVv0LTEmFOnhhLx5uhTz0SeiLsU5Am2Jg6ToR UsrtyQapCUnIBQervlWMlm6Y59BiRmFtB4kVH7vS7m0w5hieWc8FN/cYlO2/6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720128550; a=rsa-sha256; cv=none; b=bK0hzFN0JqFh1nWn6tJH184dnRC0bJO3sWx9Cj3lf4KO16VQZ03WYzHr6QM29rOFtV7CFx OQifIqdl8/jsxUb9t1oZaeOZ0hOoPFT/C31/D1Akp8G2yP2hEX8JrOsSliJWYj3+Qpv+oF Ci2gvscSbcNUV16XWHgvs22y5gbPJOEfXuwFVCtx4imqYsF9GyGmPYhuJtvyuLMtqg4iYE BN4M0cysxenk0jFWQXGtfZgma9PpBcaFkdkQlGU/yyPDQbk6KIMqy26GEVqi3u//pMKTvn Tf4tvNPq6quCnGS9PB6ajLmKo9bjIzIZ9Vye2SCuhvRtBFvHDSLxaU3J1gxE9A== 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=1720128550; 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=lBuGn/Ke+ggw0X1cfQI73yjUo6dovFVzpaDsCPNnZL8=; b=NXR1bdEx9NtZAG4tx9rqdjd9uhZU/j+yUWqjQyrwduwxsheitTcYQDUDhVLhF5YE0NU7/Z wSwUo/EdS7b9sSg26KH00kviPPw7M4L8tN+Nh0EMEypZaDLMDKfBN74tbsY4VVXw8qpekC 1hTnl5L+jvQISriM79PQywdThBR/07J4k7gL5LnY1ZguBO0psEQVOKfCuwu8U6OW1vCHkS +qneZGfM3X0pC2Z0saAow3iU4ljCRe5XZ34pC7tSqaaZFI8P8is7sNgkG2534cwg732oNy 8ui7A8iYshY7A8O2EVEprCveTUj9DBkKakZqQfKiKh4zHetdH1kw6YUrJCcq/w== 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 4WFVCB28qKzTDH; Thu, 4 Jul 2024 21:29:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 464LTAr3093341; Thu, 4 Jul 2024 21:29:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 464LTA2Q093338; Thu, 4 Jul 2024 21:29:10 GMT (envelope-from git) Date: Thu, 4 Jul 2024 21:29:10 GMT Message-Id: <202407042129.464LTA2Q093338@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Ronald Klop Subject: git: 05637021054d - main - databases/mongodb60: add do-test target List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ronald X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05637021054d6121cfdd14716298a0809dc15bfc Auto-Submitted: auto-generated The branch main has been updated by ronald: URL: https://cgit.FreeBSD.org/ports/commit/?id=05637021054d6121cfdd14716298a0809dc15bfc commit 05637021054d6121cfdd14716298a0809dc15bfc Author: Ronald Klop AuthorDate: 2024-07-03 19:27:07 +0000 Commit: Ronald Klop CommitDate: 2024-07-04 21:28:55 +0000 databases/mongodb60: add do-test target The port has had situation in which the code compiled, but the executables did not work. Try to catch this early. - pkg-message: use default mongo portnr instead of portnr used by unifi. --- databases/mongodb60/Makefile | 3 +++ databases/mongodb60/files/make.test.sh | 31 +++++++++++++++++++++++++++++++ databases/mongodb60/pkg-message | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/databases/mongodb60/Makefile b/databases/mongodb60/Makefile index 654d6a78fb94..159813d1747f 100644 --- a/databases/mongodb60/Makefile +++ b/databases/mongodb60/Makefile @@ -145,4 +145,7 @@ do-install: .endfor ${RM} ${STAGEDIR}${PREFIX}/bin/resmoke.py +do-test: + ${SH} ${FILESDIR}/make.test.sh "${STAGEDIR}${PREFIX}/bin" + .include diff --git a/databases/mongodb60/files/make.test.sh b/databases/mongodb60/files/make.test.sh new file mode 100755 index 000000000000..3d74258a446a --- /dev/null +++ b/databases/mongodb60/files/make.test.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +usage() { + echo "Usage: $0 " + echo " path to the executables" +} + +test "$#" -eq 1 || ( usage && exit 1 ) + +set -x + +PATH="$1:$PATH" + +DBDIR=$( mktemp -d -t tmp.mongodb ) + +trap 'rm -rf "$DBDIR"' EXIT + +# Trivial check if the binaries execute at all. +mongod -version +mongos -version + +# Check if an empty database can be created. +mkdir "$DBDIR/db" +tail -F "$DBDIR/log" | ( grep -qFe "Waiting for connections" && kill $(cat "$DBDIR/pid") ) & +script -eF "$DBDIR/log" \ + timeout -s TERM -k 30s 60s \ + mongod --dbpath "$DBDIR/db" --pidfilepath "$DBDIR/pid" + +echo "Test successful" diff --git a/databases/mongodb60/pkg-message b/databases/mongodb60/pkg-message index 047b46f2ccb1..90e9481de3d1 100644 --- a/databases/mongodb60/pkg-message +++ b/databases/mongodb60/pkg-message @@ -9,7 +9,7 @@ MongoDB 6.0 and up do not include the 'mongo' CLI shell anymore. You can use the MongoDB Shell (https://github.com/mongodb-js/mongosh). # pkg install npm $ npm install mongosh -$ npx mongosh mongodb://127.0.0.1:27117/ +$ npx mongosh mongodb://127.0.0.1:27017/ EOM }