Skip to content

Commit

Permalink
Merge pull request #304 from pengz1/Support-high-version-mongo
Browse files Browse the repository at this point in the history
 Accommodate mongodb and mongod in HWIMO
  • Loading branch information
PengTian0 committed Sep 21, 2017
2 parents 2c6cbb0 + a26b895 commit 0fb0c43
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions HWIMO-TEST
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ checkDependencies(){
echo "[ERROR]: the unit test requires rabbitmq service installed"
exit 1
fi
export mongo_status=$(service mongodb status |grep running)

# mongod works for version after 2.6
# mongodb works for version before 2.6
mongo_status=$(service mongodb status || service mongod status)
export is_mongo_running=$(echo $mongo_status |grep running)
export rabbitmq_status=$(sudo service rabbitmq-server status|grep pid)

}
Expand All @@ -24,9 +28,9 @@ cleanDatabase(){

handleDependServices(){
action=$1
if [ -z "$mongo_status" ]; then
if [ -z "$is_mongo_running" ]; then
echo "[INFO]: $action mongodb service"
sudo service mongodb $action
sudo service mongodb $action || sudo service mongod $action
fi

if [ -z "$rabbitmq_status" ]; then
Expand Down

0 comments on commit 0fb0c43

Please sign in to comment.