diff options
author | 2017-10-23 16:44:31 +0000 | |
---|---|---|
committer | 2017-10-23 16:44:31 +0000 | |
commit | 2f3d18fd64ce0aea7d229493130404e2bf86dab2 (patch) | |
tree | bcf741929ea14e63308a866a73bf570c6c95bc12 | |
parent | b878acf1ec1132335120277bf03976758e06d86c (diff) | |
parent | 9fa64ef86316036a40f742b92bbe6a3ca1d490fb (diff) |
Merge "Added ext_net_name into template substitution variable."
-rw-r--r-- | snaps/openstack/tests/create_stack_tests.py | 5 | ||||
-rw-r--r-- | snaps/openstack/tests/heat/floating_ip_heat_template.yaml | 19 | ||||
-rw-r--r-- | snaps/openstack/utils/tests/heat_utils_tests.py | 2 |
3 files changed, 24 insertions, 2 deletions
diff --git a/snaps/openstack/tests/create_stack_tests.py b/snaps/openstack/tests/create_stack_tests.py index f4eb1eb..d96462a 100644 --- a/snaps/openstack/tests/create_stack_tests.py +++ b/snaps/openstack/tests/create_stack_tests.py @@ -424,6 +424,7 @@ class CreateComplexStackTests(OSIntegrationTestCase): self.subnet_name = self.guid + '-subnet' self.flavor1_name = self.guid + '-flavor1' self.flavor2_name = self.guid + '-flavor2' + self.sec_grp_name = self.guid + '-sec_grp' self.vm_inst1_name = self.guid + '-inst1' self.vm_inst2_name = self.guid + '-inst2' self.keypair_name = self.guid + '-kp' @@ -437,7 +438,9 @@ class CreateComplexStackTests(OSIntegrationTestCase): 'subnet_name': self.subnet_name, 'inst1_name': self.vm_inst1_name, 'inst2_name': self.vm_inst2_name, - 'keypair_name': self.keypair_name} + 'keypair_name': self.keypair_name, + 'external_net_name': self.ext_net_name, + 'security_group_name': self.sec_grp_name} self.heat_tmplt_path = pkg_resources.resource_filename( 'snaps.openstack.tests.heat', 'floating_ip_heat_template.yaml') diff --git a/snaps/openstack/tests/heat/floating_ip_heat_template.yaml b/snaps/openstack/tests/heat/floating_ip_heat_template.yaml index e09515e..a191acc 100644 --- a/snaps/openstack/tests/heat/floating_ip_heat_template.yaml +++ b/snaps/openstack/tests/heat/floating_ip_heat_template.yaml @@ -61,6 +61,11 @@ parameters: label: Keypair name description: The name of the stack's keypair default: keypair_name + security_group_name: + type: string + label: Security Group name + description: The name of the stack's security group + default: security_group_name inst1_name: type: string label: First VM name @@ -116,6 +121,19 @@ resources: router: { get_resource: management_router } subnet: { get_resource: subnet } + server_security_group: + type: OS::Neutron::SecurityGroup + properties: + description: Add security group rules for server + name: { get_param: security_group_name } + rules: + - remote_ip_prefix: 0.0.0.0/0 + protocol: tcp + port_range_min: 22 + port_range_max: 22 + - remote_ip_prefix: 0.0.0.0/0 + protocol: icmp + floating_ip: type: OS::Neutron::FloatingIP properties: @@ -141,6 +159,7 @@ resources: image: { get_param: image1_name } flavor: { get_resource: flavor1 } key_name: {get_resource: keypair} + security_groups: [{ get_resource: server_security_group }] networks: - network: { get_resource: network } diff --git a/snaps/openstack/utils/tests/heat_utils_tests.py b/snaps/openstack/utils/tests/heat_utils_tests.py index 44235ff..6f75f89 100644 --- a/snaps/openstack/utils/tests/heat_utils_tests.py +++ b/snaps/openstack/utils/tests/heat_utils_tests.py @@ -399,7 +399,7 @@ class HeatUtilsCreateComplexStackTests(OSComponentTestCase): """ resources = heat_utils.get_resources(self.heat_client, self.stack) self.assertIsNotNone(resources) - self.assertEqual(11, len(resources)) + self.assertEqual(12, len(resources)) options = heat_utils.get_outputs(self.heat_client, self.stack) self.assertIsNotNone(options) |