summaryrefslogtreecommitdiffstats
path: root/snaps
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-06-14 11:22:33 +0800
committerspisarski <s.pisarski@cablelabs.com>2017-06-14 11:22:33 +0800
commitc11ad93486a89a29cf90bfeceb0e1da38c419799 (patch)
treed030026510b40e0d9dd4d2b29d8e3f2360d3156a /snaps
parent01508fe34b6595f8b47ea808e433bc8cb210e94e (diff)
Need to move file resources required by tests.
Functest was not installing the heat resource files required by the snaps tests being run by Functest as the heat template file used by the tests as it was under the repository's root directory which is causing tests to fail. Change-Id: I214d2e61e92f7dfa2e9859dded1e7ea08706314d Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps')
-rw-r--r--snaps/openstack/tests/create_stack_tests.py6
-rw-r--r--snaps/openstack/tests/heat/__init__.py0
-rw-r--r--snaps/openstack/tests/heat/test_heat_template.yaml42
-rw-r--r--snaps/openstack/utils/tests/heat_utils_tests.py3
-rw-r--r--snaps/provisioning/tests/scripts/__init__.py (renamed from snaps/provisioning/heat/__init__.py)0
5 files changed, 48 insertions, 3 deletions
diff --git a/snaps/openstack/tests/create_stack_tests.py b/snaps/openstack/tests/create_stack_tests.py
index 42d74d8..e665f82 100644
--- a/snaps/openstack/tests/create_stack_tests.py
+++ b/snaps/openstack/tests/create_stack_tests.py
@@ -146,7 +146,8 @@ class CreateStackSuccessTests(OSIntegrationTestCase):
self.env_values = {'image_name': self.image_creator.image_settings.name,
'flavor_name': self.flavor_creator.flavor_settings.name}
- self.heat_tmplt_path = pkg_resources.resource_filename('examples.heat', 'test_heat_template.yaml')
+ self.heat_tmplt_path = pkg_resources.resource_filename(
+ 'snaps.openstack.tests.heat', 'test_heat_template.yaml')
def tearDown(self):
"""
@@ -289,7 +290,8 @@ class CreateStackNegativeTests(OSIntegrationTestCase):
self.stack_name = self.__class__.__name__ + '-' + str(uuid.uuid4())
self.stack_creator = None
- self.heat_tmplt_path = pkg_resources.resource_filename('examples.heat', 'test_heat_template.yaml')
+ self.heat_tmplt_path = pkg_resources.resource_filename(
+ 'snaps.openstack.tests.heat', 'test_heat_template.yaml')
def tearDown(self):
if self.stack_creator:
diff --git a/snaps/openstack/tests/heat/__init__.py b/snaps/openstack/tests/heat/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/snaps/openstack/tests/heat/__init__.py
diff --git a/snaps/openstack/tests/heat/test_heat_template.yaml b/snaps/openstack/tests/heat/test_heat_template.yaml
new file mode 100644
index 0000000..d81a71c
--- /dev/null
+++ b/snaps/openstack/tests/heat/test_heat_template.yaml
@@ -0,0 +1,42 @@
+heat_template_version: 2015-04-30
+
+description: Simple template to deploy a single compute instance
+
+parameters:
+ image_name:
+ type: string
+ label: Image ID
+ description: Image to be used for compute instance
+ default: heat_utils_tests
+ flavor_name:
+ type: string
+ label: Instance Type
+ description: Type of instance (flavor) to be used
+ default: m1.small
+
+resources:
+ private_net:
+ type: OS::Neutron::Net
+ properties:
+ name: test_net
+
+ private_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: private_net }
+ cidr: 10.0.0.0/24
+
+ server1_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: private_net }
+ fixed_ips:
+ - subnet_id: { get_resource: private_subnet }
+
+ my_instance:
+ type: OS::Nova::Server
+ properties:
+ image: { get_param: image_name }
+ flavor: { get_param: flavor_name }
+ networks:
+ - port: { get_resource: server1_port }
diff --git a/snaps/openstack/utils/tests/heat_utils_tests.py b/snaps/openstack/utils/tests/heat_utils_tests.py
index 95f83ce..eefc1bf 100644
--- a/snaps/openstack/utils/tests/heat_utils_tests.py
+++ b/snaps/openstack/utils/tests/heat_utils_tests.py
@@ -87,7 +87,8 @@ class HeatUtilsCreateStackTests(OSComponentTestCase):
env_values = {'image_name': self.image_creator.image_settings.name,
'flavor_name': self.flavor_creator.flavor_settings.name}
- heat_tmplt_path = pkg_resources.resource_filename('examples.heat', 'test_heat_template.yaml')
+ heat_tmplt_path = pkg_resources.resource_filename(
+ 'snaps.openstack.tests.heat', 'test_heat_template.yaml')
self.stack_settings = StackSettings(name=stack_name, template_path=heat_tmplt_path, env_values=env_values)
self.stack = None
self.heat_client = heat_utils.heat_client(self.os_creds)
diff --git a/snaps/provisioning/heat/__init__.py b/snaps/provisioning/tests/scripts/__init__.py
index 271c742..271c742 100644
--- a/snaps/provisioning/heat/__init__.py
+++ b/snaps/provisioning/tests/scripts/__init__.py