neutron-lbaas/tools/configure_for_lbaas_func_testing.sh
Elena Ezhova 2317364c31 Set up hooks for the functional job and add test_migrations test
Add gate hooks for the dsvm-functional job including set-up of
configure_for_lbaas_func_testing.sh script and corresponding changes to
tox.ini.

PyMySQL dependency was moved from test_requirements.txt to
functional/requirements.txt.

test_migrations.py was moved from unit tests to functional in
order to prevent it from being skipped in case of db backend
unavailability.

Fixed failing TestModelsMigrations test by importing modules with
missing models in db/models/head.py

Closes-Bug: #1585116
Closes-Bug: #1596984
Change-Id: Ic39805ea0ed330ef7da82043f77077e8a5617ca0
2016-07-07 03:04:24 +00:00

52 lines
1.6 KiB
Bash

#!/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-lbaas}
REPO_BASE=${GATE_DEST:-$(cd $(dirname "$BASH_SOURCE")/../.. && pwd)}
source $REPO_BASE/neutron/tools/configure_for_func_testing.sh
function configure_host_for_lbaas_func_testing {
echo_summary "Configuring for LBaaS functional testing"
if [ "$IS_GATE" == "True" ]; then
configure_host_for_func_testing
fi
source $REPO_BASE/neutron-lbaas/devstack/settings
source $NEUTRON_LBAAS_DIR/devstack/plugin.sh
local temp_ini=$(mktemp)
# Note(pc_m): Need to ensure this is installed so we have
# oslo-config-generator present (as this script runs before tox.ini).
sudo pip install --force oslo.config
neutron_lbaas_generate_config_files
neutron_agent_lbaas_install_agent_packages
neutron_lbaas_configure_agent $temp_ini
sudo install -d -o $STACK_USER $LBAAS_AGENT_CONF_PATH
sudo install -m 644 -o $STACK_USER $temp_ini $LBAAS_AGENT_CONF_FILENAME
}
if [ "$IS_GATE" != "True" ]; then
configure_host_for_lbaas_func_testing
fi