diff --git a/tobiko/openstack/stacks/__init__.py b/tobiko/openstack/stacks/__init__.py index 6cfa2bb36..1b679181f 100644 --- a/tobiko/openstack/stacks/__init__.py +++ b/tobiko/openstack/stacks/__init__.py @@ -22,3 +22,4 @@ KeyPairStackFixture = _nova.KeyPairStackFixture NetworkStackFixture = _neutron.NetworkStackFixture FloatingIpServerStackFixture = _neutron.FloatingIpServerStackFixture +SecurityGroupsFixture = _neutron.SecurityGroupsFixture diff --git a/tobiko/openstack/stacks/_neutron.py b/tobiko/openstack/stacks/_neutron.py index de69d59ce..f1d2aa9e4 100644 --- a/tobiko/openstack/stacks/_neutron.py +++ b/tobiko/openstack/stacks/_neutron.py @@ -19,6 +19,7 @@ from __future__ import absolute_import import tobiko from tobiko import config from tobiko.openstack import heat +from tobiko.openstack import neutron from tobiko.openstack.stacks import _hot from tobiko.openstack.stacks import _nova from tobiko.shell import ssh @@ -57,6 +58,15 @@ class NetworkStackFixture(heat.HeatStackFixture): return bool(self.gateway_network) +@neutron.skip_if_missing_networking_extensions('security-group') +class SecurityGroupsFixture(heat.HeatStackFixture): + """Heat stack with some security groups + + """ + #: Heat template file + template = _hot.heat_template_file('neutron/security_groups.yaml') + + class FloatingIpServerStackFixture(heat.HeatStackFixture): #: Heat template file diff --git a/tobiko/tests/scenario/neutron/_stacks.py b/tobiko/tests/scenario/neutron/_stacks.py index e01576d6e..82bbe1c19 100644 --- a/tobiko/tests/scenario/neutron/_stacks.py +++ b/tobiko/tests/scenario/neutron/_stacks.py @@ -101,12 +101,3 @@ class InternalNetworkWithNetMtuWritableFixture(InternalNetworkFixture): """ #: Force value for internal network maximum transfer unit mtu = 1000 - - -@neutron.skip_if_missing_networking_extensions('security-group') -class SecurityGroupsFixture(heat.HeatStackFixture): - """Heat stack with some security groups - - """ - #: Heat template file - template = heat_template_file('security_groups.yaml') diff --git a/tobiko/tests/scenario/neutron/templates/key_pair.yaml b/tobiko/tests/scenario/neutron/templates/key_pair.yaml deleted file mode 100644 index daefc2364..000000000 --- a/tobiko/tests/scenario/neutron/templates/key_pair.yaml +++ /dev/null @@ -1,28 +0,0 @@ -heat_template_version: 2015-04-30 - -description: | - Creates a nova ssh keypair - - -parameters: - public_key: - type: string - - -resources: - - key_name: - type: OS::Heat::RandomString - properties: - length: 32 - - key_pair: - type: OS::Nova::KeyPair - properties: - name: {get_attr: [key_name, value]} - public_key: {get_param: public_key} - - -outputs: - key_name: - value: {get_attr: [key_name, value]} diff --git a/tobiko/tests/scenario/neutron/templates/security_groups.yaml b/tobiko/tests/scenario/neutron/templates/security_groups.yaml deleted file mode 100644 index b2a751624..000000000 --- a/tobiko/tests/scenario/neutron/templates/security_groups.yaml +++ /dev/null @@ -1,32 +0,0 @@ -heat_template_version: newton - - -description: | - Stack of resources used to test floating IP - - -resources: - - icmp_security_group: - type: OS::Neutron::SecurityGroup - properties: - name: icmp - rules: - - protocol: icmp - - ssh_security_group: - type: OS::Neutron::SecurityGroup - properties: - name: ssh - rules: - - protocol: tcp - port_range_min: 22 - port_range_max: 22 - -outputs: - - icmp_security_group_id: - value: {get_resource: icmp_security_group} - - ssh_security_group_id: - value: {get_resource: ssh_security_group} diff --git a/tobiko/tests/scenario/neutron/test_floating_ip.py b/tobiko/tests/scenario/neutron/test_floating_ip.py index cc8b8eb64..7210b99e9 100644 --- a/tobiko/tests/scenario/neutron/test_floating_ip.py +++ b/tobiko/tests/scenario/neutron/test_floating_ip.py @@ -184,7 +184,7 @@ class FloatingIPWithPortSecurityFixture(FloatingIPFixture): #: Resources stack with security group to allow ping Nova servers security_groups_stack = tobiko.required_setup_fixture( - _stacks.SecurityGroupsFixture) + stacks.SecurityGroupsFixture) #: Enable port security on internal network port_security_enabled = True