Merge "Update all templates in neutron tests"
This commit is contained in:
commit
a538e4320b
|
@ -26,62 +26,46 @@ from heat.tests import utils
|
|||
|
||||
|
||||
firewall_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test neutron firewall resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"firewall": {
|
||||
"Type": "OS::Neutron::Firewall",
|
||||
"Properties": {
|
||||
"name": "test-firewall",
|
||||
"firewall_policy_id": "policy-id",
|
||||
"admin_state_up": True,
|
||||
"shared": True,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test neutron firewall resource
|
||||
resources:
|
||||
firewall:
|
||||
type: OS::Neutron::Firewall
|
||||
properties:
|
||||
name: test-firewall
|
||||
firewall_policy_id: policy-id
|
||||
admin_state_up: True
|
||||
shared: True
|
||||
'''
|
||||
|
||||
firewall_policy_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test neutron firewall policy resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"firewall_policy": {
|
||||
"Type": "OS::Neutron::FirewallPolicy",
|
||||
"Properties": {
|
||||
"name": "test-firewall-policy",
|
||||
"shared": True,
|
||||
"audited": True,
|
||||
"firewall_rules": ['rule-id-1', 'rule-id-2'],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test neutron firewall policy resource
|
||||
resources:
|
||||
firewall_policy:
|
||||
type: OS::Neutron::FirewallPolicy
|
||||
properties:
|
||||
name: test-firewall-policy
|
||||
shared: True
|
||||
audited: True
|
||||
firewall_rules:
|
||||
- rule-id-1
|
||||
- rule-id-2
|
||||
'''
|
||||
|
||||
firewall_rule_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test neutron firewall rule resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"firewall_rule": {
|
||||
"Type": "OS::Neutron::FirewallRule",
|
||||
"Properties": {
|
||||
"name": "test-firewall-rule",
|
||||
"shared": True,
|
||||
"protocol": "tcp",
|
||||
"action": "allow",
|
||||
"enabled": True,
|
||||
"ip_version": "4",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test neutron firewall rule resource
|
||||
resources:
|
||||
firewall_rule:
|
||||
type: OS::Neutron::FirewallRule
|
||||
properties:
|
||||
name: test-firewall-rule
|
||||
shared: True
|
||||
protocol: tcp
|
||||
action: allow
|
||||
enabled: True
|
||||
ip_version: 4
|
||||
'''
|
||||
|
||||
|
||||
|
|
|
@ -32,192 +32,124 @@ from heat.tests import utils
|
|||
|
||||
|
||||
health_monitor_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"monitor": {
|
||||
"Type": "OS::Neutron::HealthMonitor",
|
||||
"Properties": {
|
||||
"type": "HTTP",
|
||||
"delay": 3,
|
||||
"max_retries": 5,
|
||||
"timeout": 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer resources
|
||||
resources:
|
||||
monitor:
|
||||
type: OS::Neutron::HealthMonitor
|
||||
properties:
|
||||
type: HTTP
|
||||
delay: 3
|
||||
max_retries: 5
|
||||
timeout: 10
|
||||
'''
|
||||
|
||||
pool_template_with_vip_subnet = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"pool": {
|
||||
"Type": "OS::Neutron::Pool",
|
||||
"Properties": {
|
||||
"protocol": "HTTP",
|
||||
"subnet": "sub123",
|
||||
"lb_method": "ROUND_ROBIN",
|
||||
"vip": {
|
||||
"protocol_port": 80,
|
||||
"subnet": "sub9999"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
'''
|
||||
|
||||
pool_template_deprecated = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"pool": {
|
||||
"Type": "OS::Neutron::Pool",
|
||||
"Properties": {
|
||||
"protocol": "HTTP",
|
||||
"subnet_id": "sub123",
|
||||
"lb_method": "ROUND_ROBIN",
|
||||
"vip": {
|
||||
"protocol_port": 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer resources
|
||||
resources:
|
||||
pool:
|
||||
type: OS::Neutron::Pool
|
||||
properties:
|
||||
protocol: HTTP
|
||||
subnet: sub123
|
||||
lb_method: ROUND_ROBIN
|
||||
vip:
|
||||
protocol_port: 80
|
||||
subnet: sub9999
|
||||
'''
|
||||
|
||||
pool_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"pool": {
|
||||
"Type": "OS::Neutron::Pool",
|
||||
"Properties": {
|
||||
"protocol": "HTTP",
|
||||
"subnet": "sub123",
|
||||
"lb_method": "ROUND_ROBIN",
|
||||
"vip": {
|
||||
"protocol_port": 80
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer resources
|
||||
resources:
|
||||
pool:
|
||||
type: OS::Neutron::Pool
|
||||
properties:
|
||||
protocol: HTTP
|
||||
subnet: sub123
|
||||
lb_method: ROUND_ROBIN
|
||||
vip:
|
||||
protocol_port: 80
|
||||
|
||||
'''
|
||||
|
||||
pool_template_deprecated = pool_template.replace('subnet', 'subnet_id')
|
||||
|
||||
member_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer member",
|
||||
"Resources" : {
|
||||
"member": {
|
||||
"Type": "OS::Neutron::PoolMember",
|
||||
"Properties": {
|
||||
"protocol_port": 8080,
|
||||
"pool_id": "pool123",
|
||||
"address": "1.2.3.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer member
|
||||
resources:
|
||||
member:
|
||||
type: OS::Neutron::PoolMember
|
||||
properties:
|
||||
protocol_port: 8080
|
||||
pool_id: pool123
|
||||
address: 1.2.3.4
|
||||
'''
|
||||
|
||||
lb_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"lb": {
|
||||
"Type": "OS::Neutron::LoadBalancer",
|
||||
"Properties": {
|
||||
"protocol_port": 8080,
|
||||
"pool_id": "pool123",
|
||||
"members": ["1234"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer resources
|
||||
resources:
|
||||
lb:
|
||||
type: OS::Neutron::LoadBalancer
|
||||
properties:
|
||||
protocol_port: 8080
|
||||
pool_id: pool123
|
||||
members: [1234]
|
||||
'''
|
||||
|
||||
|
||||
pool_with_session_persistence_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources wit",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"pool": {
|
||||
"Type": "OS::Neutron::Pool",
|
||||
"Properties": {
|
||||
"protocol": "HTTP",
|
||||
"subnet": "sub123",
|
||||
"lb_method": "ROUND_ROBIN",
|
||||
"vip": {
|
||||
"protocol_port": 80,
|
||||
"session_persistence": {
|
||||
"type": "APP_COOKIE",
|
||||
"cookie_name": "cookie"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer resources
|
||||
resources:
|
||||
pool:
|
||||
type: OS::Neutron::Pool
|
||||
properties:
|
||||
protocol: HTTP
|
||||
subnet: sub123
|
||||
lb_method: ROUND_ROBIN
|
||||
vip:
|
||||
protocol_port: 80
|
||||
session_persistence:
|
||||
type: APP_COOKIE
|
||||
cookie_name: cookie
|
||||
'''
|
||||
|
||||
|
||||
pool_with_health_monitors_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test load balancer resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"monitor1": {
|
||||
"Type": "OS::Neutron::HealthMonitor",
|
||||
"Properties": {
|
||||
"type": "HTTP",
|
||||
"delay": 3,
|
||||
"max_retries": 5,
|
||||
"timeout": 10
|
||||
}
|
||||
},
|
||||
"monitor2": {
|
||||
"Type": "OS::Neutron::HealthMonitor",
|
||||
"Properties": {
|
||||
"type": "HTTP",
|
||||
"delay": 3,
|
||||
"max_retries": 5,
|
||||
"timeout": 10
|
||||
}
|
||||
},
|
||||
"pool": {
|
||||
"Type": "OS::Neutron::Pool",
|
||||
"Properties": {
|
||||
"protocol": "HTTP",
|
||||
"subnet_id": "sub123",
|
||||
"lb_method": "ROUND_ROBIN",
|
||||
"vip": {
|
||||
"protocol_port": 80
|
||||
},
|
||||
"monitors": [
|
||||
{"Ref": "monitor1"},
|
||||
{"Ref": "monitor2"}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test load balancer resources
|
||||
resources:
|
||||
monitor1:
|
||||
type: OS::Neutron::HealthMonitor
|
||||
properties:
|
||||
type: HTTP
|
||||
delay: 3
|
||||
max_retries: 5
|
||||
timeout: 10
|
||||
|
||||
monitor2:
|
||||
type: OS::Neutron::HealthMonitor
|
||||
properties:
|
||||
type: HTTP
|
||||
delay: 3
|
||||
max_retries: 5
|
||||
timeout: 10
|
||||
|
||||
pool:
|
||||
type: OS::Neutron::Pool
|
||||
properties:
|
||||
protocol: HTTP
|
||||
subnet_id: sub123
|
||||
lb_method: ROUND_ROBIN
|
||||
vip:
|
||||
protocol_port: 80
|
||||
monitors:
|
||||
- {get_resource: monitor1}
|
||||
- {get_resource: monitor2}
|
||||
'''
|
||||
|
||||
|
||||
|
@ -619,8 +551,8 @@ class PoolTest(common.HeatTestCase):
|
|||
msg = _('Property cookie_name is required, when '
|
||||
'session_persistence type is set to APP_COOKIE.')
|
||||
snippet = template_format.parse(pool_with_session_persistence_template)
|
||||
pool = snippet['Resources']['pool']
|
||||
persistence = pool['Properties']['vip']['session_persistence']
|
||||
pool = snippet['resources']['pool']
|
||||
persistence = pool['properties']['vip']['session_persistence']
|
||||
|
||||
# When persistence type is set to APP_COOKIE, cookie_name is required
|
||||
persistence['type'] = 'APP_COOKIE'
|
||||
|
@ -671,8 +603,8 @@ class PoolTest(common.HeatTestCase):
|
|||
{'vip': {'status': 'ACTIVE'}})
|
||||
|
||||
snippet = template_format.parse(pool_with_session_persistence_template)
|
||||
pool = snippet['Resources']['pool']
|
||||
persistence = pool['Properties']['vip']['session_persistence']
|
||||
pool = snippet['resources']['pool']
|
||||
persistence = pool['properties']['vip']['session_persistence']
|
||||
|
||||
# change persistence type to HTTP_COOKIE that not require cookie_name
|
||||
persistence['type'] = 'HTTP_COOKIE'
|
||||
|
@ -829,7 +761,7 @@ class PoolTest(common.HeatTestCase):
|
|||
|
||||
snippet = template_format.parse(pool_template)
|
||||
stack = utils.parse_stack(snippet)
|
||||
snippet['Resources']['pool']['Properties']['monitors'] = [
|
||||
snippet['resources']['pool']['properties']['monitors'] = [
|
||||
'mon123', 'mon456']
|
||||
resource_defns = stack.t.resource_definitions(stack)
|
||||
rsrc = loadbalancer.Pool('pool', resource_defns['pool'], stack)
|
||||
|
@ -882,8 +814,8 @@ class PoolMemberTest(common.HeatTestCase):
|
|||
'address': '1.2.3.4'}}
|
||||
).AndReturn({'member': {'id': 'member5678'}})
|
||||
snippet = template_format.parse(member_template)
|
||||
snippet['Resources']['member']['Properties']['admin_state_up'] = False
|
||||
snippet['Resources']['member']['Properties']['weight'] = 100
|
||||
snippet['resources']['member']['properties']['admin_state_up'] = False
|
||||
snippet['resources']['member']['properties']['weight'] = 100
|
||||
stack = utils.parse_stack(snippet)
|
||||
resource_defns = stack.t.resource_definitions(stack)
|
||||
rsrc = loadbalancer.PoolMember(
|
||||
|
@ -1096,8 +1028,8 @@ class PoolUpdateHealthMonitorsTest(common.HeatTestCase):
|
|||
self.assertEqual((self.stack.CREATE, self.stack.COMPLETE),
|
||||
self.stack.state)
|
||||
|
||||
snippet['Resources']['pool']['Properties']['monitors'] = [
|
||||
{u'Ref': u'monitor1'}]
|
||||
snippet['resources']['pool']['properties']['monitors'] = [
|
||||
{u'get_resource': u'monitor1'}]
|
||||
updated_stack = utils.parse_stack(snippet)
|
||||
self.stack.update(updated_stack)
|
||||
self.assertEqual((self.stack.UPDATE, self.stack.COMPLETE),
|
||||
|
@ -1119,7 +1051,7 @@ class PoolUpdateHealthMonitorsTest(common.HeatTestCase):
|
|||
self.assertEqual((self.stack.CREATE, self.stack.COMPLETE),
|
||||
self.stack.state)
|
||||
|
||||
snippet['Resources']['pool']['Properties']['monitors'] = []
|
||||
snippet['resources']['pool']['properties']['monitors'] = []
|
||||
updated_stack = utils.parse_stack(snippet)
|
||||
self.stack.update(updated_stack)
|
||||
self.assertEqual((self.stack.UPDATE, self.stack.COMPLETE),
|
||||
|
@ -1141,7 +1073,7 @@ class PoolUpdateHealthMonitorsTest(common.HeatTestCase):
|
|||
self.assertEqual((self.stack.CREATE, self.stack.COMPLETE),
|
||||
self.stack.state)
|
||||
|
||||
snippet['Resources']['pool']['Properties'].pop('monitors')
|
||||
snippet['resources']['pool']['properties'].pop('monitors')
|
||||
updated_stack = utils.parse_stack(snippet)
|
||||
self.stack.update(updated_stack)
|
||||
self.assertEqual((self.stack.UPDATE, self.stack.COMPLETE),
|
||||
|
|
|
@ -24,30 +24,23 @@ from heat.tests import utils
|
|||
|
||||
|
||||
metering_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test metering resources",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"label": {
|
||||
"Type": "OS::Neutron::MeteringLabel",
|
||||
"Properties": {
|
||||
"name": "TestLabel",
|
||||
"description": "Description of TestLabel",
|
||||
"shared": True,
|
||||
}
|
||||
},
|
||||
"rule": {
|
||||
"Type": "OS::Neutron::MeteringRule",
|
||||
"Properties": {
|
||||
"metering_label_id": { "Ref" : "label" },
|
||||
"remote_ip_prefix": "10.0.3.0/24",
|
||||
"direction": "ingress",
|
||||
"excluded": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test metering resources
|
||||
resources:
|
||||
label:
|
||||
type: OS::Neutron::MeteringLabel
|
||||
properties:
|
||||
name: TestLabel
|
||||
description: Description of TestLabel
|
||||
shared: True
|
||||
|
||||
rule:
|
||||
type: OS::Neutron::MeteringRule
|
||||
properties:
|
||||
metering_label_id: { get_resource: label }
|
||||
remote_ip_prefix: 10.0.3.0/24
|
||||
direction: ingress
|
||||
excluded: false
|
||||
'''
|
||||
|
||||
|
||||
|
|
|
@ -30,49 +30,37 @@ from heat.tests import utils
|
|||
|
||||
|
||||
gw_template_deprecated = '''
|
||||
{
|
||||
'AWSTemplateFormatVersion': '2010-09-09',
|
||||
'Description': 'Template to test Network Gateway resource',
|
||||
'Parameters': {},
|
||||
'Resources': {
|
||||
'NetworkGateway': {
|
||||
'Type': 'OS::Neutron::NetworkGateway',
|
||||
'Properties': {
|
||||
'name': 'NetworkGateway',
|
||||
'devices': [{
|
||||
'id': 'e52148ca-7db9-4ec3-abe6-2c7c0ff316eb',
|
||||
'interface_name': 'breth1'}],
|
||||
'connections': [{
|
||||
'network_id': '6af055d3-26f6-48dd-a597-7611d7e58d35',
|
||||
'segmentation_type': 'vlan',
|
||||
'segmentation_id': 10}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test Network Gateway resource
|
||||
resources:
|
||||
NetworkGateway:
|
||||
type: OS::Neutron::NetworkGateway
|
||||
properties:
|
||||
name: NetworkGateway
|
||||
devices:
|
||||
- id: e52148ca-7db9-4ec3-abe6-2c7c0ff316eb
|
||||
interface_name: breth1
|
||||
connections:
|
||||
- network_id: 6af055d3-26f6-48dd-a597-7611d7e58d35
|
||||
segmentation_type: vlan
|
||||
segmentation_id: 10
|
||||
'''
|
||||
|
||||
gw_template = '''
|
||||
{
|
||||
'AWSTemplateFormatVersion': '2010-09-09',
|
||||
'Description': 'Template to test Network Gateway resource',
|
||||
'Parameters': {},
|
||||
'Resources': {
|
||||
'NetworkGateway': {
|
||||
'Type': 'OS::Neutron::NetworkGateway',
|
||||
'Properties': {
|
||||
'name': 'NetworkGateway',
|
||||
'devices': [{
|
||||
'id': 'e52148ca-7db9-4ec3-abe6-2c7c0ff316eb',
|
||||
'interface_name': 'breth1'}],
|
||||
'connections': [{
|
||||
'network': '6af055d3-26f6-48dd-a597-7611d7e58d35',
|
||||
'segmentation_type': 'vlan',
|
||||
'segmentation_id': 10}]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test Network Gateway resource
|
||||
resources:
|
||||
NetworkGateway:
|
||||
type: OS::Neutron::NetworkGateway
|
||||
properties:
|
||||
name: NetworkGateway
|
||||
devices:
|
||||
- id: e52148ca-7db9-4ec3-abe6-2c7c0ff316eb
|
||||
interface_name: breth1
|
||||
connections:
|
||||
- network: 6af055d3-26f6-48dd-a597-7611d7e58d35
|
||||
segmentation_type: vlan
|
||||
segmentation_id: 10
|
||||
'''
|
||||
|
||||
sng = {
|
||||
|
@ -528,7 +516,7 @@ class NeutronNetworkGatewayTest(common.HeatTestCase):
|
|||
|
||||
def test_gateway_validate_failed_with_vlan(self):
|
||||
t = template_format.parse(gw_template)
|
||||
del t['Resources']['NetworkGateway']['Properties'][
|
||||
del t['resources']['NetworkGateway']['properties'][
|
||||
'connections'][0]['segmentation_id']
|
||||
stack = utils.parse_stack(t)
|
||||
resource_defns = stack.t.resource_definitions(stack)
|
||||
|
@ -550,7 +538,7 @@ class NeutronNetworkGatewayTest(common.HeatTestCase):
|
|||
|
||||
def test_gateway_validate_failed_with_flat(self):
|
||||
t = template_format.parse(gw_template)
|
||||
t['Resources']['NetworkGateway']['Properties'][
|
||||
t['resources']['NetworkGateway']['properties'][
|
||||
'connections'][0]['segmentation_type'] = 'flat'
|
||||
stack = utils.parse_stack(t)
|
||||
resource_defns = stack.t.resource_definitions(stack)
|
||||
|
|
|
@ -29,11 +29,11 @@ from heat.tests import utils
|
|||
class SecurityGroupTest(common.HeatTestCase):
|
||||
|
||||
test_template = '''
|
||||
HeatTemplateFormatVersion: '2012-12-12'
|
||||
Resources:
|
||||
heat_template_version: 2015-04-30
|
||||
resources:
|
||||
the_sg:
|
||||
Type: OS::Neutron::SecurityGroup
|
||||
Properties:
|
||||
type: OS::Neutron::SecurityGroup
|
||||
properties:
|
||||
description: HTTP and SSH access
|
||||
rules:
|
||||
- port_range_min: 22
|
||||
|
@ -60,11 +60,11 @@ Resources:
|
|||
'''
|
||||
|
||||
test_template_update = '''
|
||||
HeatTemplateFormatVersion: '2012-12-12'
|
||||
Resources:
|
||||
heat_template_version: 2015-04-30
|
||||
resources:
|
||||
the_sg:
|
||||
Type: OS::Neutron::SecurityGroup
|
||||
Properties:
|
||||
type: OS::Neutron::SecurityGroup
|
||||
properties:
|
||||
description: SSH access for private network
|
||||
name: myrules
|
||||
rules:
|
||||
|
@ -75,11 +75,11 @@ Resources:
|
|||
'''
|
||||
|
||||
test_template_validate = '''
|
||||
HeatTemplateFormatVersion: '2012-12-12'
|
||||
Resources:
|
||||
heat_template_version: 2015-04-30
|
||||
resources:
|
||||
the_sg:
|
||||
Type: OS::Neutron::SecurityGroup
|
||||
Properties:
|
||||
type: OS::Neutron::SecurityGroup
|
||||
properties:
|
||||
name: default
|
||||
'''
|
||||
|
||||
|
|
|
@ -27,128 +27,84 @@ from heat.tests import common
|
|||
from heat.tests import utils
|
||||
|
||||
|
||||
vpnservice_template_deprecated = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test VPN service resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"VPNService" : {
|
||||
"Type" : "OS::Neutron::VPNService",
|
||||
"Properties" : {
|
||||
"name" : "VPNService",
|
||||
"description" : "My new VPN service",
|
||||
"admin_state_up" : true,
|
||||
"router_id" : "rou123",
|
||||
"subnet_id" : "sub123"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
vpnservice_template = '''
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test vpnservice Neutron resource
|
||||
resources:
|
||||
VPNService:
|
||||
type: OS::Neutron::VPNService
|
||||
properties:
|
||||
name: VPNService
|
||||
description: My new VPN service
|
||||
admin_state_up: true
|
||||
router_id: rou123
|
||||
subnet: sub123
|
||||
'''
|
||||
|
||||
vpnservice_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test VPN service resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"VPNService" : {
|
||||
"Type" : "OS::Neutron::VPNService",
|
||||
"Properties" : {
|
||||
"name" : "VPNService",
|
||||
"description" : "My new VPN service",
|
||||
"admin_state_up" : true,
|
||||
"router_id" : "rou123",
|
||||
"subnet" : "sub123"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
'''
|
||||
vpnservice_template_deprecated = vpnservice_template.replace(
|
||||
'subnet', 'subnet_id')
|
||||
|
||||
ipsec_site_connection_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test IPsec policy resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"IPsecSiteConnection" : {
|
||||
"Type" : "OS::Neutron::IPsecSiteConnection",
|
||||
"Properties" : {
|
||||
"name" : "IPsecSiteConnection",
|
||||
"description" : "My new VPN connection",
|
||||
"peer_address" : "172.24.4.233",
|
||||
"peer_id" : "172.24.4.233",
|
||||
"peer_cidrs" : [ "10.2.0.0/24" ],
|
||||
"mtu" : 1500,
|
||||
"dpd" : {
|
||||
"actions" : "hold",
|
||||
"interval" : 30,
|
||||
"timeout" : 120
|
||||
},
|
||||
"psk" : "secret",
|
||||
"initiator" : "bi-directional",
|
||||
"admin_state_up" : true,
|
||||
"ikepolicy_id" : "ike123",
|
||||
"ipsecpolicy_id" : "ips123",
|
||||
"vpnservice_id" : "vpn123"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test IPsec policy resource
|
||||
resources:
|
||||
IPsecSiteConnection:
|
||||
type: OS::Neutron::IPsecSiteConnection,
|
||||
properties:
|
||||
name: IPsecSiteConnection
|
||||
description: My new VPN connection
|
||||
peer_address: 172.24.4.233
|
||||
peer_id: 172.24.4.233
|
||||
peer_cidrs: [ 10.2.0.0/24 ]
|
||||
mtu: 1500
|
||||
dpd:
|
||||
actions: hold
|
||||
interval: 30
|
||||
timeout: 120
|
||||
psk: secret
|
||||
initiator: bi-directional
|
||||
admin_state_up: true
|
||||
ikepolicy_id: ike123
|
||||
ipsecpolicy_id: ips123
|
||||
vpnservice_id: vpn123
|
||||
'''
|
||||
|
||||
ikepolicy_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test IKE policy resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"IKEPolicy" : {
|
||||
"Type" : "OS::Neutron::IKEPolicy",
|
||||
"Properties" : {
|
||||
"name" : "IKEPolicy",
|
||||
"description" : "My new IKE policy",
|
||||
"auth_algorithm" : "sha1",
|
||||
"encryption_algorithm" : "3des",
|
||||
"phase1_negotiation_mode" : "main",
|
||||
"lifetime" : {
|
||||
"units" : "seconds",
|
||||
"value" : 3600
|
||||
},
|
||||
"pfs" : "group5",
|
||||
"ike_version" : "v1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test IKE policy resource
|
||||
resources:
|
||||
IKEPolicy:
|
||||
type: OS::Neutron::IKEPolicy
|
||||
properties:
|
||||
name: IKEPolicy
|
||||
description: My new IKE policy
|
||||
auth_algorithm: sha1
|
||||
encryption_algorithm: 3des
|
||||
phase1_negotiation_mode: main
|
||||
lifetime:
|
||||
units: seconds
|
||||
value: 3600
|
||||
pfs: group5
|
||||
ike_version: v1
|
||||
'''
|
||||
|
||||
ipsecpolicy_template = '''
|
||||
{
|
||||
"AWSTemplateFormatVersion" : "2010-09-09",
|
||||
"Description" : "Template to test IPsec policy resource",
|
||||
"Parameters" : {},
|
||||
"Resources" : {
|
||||
"IPsecPolicy" : {
|
||||
"Type" : "OS::Neutron::IPsecPolicy",
|
||||
"Properties" : {
|
||||
"name" : "IPsecPolicy",
|
||||
"description" : "My new IPsec policy",
|
||||
"transform_protocol": "esp",
|
||||
"encapsulation_mode" : "tunnel",
|
||||
"auth_algorithm" : "sha1",
|
||||
"encryption_algorithm" : "3des",
|
||||
"lifetime" : {
|
||||
"units" : "seconds",
|
||||
"value" : 3600
|
||||
},
|
||||
"pfs" : "group5"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
heat_template_version: 2015-04-30
|
||||
description: Template to test IPsec policy resource
|
||||
resources:
|
||||
IPsecPolicy:
|
||||
type: OS::Neutron::IPsecPolicy
|
||||
properties:
|
||||
name: IPsecPolicy
|
||||
description: My new IPsec policy
|
||||
transform_protocol: esp
|
||||
encapsulation_mode: tunnel
|
||||
auth_algorithm: sha1
|
||||
encryption_algorithm: 3des
|
||||
lifetime:
|
||||
units: seconds
|
||||
value: 3600
|
||||
pfs : group5
|
||||
'''
|
||||
|
||||
|
||||
|
@ -190,7 +146,7 @@ class VPNServiceTest(common.HeatTestCase):
|
|||
'router',
|
||||
'rou123'
|
||||
).AndReturn('rou123')
|
||||
props = snippet['Resources']['VPNService']['Properties']
|
||||
props = snippet['resources']['VPNService']['properties']
|
||||
props['router'] = 'rou123'
|
||||
del props['router_id']
|
||||
neutronclient.Client.create_vpnservice(
|
||||
|
|
Loading…
Reference in New Issue