neutron-vpnaas/tools/configure_for_vpn_func_testing.sh
Elod Illes 2b293a1bfa Pin isort to 4.3.21
This patch fixes multiple issues to unblock gate:

1. With new isort releases (5.X.X) pylint started to fail, with error:

     AttributeError: module 'isort' has no attribute 'SortImports'

   This patch pin isort to 4.3.21, the last version before 5.0.0.

2. lower-constraints of appdirs and pytz need to be updated as
   currently lower-constraints job fails.

   Since patch Ia012a8e116a276a6674f86366c803e0e2d8ff704 modified the
   NEUTRON_PATH variable the functional test fails with:

   [..]neutron/tools/configure_for_func_testing.sh: line 113: /home/zuul/src/opendev.org/openstack/neutron-vpnaas/devstack/lib/ovs: No such file or directory

3. Functional job fails, because during tox run the latest released
   neutron is installed and it requires mock to be installed. This
   patch adds mock to functional test requirements. Note: this needs
   to be deleted as soon as new neutron will be released as on
   development branch neutron does not depend on mock anymore.

Change-Id: Ibc4cd7f8a055457b288ef101893c252cf0464a28
2020-08-12 10:21:24 +02:00

60 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}
USE_CONSTRAINT_ENV=${USE_CONSTRAINT_ENV:-False}
PROJECT_NAME=${PROJECT_NAME:-neutron-vpnaas}
REPO_BASE=${GATE_DEST:-$(cd $(dirname "$BASH_SOURCE")/../.. && pwd)}
NEUTRON_DIR=$REPO_BASE/neutron
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 {
case $VENV in
dsvm-functional-sswan*)
IPSEC_PACKAGE=strongswan
;;
*)
IPSEC_PACKAGE=openswan
;;
esac
echo_summary "Installing $IPSEC_PACKAGE for $VENV"
neutron_agent_vpnaas_install_agent_packages
}
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
# Note(pc_m): Need to ensure this is installed so we have
# oslo-config-generator present (as this script runs before tox.ini).
sudo pip3 install --force oslo.config
_install_vpn_package
}
if [ "$IS_GATE" != "True" ]; then
configure_host_for_vpn_func_testing
fi