Skip to content

Commit

Permalink
[dist] added check for recommended services
Browse files Browse the repository at this point in the history
  • Loading branch information
M0ses committed Apr 15, 2016
1 parent 4ed7fe9 commit 40eba9f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions dist/t/0070-check_recommended_services.ts
@@ -0,0 +1,43 @@
#!/bin/bash

export BOOTSTRAP_TEST_MODE=1
export NON_INTERACTIVE=1
export BASH_TAP_ROOT=$(dirname $0)

. $(dirname $0)/bash-tap-bootstrap

plan tests 4

for i in $(dirname $0)/../setup-appliance.sh /usr/lib/obs/server/setup-appliance.sh;do
[[ -f $i && -z $SETUP_APPLIANCE ]] && SETUP_APPLIANCE=$i
done

if [[ -z $SETUP_APPLIANCE ]];then
BAIL_OUT "Could not find setup appliance"
fi

. $SETUP_APPLIANCE

MAX_WAIT=300

tmpcount=$MAX_WAIT

# Service enabled and started
for srv in \
obsdodup \
obsdeltastore
do
STATE=` systemctl is-enabled $srv\.service 2>/dev/null`
is "$STATE" "enabled" "Checking recommended service '$srv' enabled"
ACTIVE=`systemctl is-active $srv\.service`
while [[ $ACTIVE != 'active' ]];do
tmpcount=$(( $tmpcount - 1 ))
ACTIVE=`systemctl is-active $srv\.service`
if [[ $tmpcount -le 0 ]];then
ACTIVE='timeout'
break
fi
sleep 1
done
is "$ACTIVE" "active" "Checking recommended service '$srv' status"
done

0 comments on commit 40eba9f

Please sign in to comment.