Merge "add gating up/down script for devstack"

This commit is contained in:
Jenkins 2015-02-11 20:53:44 +00:00 committed by Gerrit Code Review
commit d26da45b98
7 changed files with 44 additions and 12 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
# **clean.sh** # **clean.sh**
@ -83,7 +83,10 @@ if [[ -d $TOP_DIR/extras.d ]]; then
fi fi
# Clean projects # Clean projects
cleanup_cinder
# BUG: cinder tgt doesn't exit cleanly if it's not running.
cleanup_cinder || /bin/true
cleanup_glance cleanup_glance
cleanup_keystone cleanup_keystone
cleanup_nova cleanup_nova

24
gate/updown.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash -xe
#
# An up / down test for gate functional testing
#
# Note: this is expected to start running as jenkins
# Step 1: give back sudoers permissions to devstack
TEMPFILE=`mktemp`
echo "stack ALL=(root) NOPASSWD:ALL" >$TEMPFILE
chmod 0440 $TEMPFILE
sudo chown root:root $TEMPFILE
sudo mv $TEMPFILE /etc/sudoers.d/51_stack_sh
# TODO: do something to start a guest to create crud that should
# disappear
# Step 2: unstack
echo "Running unstack.sh"
sudo -H -u stack stdbuf -oL -eL bash -ex ./unstack.sh
# Step 3: clean
echo "Running clean.sh"
sudo -H -u stack stdbuf -oL -eL bash -ex ./clean.sh

View File

@ -28,17 +28,14 @@ function cleanup_database_mysql {
stop_service $MYSQL stop_service $MYSQL
if is_ubuntu; then if is_ubuntu; then
# Get ruthless with mysql # Get ruthless with mysql
stop_service $MYSQL
apt_get purge -y mysql* mariadb* apt_get purge -y mysql* mariadb*
sudo rm -rf /var/lib/mysql sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql sudo rm -rf /etc/mysql
return return
elif is_fedora; then elif is_fedora; then
stop_service mariadb
uninstall_package mariadb-server uninstall_package mariadb-server
sudo rm -rf /var/lib/mysql sudo rm -rf /var/lib/mysql
elif is_suse; then elif is_suse; then
stop_service mysql
uninstall_package mysql-community-server uninstall_package mysql-community-server
sudo rm -rf /var/lib/mysql sudo rm -rf /var/lib/mysql
else else

View File

@ -40,7 +40,10 @@ function start_dstat {
# stop_dstat() stop dstat process # stop_dstat() stop dstat process
function stop_dstat { function stop_dstat {
screen_stop dstat # dstat runs as a console, not as a service, and isn't trackable
# via the normal mechanisms for devstack. So lets just do a
# killall and move on.
killall dstat || /bin/true
} }
# Restore xtrace # Restore xtrace

View File

@ -74,7 +74,8 @@ function cleanup_rpc_backend {
if is_service_enabled rabbit; then if is_service_enabled rabbit; then
# Obliterate rabbitmq-server # Obliterate rabbitmq-server
uninstall_package rabbitmq-server uninstall_package rabbitmq-server
sudo killall epmd || sudo killall -9 epmd # in case it's not actually running, /bin/true at the end
sudo killall epmd || sudo killall -9 epmd || /bin/true
if is_ubuntu; then if is_ubuntu; then
# And the Erlang runtime too # And the Erlang runtime too
apt_get purge -y erlang* apt_get purge -y erlang*

View File

@ -203,7 +203,7 @@ function start_sahara {
# stop_sahara() - Stop running processes # stop_sahara() - Stop running processes
function stop_sahara { function stop_sahara {
# Kill the Sahara screen windows # Kill the Sahara screen windows
screen -S $SCREEN_NAME -p sahara -X kill stop_process sahara
} }

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
# **unstack.sh** # **unstack.sh**
@ -138,10 +138,13 @@ fi
SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/* SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/*
# BUG: tgt likes to exit 1 on service stop if everything isn't
# perfect, we should clean up cinder stop paths.
# Get the iSCSI volumes # Get the iSCSI volumes
if is_service_enabled cinder; then if is_service_enabled cinder; then
stop_cinder stop_cinder || /bin/true
cleanup_cinder cleanup_cinder || /bin/true
fi fi
if [[ -n "$UNSTACK_ALL" ]]; then if [[ -n "$UNSTACK_ALL" ]]; then
@ -181,4 +184,5 @@ if [[ -n "$SCREEN" ]]; then
fi fi
fi fi
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME # BUG: maybe it doesn't exist? We should isolate this further down.
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true