Change I8db9dc99da8bb486a07d7ead77031e1c0b419857 modified failure
paths to call worlddump.py, but this instance is looking in the wrong
path; e.g.
---
2014-12-02 20:29:21.371 | The following services are not running after upgrade: swift-proxy-server
2014-12-02 20:29:21.372 | /opt/stack/new/grenade/check-sanity: line 117: /opt/stack/new/grenade/tools/worlddump.py: No such file or directory
2014-12-02 20:29:21.373 | + die 377 'Failure in check-sanity'
---
Also, ${LOGDIR} isn't defined here, so output to the devstack screen
log dir
[1] http://logs.openstack.org/28/136328/2/check/check-grenade-dsvm/0328b64/logs/grenade.sh.txt.gz
Change-Id: I18d96a47469d34e0df51f0a6b9b9e16925a3c3df
(cherry picked from commit 12c6b73261)
126 lines
3.6 KiB
Bash
Executable File
126 lines
3.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# ``upgrade-sanity``
|
|
|
|
# this is a set of sanity checks that should be run after upgrade to make sure
|
|
# the environment actually looks like we expect, if not, die horribly
|
|
|
|
echo "*********************************************************************"
|
|
echo "Begin $0"
|
|
echo "*********************************************************************"
|
|
|
|
# Keep track of the devstack directory
|
|
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
|
|
|
|
# Import common functions
|
|
source $GRENADE_DIR/functions
|
|
|
|
# Determine what system we are running on. This provides ``os_VENDOR``,
|
|
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
|
|
# and ``DISTRO``
|
|
GetDistro
|
|
|
|
# Source params
|
|
source $GRENADE_DIR/grenaderc
|
|
|
|
# We need the OS_ credentials
|
|
source $TARGET_DEVSTACK_DIR/openrc
|
|
source $TARGET_DEVSTACK_DIR/functions
|
|
source $TARGET_DEVSTACK_DIR/localrc
|
|
|
|
|
|
function is_a_service {
|
|
local name=$1
|
|
if [[ ! $name =~ '-' ]]; then
|
|
echo "$name does not look like a valid service, skipping log check"
|
|
return 1
|
|
fi
|
|
if [[ $name =~ ^ceilometer ]]; then
|
|
echo "Ceilometer not yet supported, skipping check for $name"
|
|
return 1
|
|
fi
|
|
if [[ $name =~ ^h- ]]; then
|
|
echo "Heat not yet supported, skipping check for $name"
|
|
return 1
|
|
fi
|
|
if [[ "${DO_NOT_UPGRADE_SERVICES}" =~ "${service}" ]]; then
|
|
echo "$service not upgraded, skipping check"
|
|
return 1
|
|
fi
|
|
if [ "$name" == "q-fwaas" ]; then
|
|
echo "$name is a Neutron service plugin and doesn't run in its own process, skipping check"
|
|
return 1
|
|
fi
|
|
if [ "$name" == "q-l3" ] && [[ "$ENABLED_SERVICES" =~ "q-vpn" ]]; then
|
|
echo "$name is running as a part of q-vpn service, skipping check"
|
|
return 1
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
function test_all_enabled_services {
|
|
local tmpsvcs="${ENABLED_SERVICES}"
|
|
local service
|
|
local log
|
|
local failed=0
|
|
local not_running=""
|
|
for service in ${tmpsvcs//,/ }; do
|
|
if is_a_service $service; then
|
|
log=${SCREEN_LOGDIR}/screen-$service.log
|
|
if [[ ! -e $log ]]; then
|
|
echo "Couldn't find log for $service at $log"
|
|
not_running="$not_running,$service"
|
|
failed=1
|
|
fi
|
|
fi
|
|
done
|
|
|
|
if [[ $failed -eq 1 ]]; then
|
|
echo "Expected running services not running: $not_running"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# For a given process name, resolve the corresponding devstack service
|
|
# name as it would appear in ENABLED_SERVICES.
|
|
function process_to_service {
|
|
case "$1" in
|
|
"nova-api") echo "n-api" ;;
|
|
"nova-conductor") echo "n-cond" ;;
|
|
"nova-compute") echo "n-cpu" ;;
|
|
"keystone") echo "key" ;;
|
|
"glance-api") echo "g-api" ;;
|
|
"cinder-api") echo "c-api" ;;
|
|
"swift-object-server") echo "s-obj" ;;
|
|
"swift-proxy-server") echo "s-proxy" ;;
|
|
*) echo "$1" ;;
|
|
esac
|
|
}
|
|
|
|
test_all_enabled_services
|
|
|
|
# all the services should actually be running that we expect
|
|
NOT_RUNNING=""
|
|
RUNNING=""
|
|
for proc_name in ${TARGET_SERVICES}; do
|
|
if is_service_enabled "$(process_to_service $proc_name)" ; then
|
|
if ! is_running ${proc_name}; then
|
|
NOT_RUNNING="$NOT_RUNNING $proc_name"
|
|
else
|
|
RUNNING="$RUNNING $proc_name"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
if [[ -n "$NOT_RUNNING" ]]; then
|
|
echo "The following services are not running after upgrade: $NOT_RUNNING"
|
|
$TARGET_DEVSTACK_DIR/tools/worlddump.py -d ${SCREEN_LOGDIR}
|
|
exit 1
|
|
else
|
|
echo "the following services are running: $RUNNING"
|
|
fi
|
|
|
|
echo "*********************************************************************"
|
|
echo "SUCCESS: End $0"
|
|
echo "*********************************************************************"
|