Convert gate_hook to devstack-tools

Change-Id: I3f64b355f377250149d9e1d408484676be27d6c2
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:44:55 -08:00 committed by Ihar Hrachyshka
parent 9cbc94d7da
commit e41336d779
1 changed files with 19 additions and 5 deletions

View File

@ -7,18 +7,32 @@ FWAAS_VERSION=$1
GATE_DEST=$BASE/new
GATE_HOOKS=$GATE_DEST/neutron-fwaas/neutron_fwaas/tests/contrib/hooks
DEVSTACK_PATH=$GATE_DEST/devstack
LOCAL_CONF=$DEVSTACK_PATH/local.conf
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 neutron-fwaas
# 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
}
LOCAL_CONF=$DEVSTACK_PATH/local.conf
load_rc_hook api_extensions-base
load_rc_hook api_extensions-${FWAAS_VERSION}
export DEVSTACK_LOCALCONF=$(cat $LOCAL_CONF)
$BASE/new/devstack-gate/devstack-vm-gate.sh