Convert gate_hook to devstack-tools

Conflicts:
	neutronclient/tests/functional/hooks/gate_hook.sh

Mitaka changes: added vpnaas hook and use load_rc_hook to load it
instead of setting DEVSTACK_LOCAL_CONFIG.

Change-Id: I2387bc9778a77b1673751bc4c1ff50f8d4826a5d
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Sean Dague <sean@dague.net>
Original-Commit: Ibd0f67f9131e7f67f3a4a62cb6ad28bf80e11bbf
(cherry picked from commit e516b8230c)
This commit is contained in:
Armando Migliaccio 2017-03-07 16:26:36 -08:00 committed by Ihar Hrachyshka
parent 40b55be84e
commit 131b2c3d26
2 changed files with 19 additions and 5 deletions

View File

@ -8,15 +8,27 @@ GATE_DEST=$BASE/new
NEUTRONCLIENT_PATH=$GATE_DEST/python-neutronclient
GATE_HOOKS=$NEUTRONCLIENT_PATH/neutronclient/tests/functional/hooks
DEVSTACK_PATH=$GATE_DEST/devstack
LOCAL_CONF=$DEVSTACK_PATH/late-local.conf
DSCONF=/tmp/devstack-tools/bin/dsconf
# Install devstack-tools used to produce local.conf; we can't rely on
# test-requirements.txt because the gate hook is triggered before neutronclient
# is installed
sudo -H pip install virtualenv
virtualenv /tmp/devstack-tools
/tmp/devstack-tools/bin/pip install -U devstack-tools==0.4.0
# Inject config from hook into localrc
function load_rc_hook {
local hook="$1"
local tmpfile
local config
tmpfile=$(tempfile)
config=$(cat $GATE_HOOKS/$hook)
export DEVSTACK_LOCAL_CONFIG+="
# generated from hook '$hook'
${config}
"
echo "[[local|localrc]]" > $tmpfile
$DSCONF setlc_raw $tmpfile "$config"
$DSCONF merge_lc $LOCAL_CONF $tmpfile
rm -f $tmpfile
}
if [ "$VENV" == "functional" ]
@ -26,7 +38,8 @@ fi
if [ "$VENV" == "functional-adv-svcs" ]
then
export DEVSTACK_LOCAL_CONFIG="enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas"
load_rc_hook vpnaas
fi
export DEVSTACK_LOCALCONF=$(cat $LOCAL_CONF)
$BASE/new/devstack-gate/devstack-vm-gate.sh

View File

@ -0,0 +1 @@
enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas