neutron-vpnaas/tools/configure_for_vpn_func_testing.sh
Paul Michali 9c21bb5ad2 VPNaaS: Correcting method name for functional test
With the new DevStack plugin for neutron-vpnaas, the method names for
various stacking actions were renamed. One is used by the functional
test setup script tools/configure_for_vpn_func_testing.sh.

The change wasn't noticed, because the neutron-vpnaas repo still was
using DevStack's existing VPN setup, where the old method name is still
in use. But, when removing the VPN setup in DevStack, then the function
tests will fail.

This commit renames the method to match the name of the DevStack
plugin method, instead of the older DevStack repo method. It'll be
needed, before upstreaming Iffa9901e24adbacb581425c4b38c7e8cff0da9e8.

In addition, it makes sure that VPN environment variables are available
for use by the configuration script, and reuses more plugin.sh code,
to remove duplication.

Change-Id: Ib22a4b9abdc82c2b14d933b02329c6483c075ea8
2015-07-30 14:41:03 +00:00

64 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -e
IS_GATE=${IS_GATE:-False}
PROJECT_NAME=${PROJECT_NAME:-neutron-vpnaas}
REPO_BASE=${GATE_DEST:-$(cd $(dirname "$BASH_SOURCE")/../.. && pwd)}
source $REPO_BASE/neutron/tools/configure_for_func_testing.sh
source $REPO_BASE/neutron-vpnaas/devstack/settings
source $NEUTRON_VPNAAS_DIR/devstack/plugin.sh
function _install_vpn_package {
if [ "$VENV" == "dsvm-functional-sswan" ]
then
IPSEC_PACKAGE=strongswan
else
IPSEC_PACKAGE=openswan
fi
echo_summary "Installing $IPSEC_PACKAGE"
neutron_agent_vpnaas_install_agent_packages
}
function _configure_vpn_ini_file {
echo_summary "Configuring VPN ini file"
local temp_ini=$(mktemp)
neutron_vpnaas_configure_agent $temp_ini
sudo install -d -o $STACK_USER /etc/neutron/
sudo install -m 644 -o $STACK_USER $temp_ini $Q_VPN_CONF_FILE
}
function configure_host_for_vpn_func_testing {
echo_summary "Configuring for VPN functional testing"
if [ "$IS_GATE" == "True" ]; then
configure_host_for_func_testing
fi
_install_vpn_package
_configure_vpn_ini_file
}
if [ "$IS_GATE" != "True" ]; then
configure_host_for_vpn_func_testing
fi