/usr/lib/obs/tests/appliance/0060-check_required_services.ts is in obs-server 2.7.1-10.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/bin/bash
export BASH_TAP_ROOT=$(dirname $0)
. $(dirname $0)/bash-tap-bootstrap
plan tests 16
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
|