neutron/neutron/tests/contrib/gate_hook.sh
Ihar Hrachyshka 0cf4ddc6ee tests: validate sorting and pagination for networks
These are the very first API tests in the tree to cover those features.
The test is implemented in a generic way that will hopefully ease its
adoption for other resources.

Sadly, those tests cannot pass on every neutron cloud, at least until we
enable those API features by default and remove options to disable the
features.

There is no way to determine, via neutron API, whether cloud supports
those features. To work around that, we introduce two new tempest
options that determine whether tests that rely on sorting or pagination
should be executed. Those options are set in post-extra phase because
configure_tempest resets any configuration made during post-config.

Also bump resource quotas x10 times since default quotas are now not
enough, at least for network resource that is now under sorting and
pagination testing.

Related-Bug: #1566514
Change-Id: I5e68f471a641a34100aba31cb2c4a815c7220014
2016-05-24 09:17:25 +00:00

81 lines
2.0 KiB
Bash

#!/usr/bin/env bash
set -ex
VENV=${1:-"dsvm-functional"}
GATE_DEST=$BASE/new
NEUTRON_PATH=$GATE_DEST/neutron
GATE_HOOKS=$NEUTRON_PATH/neutron/tests/contrib/hooks
DEVSTACK_PATH=$GATE_DEST/devstack
LOCAL_CONF=$DEVSTACK_PATH/local.conf
# Inject config from hook into localrc
function load_rc_hook {
local hook="$1"
config=$(cat $GATE_HOOKS/$hook)
export DEVSTACK_LOCAL_CONFIG+="
# generated from hook '$hook'
${config}
"
}
# Inject config from hook into local.conf
function load_conf_hook {
local hook="$1"
cat $GATE_HOOKS/$hook >> $LOCAL_CONF
}
case $VENV in
"dsvm-functional"|"dsvm-fullstack")
# The following need to be set before sourcing
# configure_for_func_testing.
GATE_STACK_USER=stack
PROJECT_NAME=neutron
IS_GATE=True
source $DEVSTACK_PATH/functions
source $NEUTRON_PATH/devstack/lib/ovs
source $NEUTRON_PATH/tools/configure_for_func_testing.sh
configure_host_for_func_testing
if [[ "$VENV" =~ "dsvm-functional" ]]; then
# The OVS_BRANCH variable is used by git checkout. In the case below
# we use a commit on branch-2.5 that fixes compilation with the
# latest ubuntu trusty kernel.
OVS_BRANCH=8c0b419a0b9ac0141d6973dcc80306dfc6a83d31
remove_ovs_packages
compile_ovs True /usr /var
start_new_ovs
fi
# Make the workspace owned by the stack user
sudo chown -R $STACK_USER:$STACK_USER $BASE
;;
"api"|"api-pecan"|"full-pecan"|"dsvm-scenario")
load_rc_hook api_extensions
# NOTE(ihrachys): note the order of hook post-* sections is significant: [quotas] hook should
# go before other hooks modifying [DEFAULT]. See LP#1583214 for details.
load_conf_hook quotas
load_conf_hook sorting
load_conf_hook pagination
load_rc_hook qos
load_conf_hook osprofiler
if [[ "$VENV" =~ "pecan" ]]; then
load_conf_hook pecan
fi
$BASE/new/devstack-gate/devstack-vm-gate.sh
;;
*)
echo "Unrecognized environment $VENV".
exit 1
esac