diff options
author | Ronald Klop <ronald@FreeBSD.org> | 2024-07-23 17:44:45 +0200 |
---|---|---|
committer | Ronald Klop <ronald@FreeBSD.org> | 2024-07-23 17:44:45 +0200 |
commit | f2c9ba7c53c9a599c36b722305a189fd912db5d2 (patch) | |
tree | accade01ff4ca28522f8702d4a8864689c862da1 /databases/mongodb80/files/make.test.sh | |
parent | sysutils/cfengine*-lts: cfengine* 3.24.0 is LTS (diff) |
databases/mongodb80: new port 8.0.0-rc14
Still release candidate, use with care.
Notes:
https://www.mongodb.com/docs/v8.0/release-notes/8.0/
Diffstat (limited to 'databases/mongodb80/files/make.test.sh')
-rwxr-xr-x | databases/mongodb80/files/make.test.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/databases/mongodb80/files/make.test.sh b/databases/mongodb80/files/make.test.sh new file mode 100755 index 000000000000..c42bb1973e6b --- /dev/null +++ b/databases/mongodb80/files/make.test.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +usage() { + echo "Usage: $0 <path>" + echo "<path> 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" |