summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmando Migliaccio <armamig@gmail.com>2017-03-07 16:26:36 -0800
committerIhar Hrachyshka <ihrachys@redhat.com>2017-03-06 13:10:56 +0000
commitc899a2ea3f8175091faf74f8847cb84f340ae820 (patch)
treee9d677236ca89fb05a7767ec2bd75ca396497867
parentd9e20c9892eef55281eedd5f4a8d9192e9a99c2e (diff)
downloadpython-neutronclient-stable/newton.tar.gz
Convert gate_hook to devstack-toolsnewton-eol6.0.1stable/newton
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 e516b8230c14d2bf95de86d52b4f2d5b9f83402d)
-rwxr-xr-xneutronclient/tests/functional/hooks/gate_hook.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/neutronclient/tests/functional/hooks/gate_hook.sh b/neutronclient/tests/functional/hooks/gate_hook.sh
index e34a6c8..36db569 100755
--- a/neutronclient/tests/functional/hooks/gate_hook.sh
+++ b/neutronclient/tests/functional/hooks/gate_hook.sh
@@ -8,20 +8,34 @@ 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-adv-svcs" ]
then
load_rc_hook fwaas
fi
+export DEVSTACK_LOCALCONF=$(cat $LOCAL_CONF)
$BASE/new/devstack-gate/devstack-vm-gate.sh