Spdk/test/openstack/install_devstack.sh
Michal Berger 68b6d0ef54 test/openstack: Enable securitygroup driver in neutron
This seems to be needed for devstack pieced together out of the
current master branch (wallaby seems to work fine as is).

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: I5abf22a606c84c120e42819a5450ba82d1bc52b5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8490
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-07-09 19:19:48 +00:00

77 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source "$rootdir/test/common/autotest_common.sh"
function usage() {
[[ -n $2 ]] && (
echo "$2"
echo ""
)
echo "Devstack installation script"
echo "Usage: $(basename $1) [OPTIONS]"
echo "--branch=BRANCH Define which version of openstack"
echo " should be installed. Default is master."
echo "-h, --help Print help and exit"
exit 0
}
branch="master"
while getopts 'h-:' optchar; do
case "$optchar" in
-)
case "$OPTARG" in
help) usage $0 ;;
branch=*) branch="${OPTARG#*=}" ;;
esac
;;
h) usage $0 ;;
*) usage $0 "Invalid argument '$OPTARG'" ;;
esac
done
if [[ -e /opt/stack/devstack/unstack.sh ]]; then
cd /opt/stack/devstack
su -c "./unstack.sh" -s /bin/bash stack
fi
mkdir -p /opt/stack
rm -rf /opt/stack/*
r=0
until ((++r >= 20)); do
if [[ $branch == "master" ]]; then
git clone --depth 1 https://opendev.org/openstack-dev/devstack /opt/stack/devstack && break
else
git clone --depth 1 https://opendev.org/openstack-dev/devstack -b "stable/$branch" /opt/stack/devstack && break
fi
done
# Check if we reached max retries count
((r < 20))
git clone https://github.com/openstack/os-brick.git /opt/stack/os-brick
cd /opt/stack/os-brick
python3 ./setup.py install
cp $rootdir/scripts/vagrant/local.conf /opt/stack/devstack/local.conf
cd /opt/stack/devstack
./tools/create-stack-user.sh
chown -R stack:stack /opt/stack
su -c "./stack.sh" -s /bin/bash stack
source openrc admin admin
openstack volume type create SPDK --public
if [[ $branch == master ]]; then
# FIXME: For some reason tempest won't work unless neutron has securitygroup enabled
# (even when testing with security_group disabled in tempest.conf). For the time
# being, until someone understands why this seem to be the case, patch the ml2 plugin
# config - instead of touching our local.conf which is still valid for the wallaby -
# to enable the securitygroup right before the tests start.
[[ -e /etc/neutron/plugins/ml2/ml2_conf.ini ]]
sed -i -e "s/enable_security_group = False/enable_security_group = True/g" /etc/neutron/plugins/ml2/ml2_conf.ini
fi