Skip to content

Commit

Permalink
[dist] split service tests from appliance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
M0ses committed Apr 15, 2016
1 parent 4d405d8 commit 4ed7fe9
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 27 deletions.
28 changes: 1 addition & 27 deletions dist/t/0020-test-appliance.ts
Expand Up @@ -6,7 +6,7 @@ export BASH_TAP_ROOT=$(dirname $0)

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

plan tests 27
plan tests 11

for i in $(dirname $0)/../setup-appliance.sh /usr/lib/obs/server/setup-appliance.sh;do
[[ -f $i && -z $SETUP_APPLIANCE ]] && SETUP_APPLIANCE=$i
Expand All @@ -22,32 +22,6 @@ MAX_WAIT=300

tmpcount=$MAX_WAIT

# Service enabled and started
for srv in \
obsapidelayed \
obsdispatcher \
obspublisher \
obsrepserver \
obsscheduler \
obssrcserver \
apache2 \
mysql
do
STATE=` systemctl is-enabled $srv\.service 2>/dev/null`
is "$STATE" "enabled" "Checking $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 $srv status"
done

get_hostname
FQHN=$FQHOSTNAME

Expand Down
49 changes: 49 additions & 0 deletions dist/t/0060-check_required_services.ts
@@ -0,0 +1,49 @@
#!/bin/bash

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

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

plan tests 16

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 \
obsapidelayed \
obsdispatcher \
obspublisher \
obsrepserver \
obsscheduler \
obssrcserver \
apache2 \
mysql
do
STATE=` systemctl is-enabled $srv\.service 2>/dev/null`
is "$STATE" "enabled" "Checking $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 $srv status"
done

0 comments on commit 4ed7fe9

Please sign in to comment.