mirror of
https://git.freebsd.org/ports.git
synced 2025-04-30 10:36:38 -04:00
Changes: https://www.mongodb.com/docs/manual/release-notes/5.0/#5.0.28---jul-09--2024 do-test: The port has had situations in which the code compiled, but the executables did not work. Try to catch this early with make test.
32 lines
622 B
Bash
Executable file
32 lines
622 B
Bash
Executable file
#! /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
|
|
mongo --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"
|