From 08eb6004792673d560b8a1c17ac28fbbea960324 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Tue, 10 Sep 2013 13:30:09 -0400 Subject: [PATCH] Fail tests early if mongod is not found Instead of letting the tests report connection errors, check for the mongod process early and don't run the tests at all if it is not found. Change-Id: Iebf420ba62954ffe0d2b9c23375c9a0ff9673845 --- run-tests.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/run-tests.sh b/run-tests.sh index e1bec0296a..0e20ce54a1 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -27,6 +27,11 @@ MONGO_PORT=29000 trap "clean_exit" EXIT mkfifo ${MONGO_DATA}/out export PATH=${PATH:+$PATH:}/sbin:/usr/sbin +if ! which mongod >/dev/null 2>&1 +then + echo "Could not find mongod command" 1>&2 + exit 1 +fi mongod --maxConns 32 --nojournal --noprealloc --smallfiles --quiet --noauth --port ${MONGO_PORT} --dbpath "${MONGO_DATA}" --bind_ip localhost &>${MONGO_DATA}/out & MONGO_PID=$! # Wait for Mongo to start listening to connections