25becbcbf4
This adds options to skip scenario and functional tests. You can either skip the complete set of tests or list of specific tests. Following new config options are added: `skip_scenario_tests` - Skip all scenario tests `skip_functional_tests` - Skip all functional tests `skip_functional_test_list` - List of functional tests to skip `skip_scenario_test_list` - List of scenario tests to skip `skip_test_stack_action_list` - List of actions in tests to skip Change-Id: I7a5233f5db1f065ccee5a97408c72203c108a656 Depends-On: I25c5e853f0499b88f2803b077d19e132140908f1
93 lines
2.9 KiB
Python
93 lines
2.9 KiB
Python
# 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.
|
|
|
|
|
|
from heat_integrationtests.functional import functional_base
|
|
|
|
|
|
class StackValidationTest(functional_base.FunctionalTestsBase):
|
|
|
|
def setUp(self):
|
|
super(StackValidationTest, self).setUp()
|
|
if not self.conf.minimal_image_ref:
|
|
raise self.skipException("No image configured to test")
|
|
|
|
if not self.conf.minimal_instance_type:
|
|
raise self.skipException(
|
|
"No minimal_instance_type configured to test")
|
|
|
|
self.assign_keypair()
|
|
|
|
def test_stack_validate_provider_references_parent_resource(self):
|
|
template = '''
|
|
heat_template_version: 2014-10-16
|
|
parameters:
|
|
keyname:
|
|
type: string
|
|
flavor:
|
|
type: string
|
|
image:
|
|
type: string
|
|
network:
|
|
type: string
|
|
resources:
|
|
config:
|
|
type: My::Config
|
|
properties:
|
|
server: {get_resource: server}
|
|
|
|
server:
|
|
type: OS::Nova::Server
|
|
properties:
|
|
image: {get_param: image}
|
|
flavor: {get_param: flavor}
|
|
key_name: {get_param: keyname}
|
|
networks: [{network: {get_param: network} }]
|
|
user_data_format: SOFTWARE_CONFIG
|
|
|
|
'''
|
|
config_template = '''
|
|
heat_template_version: 2014-10-16
|
|
parameters:
|
|
server:
|
|
type: string
|
|
resources:
|
|
config:
|
|
type: OS::Heat::SoftwareConfig
|
|
|
|
deployment:
|
|
type: OS::Heat::SoftwareDeployment
|
|
properties:
|
|
config:
|
|
get_resource: config
|
|
server:
|
|
get_param: server
|
|
'''
|
|
files = {'provider.yaml': config_template}
|
|
env = {'resource_registry':
|
|
{'My::Config': 'provider.yaml'}}
|
|
parameters = {'keyname': self.keypair_name,
|
|
'flavor': self.conf.minimal_instance_type,
|
|
'image': self.conf.minimal_image_ref,
|
|
'network': self.conf.fixed_network_name}
|
|
# Note we don't wait for CREATE_COMPLETE, because we're using a
|
|
# minimal image without the tools to apply the config.
|
|
# The point of the test is just to prove that validation won't
|
|
# falsely prevent stack creation starting, ref bug #1407100
|
|
# Note that we can be sure My::Config will stay IN_PROGRESS as
|
|
# there's no signal sent to the deployment
|
|
self.stack_create(template=template,
|
|
files=files,
|
|
environment=env,
|
|
parameters=parameters,
|
|
expected_status='CREATE_IN_PROGRESS')
|