Convert gate_hook to devstack-tools

Change-Id: I2387bc9778a77b1673751bc4c1ff50f8d4826a5d
Co-Authored-By: Ihar Hrachyshka <ihrachys@redhat.com>
Co-Authored-By: Sean Dague <sean@dague.net>
Original-Commit: Ibd0f67f9131e7f67f3a4a62cb6ad28bf80e11bbf
This commit is contained in:
Armando Migliaccio 2017-03-07 16:26:36 -08:00 committed by Ihar Hrachyshka
parent 465a89246f
commit e516b8230c

View File

@ -8,20 +8,34 @@ GATE_DEST=$BASE/new
NEUTRONCLIENT_PATH=$GATE_DEST/python-neutronclient NEUTRONCLIENT_PATH=$GATE_DEST/python-neutronclient
GATE_HOOKS=$NEUTRONCLIENT_PATH/neutronclient/tests/functional/hooks GATE_HOOKS=$NEUTRONCLIENT_PATH/neutronclient/tests/functional/hooks
DEVSTACK_PATH=$GATE_DEST/devstack 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 # Inject config from hook into localrc
function load_rc_hook { function load_rc_hook {
local hook="$1" local hook="$1"
local tmpfile
local config
tmpfile=$(tempfile)
config=$(cat $GATE_HOOKS/$hook) config=$(cat $GATE_HOOKS/$hook)
export DEVSTACK_LOCAL_CONFIG+=" echo "[[local|localrc]]" > $tmpfile
# generated from hook '$hook' $DSCONF setlc_raw $tmpfile "$config"
${config} $DSCONF merge_lc $LOCAL_CONF $tmpfile
" rm -f $tmpfile
} }
if [ "$VENV" == "functional-adv-svcs" ] if [ "$VENV" == "functional-adv-svcs" ]
then then
load_rc_hook fwaas load_rc_hook fwaas
fi fi
export DEVSTACK_LOCALCONF=$(cat $LOCAL_CONF)
$BASE/new/devstack-gate/devstack-vm-gate.sh $BASE/new/devstack-gate/devstack-vm-gate.sh