Func test conf to specify boot config

This adds a functional test config option boot_config_env which
can specify a path to an environment file which defines boot config
resources for any test which needs the heat agent projects.

By default this value points to boot_config_none_env.yaml, which assumes
the image is already completely configured with the heat agent projects.

The aim is that in the gate jobs the following will be set:
boot_config_env=/opt/stack/new/heat-templates/hot/software-config/boot-config/test_image_env.yaml

And the image_ref will refer to the latest built image in
http://tarballs.openstack.org/heat-test-image/

Change-Id: I1fa09bf3a8be248829061b931dd773973732fa52
This commit is contained in:
Steve Baker 2015-03-11 13:46:42 +13:00
parent a6f5d44633
commit 4737d8aafb
4 changed files with 20 additions and 8 deletions

View File

@ -68,6 +68,12 @@ IntegrationTestGroup = [
cfg.StrOpt('fixed_network_name', cfg.StrOpt('fixed_network_name',
default='private', default='private',
help="Visible fixed network name "), help="Visible fixed network name "),
cfg.StrOpt('boot_config_env',
default='heat_integrationtests/scenario/templates'
'/boot_config_none_env.yaml',
help="Path to environment file which defines the "
"resource type Heat::InstallConfigAgent. Needs to "
"be appropriate for the image_ref."),
cfg.StrOpt('fixed_subnet_name', cfg.StrOpt('fixed_subnet_name',
default='private-subnet', default='private-subnet',
help="Visible fixed sub-network name "), help="Visible fixed sub-network name "),

View File

@ -0,0 +1,5 @@
# Defines a Heat::InstallConfigAgent config resource which performs no config.
# This environment can be used when the image already has the required agents
# installed and configured.
resource_registry:
"Heat::InstallConfigAgent": "OS::Heat::SoftwareConfig"

View File

@ -136,11 +136,7 @@ resources:
signal_transport: {get_param: signal_transport} signal_transport: {get_param: signal_transport}
cfg_user_data: cfg_user_data:
type: OS::Heat::SoftwareConfig type: Heat::InstallConfigAgent
properties:
config: |
#!/bin/sh
echo "user data script"
server: server:
type: OS::Nova::Server type: OS::Nova::Server
@ -154,7 +150,7 @@ resources:
- network: {get_param: network} - network: {get_param: network}
user_data_format: SOFTWARE_CONFIG user_data_format: SOFTWARE_CONFIG
software_config_transport: {get_param: software_config_transport} software_config_transport: {get_param: software_config_transport}
user_data: {get_resource: cfg_user_data} user_data: {get_attr: [cfg_user_data, config]}
outputs: outputs:
res1: res1:

View File

@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from heatclient.common import template_utils
import six import six
from heat_integrationtests.common import exceptions from heat_integrationtests.common import exceptions
@ -157,13 +158,17 @@ class SoftwareConfigIntegrationTest(scenario_base.ScenarioTestsBase):
'cfg3.pp': CFG3_PP 'cfg3.pp': CFG3_PP
} }
env_files, env = template_utils.process_environment_and_files(
self.conf.boot_config_env)
# Launch stack # Launch stack
self.stack_identifier = self.launch_stack( self.stack_identifier = self.launch_stack(
stack_name=self.stack_name, stack_name=self.stack_name,
template_name='test_server_software_config.yaml', template_name='test_server_software_config.yaml',
parameters=parameters, parameters=parameters,
files=files, files=dict(list(files.items()) + list(env_files.items())),
expected_status=None expected_status=None,
environment=env
) )
# Check stack # Check stack