snap-gnocchi/tests/gnocchi_daemons.sh
Corey Bryant 267811c32b Various updates to get snap and tests working
* Drop gnocchi.conf from snap source in favor of installing it (as well as
  api-paste.ini and policy.json) from upstream source.
* Drop gnocchi-api entry point in favor of using gnocchi-uwsgi and
  gnocchi-nginx to serve API requests.
* Move to gnocchi 4.0.2 source.
* Update gnocchi-snap.conf.j2 template with $SNAP_COMMON paths.
* Add statsd and change-sack-size entry points and modify existing entry
  points to use snap-openstack.
* Add test configs that enable a working gnocchi.
* Enhance test scripts and split into separate scripts.
* Bring back oslo-config-dirs.patch and upper constraints as they're
  needed for ocata.
2017-09-05 18:34:08 +00:00

26 lines
531 B
Bash
Executable File

#!/bin/bash
set -ex
ret=0
DAEMONS=('snap.gnocchi.uwsgi' 'snap.gnocchi.nginx' 'snap.gnocchi.metricd' 'snap.gnocchi.statsd')
for daemon in "${DAEMONS[@]}"; do
sudo systemctl restart $daemon
TIMEOUT=50
while [ "$TIMEOUT" -gt 0 ]; do
if systemctl is-active $daemon > /dev/null; then
echo "OK"
break
fi
TIMEOUT=$((TIMEOUT - 1))
sleep 0.1
done
if [ "$TIMEOUT" -le 0 ]; then
echo "ERROR: ${daemon} IS NOT RUNNING"
ret=1
fi
done
exit $ret