Move security group stack fixture to shared package

- remove unused Heat templates
- move security groups stack fixture to framework

Change-Id: I56cc623cb3a425bb1bc2ea2ac8619ee28a7b8e77
This commit is contained in:
Federico Ressi 2019-06-07 12:30:07 +02:00
parent 533d89a241
commit f59ba4e26e
6 changed files with 12 additions and 70 deletions

View File

@ -22,3 +22,4 @@ KeyPairStackFixture = _nova.KeyPairStackFixture
NetworkStackFixture = _neutron.NetworkStackFixture
FloatingIpServerStackFixture = _neutron.FloatingIpServerStackFixture
SecurityGroupsFixture = _neutron.SecurityGroupsFixture

View File

@ -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

View File

@ -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')

View File

@ -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]}

View File

@ -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}

View File

@ -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