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
diff --git a/scenario/templates/boot_config_none_env.yaml b/scenario/templates/boot_config_none_env.yaml
new file mode 100644
index 0000000..91d130c
--- /dev/null
+++ b/scenario/templates/boot_config_none_env.yaml
@@ -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"
\ No newline at end of file
diff --git a/scenario/templates/test_server_software_config.yaml b/scenario/templates/test_server_software_config.yaml
index c173e2c..bf8fa9b 100644
--- a/scenario/templates/test_server_software_config.yaml
+++ b/scenario/templates/test_server_software_config.yaml
@@ -136,11 +136,7 @@
signal_transport: {get_param: signal_transport}
cfg_user_data:
- type: OS::Heat::SoftwareConfig
- properties:
- config: |
- #!/bin/sh
- echo "user data script"
+ type: Heat::InstallConfigAgent
server:
type: OS::Nova::Server
@@ -154,7 +150,7 @@
- network: {get_param: network}
user_data_format: SOFTWARE_CONFIG
software_config_transport: {get_param: software_config_transport}
- user_data: {get_resource: cfg_user_data}
+ user_data: {get_attr: [cfg_user_data, config]}
outputs:
res1:
diff --git a/scenario/test_server_software_config.py b/scenario/test_server_software_config.py
index 86672c5..2df815b 100644
--- a/scenario/test_server_software_config.py
+++ b/scenario/test_server_software_config.py
@@ -10,6 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+from heatclient.common import template_utils
import six
from heat_integrationtests.common import exceptions
@@ -157,13 +158,17 @@
'cfg3.pp': CFG3_PP
}
+ env_files, env = template_utils.process_environment_and_files(
+ self.conf.boot_config_env)
+
# Launch stack
self.stack_identifier = self.launch_stack(
stack_name=self.stack_name,
template_name='test_server_software_config.yaml',
parameters=parameters,
- files=files,
- expected_status=None
+ files=dict(list(files.items()) + list(env_files.items())),
+ expected_status=None,
+ environment=env
)
# Check stack