deb-manila/devstack/upgrade/upgrade.sh
vponomaryov 7999280fb9 Add Grenade support to Manila
Grenade is an OpenStack test harness to exercise the upgrade
process between releases. It uses DevStack to perform an initial
OpenStack install and as a reference for the final configuration.

Add support of it to Manila project, doing following changes:
- Add all required scripts for 'grenade' job, such as following:
-- settings
-- shutdown.sh
-- upgrade.sh
- Add optional 'resources.sh' script that performs functional
  tests using bash and manilaclient. List of scenarios:
-- 1. create and delete share setting metadata and access rule
-- 2. attach security service to share network
-- 3. update quotas
-- 4. create private share type and add access for project

Note following:
- Tempest is not used by design.
- Manilaclient is used of stable version - version of 'base' devstack,
  which is 'stable/mitaka'. It also means that used API microversion
  is latest for that branch.

Change-Id: I7d7e0c50933776ca1a710bcf069abb0282b821ac
Depends-On: I4232382d3c944666bbf0916a3f285b84f6ff9d64
Implements blueprint grenade
2016-04-22 12:46:37 +03:00

74 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# ``upgrade-manila``
echo "*********************************************************************"
echo "Begin $0"
echo "*********************************************************************"
# Clean up any resources that may be in use
cleanup() {
set +o errexit
echo "*********************************************************************"
echo "ERROR: Abort $0"
echo "*********************************************************************"
# Kill ourselves to signal any calling process
trap 2; kill -2 $$
}
trap cleanup SIGHUP SIGINT SIGTERM
# Keep track of the grenade directory
RUN_DIR=$(cd $(dirname "$0") && pwd)
# Source params
source $GRENADE_DIR/grenaderc
# Import common functions
source $GRENADE_DIR/functions
# This script exits on an error so that errors don't compound and you see
# only the first error that occurred.
set -o errexit
# Upgrade Manila
# ==============
# Locate manila devstack plugin, the directory above the
# grenade plugin.
MANILA_DEVSTACK_DIR=$(dirname $(dirname $0))
# Get functions from current DevStack
source $TARGET_DEVSTACK_DIR/functions
source $TARGET_DEVSTACK_DIR/lib/tls
source $TARGET_DEVSTACK_DIR/stackrc
source $(dirname $(dirname $BASH_SOURCE))/settings
source $(dirname $(dirname $BASH_SOURCE))/plugin.sh
# Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following allowing as the install occurs.
set -o xtrace
# Save current config files for posterity
[[ -d $SAVE_DIR/etc.manila ]] || cp -pr $MANILA_CONF_DIR $SAVE_DIR/etc.manila
# Install the target manila
install_manila
# calls upgrade-manila for specific release
upgrade_project manila $RUN_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
# Migrate the database
$MANILA_BIN_DIR/manila-manage db sync || die $LINENO "DB migration error"
start_manila
# Don't succeed unless the services come up
ensure_services_started manila-api manila-share manila-scheduler manila-data
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End $0"
echo "*********************************************************************"