summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xneutronclient/tests/functional/hooks/gate_hook.sh23
-rw-r--r--neutronclient/tests/functional/hooks/vpnaas1
2 files changed, 19 insertions, 5 deletions
diff --git a/neutronclient/tests/functional/hooks/gate_hook.sh b/neutronclient/tests/functional/hooks/gate_hook.sh
index 9ad05aa..eff9742 100755
--- a/neutronclient/tests/functional/hooks/gate_hook.sh
+++ b/neutronclient/tests/functional/hooks/gate_hook.sh
@@ -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
diff --git a/neutronclient/tests/functional/hooks/vpnaas b/neutronclient/tests/functional/hooks/vpnaas
new file mode 100644
index 0000000..11cecb9
--- /dev/null
+++ b/neutronclient/tests/functional/hooks/vpnaas
@@ -0,0 +1 @@
+enable_plugin neutron-vpnaas git://git.openstack.org/openstack/neutron-vpnaas