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:
parent
533d89a241
commit
f59ba4e26e
|
@ -22,3 +22,4 @@ KeyPairStackFixture = _nova.KeyPairStackFixture
|
||||||
|
|
||||||
NetworkStackFixture = _neutron.NetworkStackFixture
|
NetworkStackFixture = _neutron.NetworkStackFixture
|
||||||
FloatingIpServerStackFixture = _neutron.FloatingIpServerStackFixture
|
FloatingIpServerStackFixture = _neutron.FloatingIpServerStackFixture
|
||||||
|
SecurityGroupsFixture = _neutron.SecurityGroupsFixture
|
||||||
|
|
|
@ -19,6 +19,7 @@ from __future__ import absolute_import
|
||||||
import tobiko
|
import tobiko
|
||||||
from tobiko import config
|
from tobiko import config
|
||||||
from tobiko.openstack import heat
|
from tobiko.openstack import heat
|
||||||
|
from tobiko.openstack import neutron
|
||||||
from tobiko.openstack.stacks import _hot
|
from tobiko.openstack.stacks import _hot
|
||||||
from tobiko.openstack.stacks import _nova
|
from tobiko.openstack.stacks import _nova
|
||||||
from tobiko.shell import ssh
|
from tobiko.shell import ssh
|
||||||
|
@ -57,6 +58,15 @@ class NetworkStackFixture(heat.HeatStackFixture):
|
||||||
return bool(self.gateway_network)
|
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):
|
class FloatingIpServerStackFixture(heat.HeatStackFixture):
|
||||||
|
|
||||||
#: Heat template file
|
#: Heat template file
|
||||||
|
|
|
@ -101,12 +101,3 @@ class InternalNetworkWithNetMtuWritableFixture(InternalNetworkFixture):
|
||||||
"""
|
"""
|
||||||
#: Force value for internal network maximum transfer unit
|
#: Force value for internal network maximum transfer unit
|
||||||
mtu = 1000
|
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')
|
|
||||||
|
|
|
@ -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]}
|
|
|
@ -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}
|
|
|
@ -184,7 +184,7 @@ class FloatingIPWithPortSecurityFixture(FloatingIPFixture):
|
||||||
|
|
||||||
#: Resources stack with security group to allow ping Nova servers
|
#: Resources stack with security group to allow ping Nova servers
|
||||||
security_groups_stack = tobiko.required_setup_fixture(
|
security_groups_stack = tobiko.required_setup_fixture(
|
||||||
_stacks.SecurityGroupsFixture)
|
stacks.SecurityGroupsFixture)
|
||||||
|
|
||||||
#: Enable port security on internal network
|
#: Enable port security on internal network
|
||||||
port_security_enabled = True
|
port_security_enabled = True
|
||||||
|
|
Loading…
Reference in New Issue