Expand gate hooks to allow for more than just octavia testing

If we are going to continue to tweak the namespace driver, we should
really be testing it. An experimental api job using it will be added
to project-config as well.

Change-Id: Ie0d8f1a2a4071d0ee38a1688253a04f3d7330acb
This commit is contained in:
Doug Wiegley 2016-02-21 13:40:28 -07:00
parent 0e8f6432a7
commit 53f34e39e3
3 changed files with 69 additions and 11 deletions

View File

@ -0,0 +1,35 @@
#!/bin/bash
# This file is meant to be sourced by the other hooks
# Legacy values for $1 and $2:
# $1 - lbaasv2, lbaasv1 (lbaasversion)
# $2 - scenario, minimal, api, healthmonitor, listener, loadbalancer, member, pool (lbaastest)
# Args being phased in:
# $1 - same
# $2 - test-driver, with any missing -driver being "octavia"
# scenario-octavia
# minimal-octavia
# api-namespace
# api-{thirdparty}
# healthmonitor-octavia
# listener-octavia
# loadbalancer-octavia
# member-octavia
# pool-octavia
lbaasversion="$1"
lbaastest="$2"
lbaasenv=$(echo "$lbaastest" | perl -ne '/^(.*)-([^-]+)$/ && print "$1";')
if [ -z "$lbaasenv" ]; then
lbaasenv=$lbaastest
fi
lbaasdriver=$(echo "$lbaastest" | perl -ne '/^(.*)-([^-]+)$/ && print "$2";')
if [ -z "$lbaasdriver" ]; then
lbaasdriver='octavia'
fi

View File

@ -5,14 +5,17 @@ set -ex
GATE_DEST=$BASE/new GATE_DEST=$BASE/new
DEVSTACK_PATH=$GATE_DEST/devstack DEVSTACK_PATH=$GATE_DEST/devstack
testenv=${2:-"apiv2"} # Sort out our gate args
. `dirname "$0"`/decode_args.sh
if [ "$1" = "lbaasv1" ]; then testenv=${lbaastest:-"apiv2"}
if [ "$lbaasversion" = "lbaasv1" ]; then
testenv="apiv1" testenv="apiv1"
elif [ "$1" = "lbaasv2" ]; then elif [ "$lbaasversion" = "lbaasv2" ]; then
if [ "$2" = "healthmonitor" ] || [ "$2" = "listener" ] || [ "$2" = "loadbalancer" ] || [ "$2" = "member" ] || [ "$2" = "minimal" ] || [ "$2" = "pool" ]; then if [ "$lbaasenv" = "healthmonitor" ] || [ "$lbaasenv" = "listener" ] || [ "$lbaasenv" = "loadbalancer" ] || [ "$lbaasenv" = "member" ] || [ "$lbaasenv" = "minimal" ] || [ "$lbaasenv" = "pool" ]; then
testenv="apiv2" testenv="apiv2"
elif [ "$2" = "scenario" ]; then elif [ "$lbaasenv" = "scenario" ]; then
testenv="scenario" testenv="scenario"
fi fi
fi fi
@ -20,8 +23,12 @@ fi
export DEVSTACK_LOCAL_CONFIG+=" export DEVSTACK_LOCAL_CONFIG+="
enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas enable_plugin neutron-lbaas https://git.openstack.org/openstack/neutron-lbaas
enable_plugin barbican https://git.openstack.org/openstack/barbican enable_plugin barbican https://git.openstack.org/openstack/barbican
"
if [ "$lbaasdriver" = "octavia" ]; then
export DEVSTACK_LOCAL_CONFIG+="
enable_plugin octavia https://git.openstack.org/openstack/octavia enable_plugin octavia https://git.openstack.org/openstack/octavia
" "
fi
if [ "$testenv" != "scenario" ]; then if [ "$testenv" != "scenario" ]; then
export DEVSTACK_LOCAL_CONFIG+=" export DEVSTACK_LOCAL_CONFIG+="
@ -42,11 +49,22 @@ if [ "$testenv" != "apiv1" ]; then
# Override enabled services, so we can turn on lbaasv2. # Override enabled services, so we can turn on lbaasv2.
# While we're at it, disable cinder and swift, since we don't need them. # While we're at it, disable cinder and swift, since we don't need them.
ENABLED_SERVICES+=",q-lbaasv2,-q-lbaas" ENABLED_SERVICES+=",q-lbaasv2,-q-lbaas"
ENABLED_SERVICES+=",octavia,o-cw,o-hk,o-hm,o-api" if [ "$lbaasdriver" = "octavia" ]; then
ENABLED_SERVICES+=",octavia,o-cw,o-hk,o-hm,o-api"
fi
if [ "$lbaasdriver" = "namespace" ]; then
cat > $DEVSTACK_PATH/local.conf <<EOF
[[post-config|\$NEUTRON_LBAAS_CONF]]
[service_providers]
service_provider=LOADBALANCER:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
EOF
fi
fi fi
export ENABLED_SERVICES export ENABLED_SERVICES
if [ "$testenv" = "apiv2" ]; then if [ "$lbaasdriver" = "octavia" -a "$testenv" = "apiv2" ]; then
cat > $DEVSTACK_PATH/local.conf <<EOF cat > $DEVSTACK_PATH/local.conf <<EOF
[[post-config|/etc/octavia/octavia.conf]] [[post-config|/etc/octavia/octavia.conf]]
[DEFAULT] [DEFAULT]
@ -61,7 +79,7 @@ EOF
fi fi
if [ "$testenv" = "scenario" ]; then if [ "$lbaasdriver" = "octavia" -a "$testenv" = "scenario" ]; then
cat > $DEVSTACK_PATH/local.conf <<EOF cat > $DEVSTACK_PATH/local.conf <<EOF
[[post-config|/etc/octavia/octavia.conf]] [[post-config|/etc/octavia/octavia.conf]]
[DEFAULT] [DEFAULT]

View File

@ -7,8 +7,11 @@ TEMPEST_CONFIG_DIR="$BASE/new/tempest/etc"
SCRIPTS_DIR="/usr/os-testr-env/bin" SCRIPTS_DIR="/usr/os-testr-env/bin"
OCTAVIA_DIR="$BASE/new/octavia" OCTAVIA_DIR="$BASE/new/octavia"
LBAAS_VERSION=$1 # Sort out our gate args
LBAAS_TEST=$2 . `dirname "$0"`/decode_args.sh
LBAAS_VERSION=$lbaasversion
LBAAS_TEST=$lbaasenv
if [ "$LBAAS_VERSION" = "lbaasv1" ]; then if [ "$LBAAS_VERSION" = "lbaasv1" ]; then
testenv="apiv1" testenv="apiv1"
@ -72,7 +75,9 @@ owner=tempest
# Set owner permissions according to job's requirements. # Set owner permissions according to job's requirements.
cd $NEUTRON_LBAAS_DIR cd $NEUTRON_LBAAS_DIR
sudo chown -R $owner:stack $NEUTRON_LBAAS_DIR sudo chown -R $owner:stack $NEUTRON_LBAAS_DIR
sudo chown -R $owner:stack $OCTAVIA_DIR if [ "$lbaasdriver" = "octavia" ]; then
sudo chown -R $owner:stack $OCTAVIA_DIR
fi
sudo_env=" OS_TESTR_CONCURRENCY=1" sudo_env=" OS_TESTR_CONCURRENCY=1"