From 5935cb7fb893a03ec5c4a7df92510fa53f92fbc4 Mon Sep 17 00:00:00 2001 From: Unitech Date: Tue, 6 Dec 2016 16:46:10 +0100 Subject: [PATCH] (startup)(test) enable upstart test --- test/bash/startup.sh | 16 ++++++++++++---- test/pm2_behavior_tests.sh | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/test/bash/startup.sh b/test/bash/startup.sh index bbf847ad..60c209ce 100644 --- a/test/bash/startup.sh +++ b/test/bash/startup.sh @@ -1,13 +1,21 @@ #!/usr/bin/env bash +if [ "$EUID" -ne 0 ] +then + echo "Please run as root" + exit +fi + SRC=$(cd $(dirname "$0"); pwd) source "${SRC}/include.sh" cd $file_path $pm2 startup upstart -u $USER --hp $HOME +spec "should startup command generation exited succesfully" ll /etc/init.d/pm2 -$pm2 ls -$pm2 kill - -$pm2 unstartup systemd +spec "should have generated upstart file" +$pm2 unstartup upstart +spec "should have disabled startup" +ll /etc/init.d/pm2 +spec "should have deleted upstart file" diff --git a/test/pm2_behavior_tests.sh b/test/pm2_behavior_tests.sh index a13e4888..6c7c280b 100644 --- a/test/pm2_behavior_tests.sh +++ b/test/pm2_behavior_tests.sh @@ -21,6 +21,8 @@ spec "Second hard cli tests" # Power feature bash ./test/bash/pm2-dev.sh spec "pm2-dev" +bash ./test/bash/startup.sh +spec "upstart startup test" # bash ./test/bash/docker.sh # spec "Docker tests" bash ./test/bash/nvm-node-version.sh