Merge "Run heat_integrationtests as a tempest plugin"

This commit is contained in:
Jenkins 2016-08-24 14:12:43 +00:00 committed by Gerrit Code Review
commit 90dcdbaefe
10 changed files with 19 additions and 201 deletions

View File

@ -35,6 +35,7 @@ function _heat_set_user {
function create {
# run heat_integrationtests instead of tempest smoke before create
# TODO(sbaker) run with tempest after the next major release
pushd $BASE_DEVSTACK_DIR/../heat
conf_file=heat_integrationtests/heat_integrationtests.conf
iniset $conf_file heat_plugin username $OS_USERNAME

View File

@ -2,8 +2,8 @@
Heat integration tests
======================
These tests can be run against any heat-enabled OpenStack cloud, however
defaults match running against a recent DevStack.
These tests can be run as a tempest plugin against any heat-enabled OpenStack
cloud, however defaults match running against a recent DevStack.
To run the tests against DevStack, do the following:
@ -11,25 +11,16 @@ To run the tests against DevStack, do the following:
export DEST=/opt/stack
# create test resources and write config
# create test resources and write tempest config
$DEST/heat/heat_integrationtests/prepare_test_env.sh
$DEST/heat/heat_integrationtests/prepare_test_network.sh
# run the heat integration tests
# run tempest selecting only these tests
cd /opt/stack/heat
cd $DEST/tempest
tempest run --regex heat_integrationtests
tox -eintegration
If custom configuration is required, edit the [heat_plugin] section of
If custom configuration is required, copy the following file:
heat_integrationtests/heat_integrationtests.conf.sample
to:
heat_integrationtests/heat_integrationtests.conf
and make any required configuration changes before running:
tox -eintegration
$DEST/tempest/etc/tempest.conf

View File

@ -10,13 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
import os
from oslo_config import cfg
import heat_integrationtests
_CONF = None
CONF = None
service_available_group = cfg.OptGroup(name="service_available",
title="Available OpenStack Services")
@ -155,28 +151,6 @@ HeatGroup = [
]
def init_conf(read_conf=True):
global _CONF
if _CONF:
return _CONF
default_config_files = None
if read_conf:
confpath = os.path.join(
os.path.dirname(os.path.realpath(heat_integrationtests.__file__)),
'heat_integrationtests.conf')
if os.path.isfile(confpath):
default_config_files = [confpath]
_CONF = cfg.ConfigOpts()
_CONF(args=[], project='heat_integrationtests',
default_config_files=default_config_files)
for group, opts in list_opts():
_CONF.register_opts(opts, group=group)
return _CONF
def list_opts():
yield heat_group.name, HeatGroup
yield service_available_group.name, ServiceAvailableGroup

View File

@ -73,7 +73,7 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
def setUp(self):
super(HeatIntegrationTest, self).setUp()
self.conf = config.init_conf().heat_plugin
self.conf = config.CONF.heat_plugin
self.assertIsNotNone(self.conf.auth_url,
'No auth_url configured')

View File

@ -1,4 +0,0 @@
[DEFAULT]
output_file = heat_integrationtests/heat_integrationtests.conf.sample
wrap_width = 79
namespace = heat_integrationtests.common.config

View File

@ -1,136 +0,0 @@
[DEFAULT]
[heat_plugin]
#
# From heat_integrationtests.common.config
#
# Catalog type of the orchestration service. (string value)
#catalog_type = orchestration
# Username to use for non admin API requests. (string value)
#username = <None>
# Non admin API key to use when authenticating. (string value)
#password = <None>
# Username to use for admin API requests. (string value)
#admin_username = <None>
# Admin API key to use when authentication. (string value)
#admin_password = <None>
# Tenant name to use for API requests. (string value)
#tenant_name = <None>
# Admin tenant name to use for admin API requests. (string value)
#admin_tenant_name = admin
# Full URI of the OpenStack Identity API (Keystone) (string value)
#auth_url = <None>
# User domain name, if keystone v3 auth_urlis used (string value)
#user_domain_name = <None>
# Project domain name, if keystone v3 auth_urlis used (string value)
#project_domain_name = <None>
# The region name to use (string value)
#region = <None>
# Instance type for tests. Needs to be big enough for a full OS plus the test
# workload (string value)
#instance_type = <None>
# Instance type enough for simplest cases. (string value)
#minimal_instance_type = <None>
# Name of image to use for tests which boot servers. (string value)
#image_ref = <None>
# Name of existing keypair to launch servers with. (string value)
#keypair_name = <None>
# Name of minimal (e.g cirros) image to use when launching test instances.
# (string value)
#minimal_image_ref = <None>
# Set to True if using self-signed SSL certificates. (boolean value)
#disable_ssl_certificate_validation = false
# CA certificate to pass for servers that have https endpoint. (string value)
#ca_file = <None>
# Time in seconds between build status checks. (integer value)
#build_interval = 4
# Timeout in seconds to wait for a stack to build. (integer value)
#build_timeout = 1200
# Network used for SSH connections. (string value)
#network_for_ssh = heat-net
# Visible fixed network name (string value)
#fixed_network_name = heat-net
# Visible floating network name (string value)
#floating_network_name = public
# Path to environment file which defines the resource type
# Heat::InstallConfigAgent. Needs to be appropriate for the image_ref. (string
# value)
#boot_config_env = heat_integrationtests/scenario/templates/boot_config_none_env.yaml
# Visible fixed sub-network name (string value)
#fixed_subnet_name = heat-subnet
# Timeout in seconds to wait for authentication to succeed. (integer value)
#ssh_timeout = 300
# IP version used for SSH connections. (integer value)
#ip_version_for_ssh = 4
# Timeout in seconds to wait for output from ssh channel. (integer value)
#ssh_channel_timeout = 60
# The mask bits for tenant ipv4 subnets (integer value)
#tenant_network_mask_bits = 28
# Skip all scenario tests (boolean value)
#skip_scenario_tests = false
# Skip all functional tests (boolean value)
#skip_functional_tests = false
# List of functional test class or class.method names to skip ex.
# AutoscalingGroupTest,InstanceGroupBasicTest.test_size_updates_work (list
# value)
#skip_functional_test_list = <None>
# List of scenario test class or class.method names to skip ex.
# NeutronLoadBalancerTest, AodhAlarmTest.test_alarm (list value)
#skip_scenario_test_list = <None>
# List of stack actions in tests to skip ex. ABANDON, ADOPT, SUSPEND, RESUME
# (list value)
#skip_test_stack_action_list = <None>
# Default size in GB for volumes created by volumes tests (integer value)
#volume_size = 1
# Timeout in seconds to wait for connectivity to server. (integer value)
#connectivity_timeout = 120
# Timeout in seconds to wait for adding or removing childprocess after
# receiving of sighup signal (integer value)
#sighup_timeout = 30
# Count of retries to edit config file during sighup. If another worker already
# edit config file, file can be busy, so need to wait and try edit file again.
# (integer value)
#sighup_config_edit_retries = 10
# Path to the script heat-config-notify (string value)
#heat_config_notify_script = heat-config-notify

View File

@ -33,7 +33,7 @@ class HeatTempestPlugin(plugins.TempestPlugin):
heat_config.ServiceAvailableGroup)
config.register_opt_group(conf, heat_config.heat_group,
heat_config.HeatGroup)
heat_config._CONF = config.CONF
heat_config.CONF = config.CONF
def get_opt_lists(self):
return [(heat_config.heat_group.name,

View File

@ -19,4 +19,5 @@ set -ex
export DEST=${DEST:-/opt/stack/new}
sudo -E $DEST/heat/heat_integrationtests/prepare_test_env.sh
sudo -E $DEST/heat/heat_integrationtests/prepare_test_network.sh
sudo tox -eintegration
cd $DEST/tempest
sudo tempest run --regex heat_integrationtests

View File

@ -13,8 +13,7 @@
# under the License.
# This script creates required cloud resources and sets test options
# in heat_integrationtests.conf.
# Credentials are required for creating nova flavors and glance images.
# in tempest.conf.
set -e
@ -24,7 +23,9 @@ source $DEST/devstack/inc/ini-config
set -x
conf_file=$DEST/heat/heat_integrationtests/heat_integrationtests.conf
conf_file=$DEST/tempest/etc/tempest.conf
iniset_multiline $conf_file service_available heat_plugin True
source $DEST/devstack/openrc demo demo
# user creds
@ -40,6 +41,7 @@ source $DEST/devstack/openrc admin admin
iniset $conf_file heat_plugin admin_username $OS_USERNAME
iniset $conf_file heat_plugin admin_password $OS_PASSWORD
# Register the flavors for booting test servers
iniset $conf_file heat_plugin instance_type m1.heat_int
iniset $conf_file heat_plugin minimal_instance_type m1.heat_micro

11
tox.ini
View File

@ -25,16 +25,6 @@ commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '^(?!heat_integrationtests){posargs}'
[testenv:integration]
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=./heat_integrationtests
TESTR_START_DIR=heat_integrationtests
usedevelop = False
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
bash tools/pretty_tox.sh '{posargs}'
[testenv:pep8]
commands =
flake8 heat bin/heat-api bin/heat-api-cfn bin/heat-api-cloudwatch bin/heat-engine bin/heat-manage contrib heat_integrationtests doc/source
@ -78,7 +68,6 @@ commands =
[testenv:genconfig]
commands =
oslo-config-generator --config-file=config-generator.conf
oslo-config-generator --config-file=heat_integrationtests/config-generator.conf
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt