tests remove stack_delete_after decorator
This is no longer required because cleanup is provided via reset of the dummy db in all tests which call the base-class setUp. Change-Id: I49cbfce0b2880d0318114df35d4abaed61d03bfc
This commit is contained in:
parent
f666c2d3d3
commit
d75324646c
@ -82,7 +82,6 @@ class MarconiMessageQueueTest(HeatTestCase):
|
|||||||
self.stack.validate()
|
self.stack.validate()
|
||||||
self.stack.store()
|
self.stack.store()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create(self):
|
def test_create(self):
|
||||||
t = template_format.parse(wp_template)
|
t = template_format.parse(wp_template)
|
||||||
self.parse_stack(t)
|
self.parse_stack(t)
|
||||||
@ -113,7 +112,6 @@ class MarconiMessageQueueTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_existing_queue(self):
|
def test_create_existing_queue(self):
|
||||||
t = template_format.parse(wp_template)
|
t = template_format.parse(wp_template)
|
||||||
self.parse_stack(t)
|
self.parse_stack(t)
|
||||||
@ -135,7 +133,6 @@ class MarconiMessageQueueTest(HeatTestCase):
|
|||||||
str(err))
|
str(err))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_failed(self):
|
def test_create_failed(self):
|
||||||
t = template_format.parse(wp_template)
|
t = template_format.parse(wp_template)
|
||||||
self.parse_stack(t)
|
self.parse_stack(t)
|
||||||
@ -161,7 +158,6 @@ class MarconiMessageQueueTest(HeatTestCase):
|
|||||||
str(err))
|
str(err))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
t = template_format.parse(wp_template)
|
t = template_format.parse(wp_template)
|
||||||
self.parse_stack(t)
|
self.parse_stack(t)
|
||||||
@ -184,7 +180,6 @@ class MarconiMessageQueueTest(HeatTestCase):
|
|||||||
scheduler.TaskRunner(queue.delete)()
|
scheduler.TaskRunner(queue.delete)()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_in_place(self):
|
def test_update_in_place(self):
|
||||||
t = template_format.parse(wp_template)
|
t = template_format.parse(wp_template)
|
||||||
self.parse_stack(t)
|
self.parse_stack(t)
|
||||||
@ -212,7 +207,6 @@ class MarconiMessageQueueTest(HeatTestCase):
|
|||||||
scheduler.TaskRunner(queue.update, new_queue)()
|
scheduler.TaskRunner(queue.update, new_queue)()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_replace(self):
|
def test_update_replace(self):
|
||||||
t = template_format.parse(wp_template)
|
t = template_format.parse(wp_template)
|
||||||
self.parse_stack(t)
|
self.parse_stack(t)
|
||||||
|
@ -106,7 +106,6 @@ class CloudNetworkTest(HeatTestCase):
|
|||||||
res = self.stack['cnw']
|
res = self.stack['cnw']
|
||||||
self.assertEqual((res.CREATE, res.COMPLETE), res.state)
|
self.assertEqual((res.CREATE, res.COMPLETE), res.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attributes(self, mock_client):
|
def test_attributes(self, mock_client):
|
||||||
self._setup_stack(mock_client)
|
self._setup_stack(mock_client)
|
||||||
res = self.stack['cnw']
|
res = self.stack['cnw']
|
||||||
@ -116,7 +115,6 @@ class CloudNetworkTest(HeatTestCase):
|
|||||||
self.assertEqual(expect_label, res.FnGetAtt('label'))
|
self.assertEqual(expect_label, res.FnGetAtt('label'))
|
||||||
self.assertEqual(expect_cidr, res.FnGetAtt('cidr'))
|
self.assertEqual(expect_cidr, res.FnGetAtt('cidr'))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_bad_cider(self, mock_client):
|
def test_create_bad_cider(self, mock_client):
|
||||||
self._template['resources']['cnw']['properties']['cidr'] = "bad cidr"
|
self._template['resources']['cnw']['properties']['cidr'] = "bad cidr"
|
||||||
self._parse_stack()
|
self._parse_stack()
|
||||||
@ -124,7 +122,6 @@ class CloudNetworkTest(HeatTestCase):
|
|||||||
self.stack.validate)
|
self.stack.validate)
|
||||||
self.assertIn("Invalid cidr", str(exc))
|
self.assertIn("Invalid cidr", str(exc))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self, mock_client):
|
def test_delete(self, mock_client):
|
||||||
self._setup_stack(mock_client)
|
self._setup_stack(mock_client)
|
||||||
res = self.stack['cnw']
|
res = self.stack['cnw']
|
||||||
@ -134,13 +131,11 @@ class CloudNetworkTest(HeatTestCase):
|
|||||||
exc = self.assertRaises(NotFound, self.fake_cnw.get, res_id)
|
exc = self.assertRaises(NotFound, self.fake_cnw.get, res_id)
|
||||||
self.assertIn(res_id, str(exc))
|
self.assertIn(res_id, str(exc))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_not_complete(self, mock_client):
|
def test_delete_not_complete(self, mock_client):
|
||||||
self._setup_stack(mock_client)
|
self._setup_stack(mock_client)
|
||||||
res = self.stack['cnw']
|
res = self.stack['cnw']
|
||||||
self.assertFalse(res.check_delete_complete(res.network()))
|
self.assertFalse(res.check_delete_complete(res.network()))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_not_found(self, mock_client):
|
def test_delete_not_found(self, mock_client):
|
||||||
self._setup_stack(mock_client)
|
self._setup_stack(mock_client)
|
||||||
self.fake_cnw.networks = []
|
self.fake_cnw.networks = []
|
||||||
|
@ -170,7 +170,6 @@ class CeilometerAlarmTest(HeatTestCase):
|
|||||||
self.fa.alarms.create(**al).AndReturn(FakeCeilometerAlarm())
|
self.fa.alarms.create(**al).AndReturn(FakeCeilometerAlarm())
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_mem_alarm_high_update_no_replace(self):
|
def test_mem_alarm_high_update_no_replace(self):
|
||||||
'''
|
'''
|
||||||
Make sure that we can change the update-able properties
|
Make sure that we can change the update-able properties
|
||||||
@ -211,7 +210,6 @@ class CeilometerAlarmTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_mem_alarm_high_update_replace(self):
|
def test_mem_alarm_high_update_replace(self):
|
||||||
'''
|
'''
|
||||||
Make sure that the Alarm resource IS replaced when non-update-able
|
Make sure that the Alarm resource IS replaced when non-update-able
|
||||||
@ -236,7 +234,6 @@ class CeilometerAlarmTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_mem_alarm_suspend_resume(self):
|
def test_mem_alarm_suspend_resume(self):
|
||||||
"""
|
"""
|
||||||
Make sure that the Alarm resource gets disabled on suspend
|
Make sure that the Alarm resource gets disabled on suspend
|
||||||
@ -262,7 +259,6 @@ class CeilometerAlarmTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_mem_alarm_high_correct_int_parameters(self):
|
def test_mem_alarm_high_correct_int_parameters(self):
|
||||||
self.stack = self.create_stack(not_string_alarm_template)
|
self.stack = self.create_stack(not_string_alarm_template)
|
||||||
|
|
||||||
|
@ -49,12 +49,10 @@ class CloudWatchAlarmTest(common.HeatTestCase):
|
|||||||
self.stack = utils.parse_stack(t)
|
self.stack = utils.parse_stack(t)
|
||||||
return self.stack
|
return self.stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_create_good(self):
|
def test_resource_create_good(self):
|
||||||
s = self.parse_stack()
|
s = self.parse_stack()
|
||||||
self.assertIsNone(scheduler.TaskRunner(s['test_me'].create)())
|
self.assertIsNone(scheduler.TaskRunner(s['test_me'].create)())
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_create_failed(self):
|
def test_resource_create_failed(self):
|
||||||
s = self.parse_stack()
|
s = self.parse_stack()
|
||||||
with patch.object(watchrule.WatchRule, 'store') as bad_store:
|
with patch.object(watchrule.WatchRule, 'store') as bad_store:
|
||||||
@ -62,13 +60,11 @@ class CloudWatchAlarmTest(common.HeatTestCase):
|
|||||||
task_func = scheduler.TaskRunner(s['test_me'].create)
|
task_func = scheduler.TaskRunner(s['test_me'].create)
|
||||||
self.assertRaises(exception.ResourceFailure, task_func)
|
self.assertRaises(exception.ResourceFailure, task_func)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_delete_good(self):
|
def test_resource_delete_good(self):
|
||||||
s = self.parse_stack()
|
s = self.parse_stack()
|
||||||
self.assertIsNone(scheduler.TaskRunner(s['test_me'].create)())
|
self.assertIsNone(scheduler.TaskRunner(s['test_me'].create)())
|
||||||
self.assertIsNone(scheduler.TaskRunner(s['test_me'].delete)())
|
self.assertIsNone(scheduler.TaskRunner(s['test_me'].delete)())
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_delete_notfound(self):
|
def test_resource_delete_notfound(self):
|
||||||
# if a resource is not found, handle_delete() should not raise
|
# if a resource is not found, handle_delete() should not raise
|
||||||
# an exception.
|
# an exception.
|
||||||
|
@ -593,7 +593,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
def resolve(self, snippet):
|
def resolve(self, snippet):
|
||||||
return function.resolve(self.stack.t.parse(self.stack, snippet))
|
return function.resolve(self.stack.t.parse(self.stack, snippet))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_attr_multiple_rsrc_status(self):
|
def test_get_attr_multiple_rsrc_status(self):
|
||||||
"""Test resolution of get_attr occurrences in HOT template."""
|
"""Test resolution of get_attr occurrences in HOT template."""
|
||||||
|
|
||||||
@ -620,7 +619,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
# resource name.
|
# resource name.
|
||||||
self.assertEqual({'Value': 'resource1'}, self.resolve(snippet))
|
self.assertEqual({'Value': 'resource1'}, self.resolve(snippet))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_attr_invalid(self):
|
def test_get_attr_invalid(self):
|
||||||
"""Test resolution of get_attr occurrences in HOT template."""
|
"""Test resolution of get_attr occurrences in HOT template."""
|
||||||
|
|
||||||
@ -635,7 +633,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
self.resolve,
|
self.resolve,
|
||||||
{'Value': {'get_attr': ['resource1', 'NotThere']}})
|
{'Value': {'get_attr': ['resource1', 'NotThere']}})
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_attr_invalid_resource(self):
|
def test_get_attr_invalid_resource(self):
|
||||||
"""Test resolution of get_attr occurrences in HOT template."""
|
"""Test resolution of get_attr occurrences in HOT template."""
|
||||||
|
|
||||||
@ -652,7 +649,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
self.assertRaises(exception.InvalidTemplateAttribute,
|
self.assertRaises(exception.InvalidTemplateAttribute,
|
||||||
self.resolve, snippet)
|
self.resolve, snippet)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_resource(self):
|
def test_get_resource(self):
|
||||||
"""Test resolution of get_resource occurrences in HOT template."""
|
"""Test resolution of get_resource occurrences in HOT template."""
|
||||||
|
|
||||||
@ -667,7 +663,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
snippet = {'value': {'get_resource': 'resource1'}}
|
snippet = {'value': {'get_resource': 'resource1'}}
|
||||||
self.assertEqual({'value': 'resource1'}, self.resolve(snippet))
|
self.assertEqual({'value': 'resource1'}, self.resolve(snippet))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_set_param_id(self):
|
def test_set_param_id(self):
|
||||||
tmpl = parser.Template(hot_tpl_empty)
|
tmpl = parser.Template(hot_tpl_empty)
|
||||||
self.stack = parser.Stack(self.ctx, 'param_id_test', tmpl)
|
self.stack = parser.Stack(self.ctx, 'param_id_test', tmpl)
|
||||||
@ -686,7 +681,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
self.assertFalse(params.set_stack_id(None))
|
self.assertFalse(params.set_stack_id(None))
|
||||||
self.assertTrue(params.set_stack_id(stack_id))
|
self.assertTrue(params.set_stack_id(stack_id))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_set_param_id_update(self):
|
def test_set_param_id_update(self):
|
||||||
tmpl = template.Template(
|
tmpl = template.Template(
|
||||||
{'heat_template_version': '2013-05-23',
|
{'heat_template_version': '2013-05-23',
|
||||||
@ -715,7 +709,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
|
|
||||||
self.assertEqual(self.stack['AResource'].metadata['Bar'], stack_id)
|
self.assertEqual(self.stack['AResource'].metadata['Bar'], stack_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_param_id(self):
|
def test_load_param_id(self):
|
||||||
tmpl = parser.Template(hot_tpl_empty)
|
tmpl = parser.Template(hot_tpl_empty)
|
||||||
self.stack = parser.Stack(self.ctx, 'param_load_id_test', tmpl)
|
self.stack = parser.Stack(self.ctx, 'param_load_id_test', tmpl)
|
||||||
@ -728,7 +721,6 @@ class StackTest(test_parser.StackTest):
|
|||||||
self.assertEqual(newstack.parameters['OS::stack_id'],
|
self.assertEqual(newstack.parameters['OS::stack_id'],
|
||||||
stack_identifier.stack_id)
|
stack_identifier.stack_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_modify_param_ok_replace(self):
|
def test_update_modify_param_ok_replace(self):
|
||||||
tmpl = {
|
tmpl = {
|
||||||
'heat_template_version': '2013-05-23',
|
'heat_template_version': '2013-05-23',
|
||||||
@ -848,7 +840,6 @@ class StackAttributesTest(HeatTestCase):
|
|||||||
expected={'Value': None}))
|
expected={'Value': None}))
|
||||||
]
|
]
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_attr(self):
|
def test_get_attr(self):
|
||||||
"""Test resolution of get_attr occurrences in HOT template."""
|
"""Test resolution of get_attr occurrences in HOT template."""
|
||||||
|
|
||||||
|
@ -163,7 +163,6 @@ class MetadataRefreshTest(HeatTestCase):
|
|||||||
|
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_FnGetAtt(self):
|
def test_FnGetAtt(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
|
|
||||||
@ -244,7 +243,6 @@ class WaitCondMetadataUpdateTest(HeatTestCase):
|
|||||||
|
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_wait_meta(self):
|
def test_wait_meta(self):
|
||||||
'''
|
'''
|
||||||
1 create stack
|
1 create stack
|
||||||
|
@ -1020,7 +1020,6 @@ class PoolUpdateHealthMonitorsTest(HeatTestCase):
|
|||||||
neutronclient.Client.show_vip('xyz').AndReturn(
|
neutronclient.Client.show_vip('xyz').AndReturn(
|
||||||
{'vip': {'status': 'ACTIVE'}})
|
{'vip': {'status': 'ACTIVE'}})
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_pool_with_references_to_health_monitors(self):
|
def test_update_pool_with_references_to_health_monitors(self):
|
||||||
self._create_pool_with_health_monitors()
|
self._create_pool_with_health_monitors()
|
||||||
|
|
||||||
@ -1042,7 +1041,6 @@ class PoolUpdateHealthMonitorsTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_pool_with_empty_list_of_health_monitors(self):
|
def test_update_pool_with_empty_list_of_health_monitors(self):
|
||||||
self._create_pool_with_health_monitors()
|
self._create_pool_with_health_monitors()
|
||||||
|
|
||||||
@ -1065,7 +1063,6 @@ class PoolUpdateHealthMonitorsTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_pool_without_health_monitors(self):
|
def test_update_pool_without_health_monitors(self):
|
||||||
self._create_pool_with_health_monitors()
|
self._create_pool_with_health_monitors()
|
||||||
|
|
||||||
|
@ -123,7 +123,6 @@ Resources:
|
|||||||
self.assertEqual(ref_id, rsrc.FnGetRefId())
|
self.assertEqual(ref_id, rsrc.FnGetRefId())
|
||||||
self.assertEqual(metadata, dict(rsrc.metadata))
|
self.assertEqual(metadata, dict(rsrc.metadata))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group(self):
|
def test_security_group(self):
|
||||||
|
|
||||||
show_created = {'security_group': {
|
show_created = {'security_group': {
|
||||||
@ -543,7 +542,6 @@ Resources:
|
|||||||
stack.delete()
|
stack.delete()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_exception(self):
|
def test_security_group_exception(self):
|
||||||
#create script
|
#create script
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
@ -759,7 +757,6 @@ Resources:
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_validate(self):
|
def test_security_group_validate(self):
|
||||||
stack = self.create_stack(self.test_template_validate)
|
stack = self.create_stack(self.test_template_validate)
|
||||||
sg = stack['the_sg']
|
sg = stack['the_sg']
|
||||||
|
@ -165,7 +165,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
snippet['Resources']['VPNService'],
|
snippet['Resources']['VPNService'],
|
||||||
self.stack)
|
self.stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create(self):
|
def test_create(self):
|
||||||
rsrc = self.create_vpnservice()
|
rsrc = self.create_vpnservice()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -173,7 +172,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_failed(self):
|
def test_create_failed(self):
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
fakes.FakeKeystoneClient())
|
fakes.FakeKeystoneClient())
|
||||||
@ -193,7 +191,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
neutronclient.Client.delete_vpnservice('vpn123')
|
neutronclient.Client.delete_vpnservice('vpn123')
|
||||||
neutronclient.Client.show_vpnservice('vpn123').AndRaise(
|
neutronclient.Client.show_vpnservice('vpn123').AndRaise(
|
||||||
@ -205,7 +202,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_already_gone(self):
|
def test_delete_already_gone(self):
|
||||||
neutronclient.Client.delete_vpnservice('vpn123').AndRaise(
|
neutronclient.Client.delete_vpnservice('vpn123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=404))
|
vpnservice.NeutronClientException(status_code=404))
|
||||||
@ -216,7 +212,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_failed(self):
|
def test_delete_failed(self):
|
||||||
neutronclient.Client.delete_vpnservice('vpn123').AndRaise(
|
neutronclient.Client.delete_vpnservice('vpn123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=400))
|
vpnservice.NeutronClientException(status_code=400))
|
||||||
@ -231,7 +226,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute(self):
|
def test_attribute(self):
|
||||||
rsrc = self.create_vpnservice()
|
rsrc = self.create_vpnservice()
|
||||||
neutronclient.Client.show_vpnservice('vpn123').MultipleTimes(
|
neutronclient.Client.show_vpnservice('vpn123').MultipleTimes(
|
||||||
@ -245,7 +239,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
self.assertEqual('sub123', rsrc.FnGetAtt('subnet_id'))
|
self.assertEqual('sub123', rsrc.FnGetAtt('subnet_id'))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute_failed(self):
|
def test_attribute_failed(self):
|
||||||
rsrc = self.create_vpnservice()
|
rsrc = self.create_vpnservice()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -258,7 +251,6 @@ class VPNServiceTest(HeatTestCase):
|
|||||||
str(error))
|
str(error))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
rsrc = self.create_vpnservice()
|
rsrc = self.create_vpnservice()
|
||||||
neutronclient.Client.update_vpnservice(
|
neutronclient.Client.update_vpnservice(
|
||||||
@ -321,7 +313,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
snippet['Resources']['IPsecSiteConnection'],
|
snippet['Resources']['IPsecSiteConnection'],
|
||||||
self.stack)
|
self.stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create(self):
|
def test_create(self):
|
||||||
rsrc = self.create_ipsec_site_connection()
|
rsrc = self.create_ipsec_site_connection()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -329,7 +320,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_failed(self):
|
def test_create_failed(self):
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
fakes.FakeKeystoneClient())
|
fakes.FakeKeystoneClient())
|
||||||
@ -351,7 +341,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
neutronclient.Client.delete_ipsec_site_connection('con123')
|
neutronclient.Client.delete_ipsec_site_connection('con123')
|
||||||
neutronclient.Client.show_ipsec_site_connection('con123').AndRaise(
|
neutronclient.Client.show_ipsec_site_connection('con123').AndRaise(
|
||||||
@ -363,7 +352,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_already_gone(self):
|
def test_delete_already_gone(self):
|
||||||
neutronclient.Client.delete_ipsec_site_connection('con123').AndRaise(
|
neutronclient.Client.delete_ipsec_site_connection('con123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=404))
|
vpnservice.NeutronClientException(status_code=404))
|
||||||
@ -374,7 +362,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_failed(self):
|
def test_delete_failed(self):
|
||||||
neutronclient.Client.delete_ipsec_site_connection('con123').AndRaise(
|
neutronclient.Client.delete_ipsec_site_connection('con123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=400))
|
vpnservice.NeutronClientException(status_code=400))
|
||||||
@ -389,7 +376,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute(self):
|
def test_attribute(self):
|
||||||
rsrc = self.create_ipsec_site_connection()
|
rsrc = self.create_ipsec_site_connection()
|
||||||
neutronclient.Client.show_ipsec_site_connection(
|
neutronclient.Client.show_ipsec_site_connection(
|
||||||
@ -413,7 +399,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
self.assertEqual('vpn123', rsrc.FnGetAtt('vpnservice_id'))
|
self.assertEqual('vpn123', rsrc.FnGetAtt('vpnservice_id'))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute_failed(self):
|
def test_attribute_failed(self):
|
||||||
rsrc = self.create_ipsec_site_connection()
|
rsrc = self.create_ipsec_site_connection()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -426,7 +411,6 @@ class IPsecSiteConnectionTest(HeatTestCase):
|
|||||||
str(error))
|
str(error))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
rsrc = self.create_ipsec_site_connection()
|
rsrc = self.create_ipsec_site_connection()
|
||||||
neutronclient.Client.update_ipsec_site_connection(
|
neutronclient.Client.update_ipsec_site_connection(
|
||||||
@ -478,7 +462,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
snippet['Resources']['IKEPolicy'],
|
snippet['Resources']['IKEPolicy'],
|
||||||
self.stack)
|
self.stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create(self):
|
def test_create(self):
|
||||||
rsrc = self.create_ikepolicy()
|
rsrc = self.create_ikepolicy()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -486,7 +469,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_failed(self):
|
def test_create_failed(self):
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
fakes.FakeKeystoneClient())
|
fakes.FakeKeystoneClient())
|
||||||
@ -508,7 +490,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
neutronclient.Client.delete_ikepolicy('ike123')
|
neutronclient.Client.delete_ikepolicy('ike123')
|
||||||
neutronclient.Client.show_ikepolicy('ike123').AndRaise(
|
neutronclient.Client.show_ikepolicy('ike123').AndRaise(
|
||||||
@ -520,7 +501,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_already_gone(self):
|
def test_delete_already_gone(self):
|
||||||
neutronclient.Client.delete_ikepolicy('ike123').AndRaise(
|
neutronclient.Client.delete_ikepolicy('ike123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=404))
|
vpnservice.NeutronClientException(status_code=404))
|
||||||
@ -531,7 +511,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_failed(self):
|
def test_delete_failed(self):
|
||||||
neutronclient.Client.delete_ikepolicy('ike123').AndRaise(
|
neutronclient.Client.delete_ikepolicy('ike123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=400))
|
vpnservice.NeutronClientException(status_code=400))
|
||||||
@ -546,7 +525,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute(self):
|
def test_attribute(self):
|
||||||
rsrc = self.create_ikepolicy()
|
rsrc = self.create_ikepolicy()
|
||||||
neutronclient.Client.show_ikepolicy(
|
neutronclient.Client.show_ikepolicy(
|
||||||
@ -564,7 +542,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual('v1', rsrc.FnGetAtt('ike_version'))
|
self.assertEqual('v1', rsrc.FnGetAtt('ike_version'))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute_failed(self):
|
def test_attribute_failed(self):
|
||||||
rsrc = self.create_ikepolicy()
|
rsrc = self.create_ikepolicy()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -577,7 +554,6 @@ class IKEPolicyTest(HeatTestCase):
|
|||||||
str(error))
|
str(error))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
rsrc = self.create_ikepolicy()
|
rsrc = self.create_ikepolicy()
|
||||||
neutronclient.Client.update_ikepolicy('ike123',
|
neutronclient.Client.update_ikepolicy('ike123',
|
||||||
@ -630,7 +606,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
snippet['Resources']['IPsecPolicy'],
|
snippet['Resources']['IPsecPolicy'],
|
||||||
self.stack)
|
self.stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create(self):
|
def test_create(self):
|
||||||
rsrc = self.create_ipsecpolicy()
|
rsrc = self.create_ipsecpolicy()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -638,7 +613,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_failed(self):
|
def test_create_failed(self):
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
fakes.FakeKeystoneClient())
|
fakes.FakeKeystoneClient())
|
||||||
@ -660,7 +634,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
neutronclient.Client.delete_ipsecpolicy('ips123')
|
neutronclient.Client.delete_ipsecpolicy('ips123')
|
||||||
neutronclient.Client.show_ipsecpolicy('ips123').AndRaise(
|
neutronclient.Client.show_ipsecpolicy('ips123').AndRaise(
|
||||||
@ -672,7 +645,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_already_gone(self):
|
def test_delete_already_gone(self):
|
||||||
neutronclient.Client.delete_ipsecpolicy('ips123').AndRaise(
|
neutronclient.Client.delete_ipsecpolicy('ips123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=404))
|
vpnservice.NeutronClientException(status_code=404))
|
||||||
@ -683,7 +655,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.COMPLETE), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_failed(self):
|
def test_delete_failed(self):
|
||||||
neutronclient.Client.delete_ipsecpolicy('ips123').AndRaise(
|
neutronclient.Client.delete_ipsecpolicy('ips123').AndRaise(
|
||||||
vpnservice.NeutronClientException(status_code=400))
|
vpnservice.NeutronClientException(status_code=400))
|
||||||
@ -698,7 +669,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
self.assertEqual((rsrc.DELETE, rsrc.FAILED), rsrc.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute(self):
|
def test_attribute(self):
|
||||||
rsrc = self.create_ipsecpolicy()
|
rsrc = self.create_ipsecpolicy()
|
||||||
neutronclient.Client.show_ipsecpolicy(
|
neutronclient.Client.show_ipsecpolicy(
|
||||||
@ -716,7 +686,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
self.assertEqual('group5', rsrc.FnGetAtt('pfs'))
|
self.assertEqual('group5', rsrc.FnGetAtt('pfs'))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_attribute_failed(self):
|
def test_attribute_failed(self):
|
||||||
rsrc = self.create_ipsecpolicy()
|
rsrc = self.create_ipsecpolicy()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -729,7 +698,6 @@ class IPsecPolicyTest(HeatTestCase):
|
|||||||
str(error))
|
str(error))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
rsrc = self.create_ipsecpolicy()
|
rsrc = self.create_ipsecpolicy()
|
||||||
neutronclient.Client.update_ipsecpolicy(
|
neutronclient.Client.update_ipsecpolicy(
|
||||||
|
@ -109,7 +109,6 @@ class NotificationTest(common.HeatTestCase):
|
|||||||
'stack_name': self.stack_name,
|
'stack_name': self.stack_name,
|
||||||
'state': '%s_COMPLETE' % action.upper()})]
|
'state': '%s_COMPLETE' % action.upper()})]
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_stack(self):
|
def test_create_stack(self):
|
||||||
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
||||||
as mock_notify:
|
as mock_notify:
|
||||||
@ -120,7 +119,6 @@ class NotificationTest(common.HeatTestCase):
|
|||||||
self.assertEqual(self.expected['create'],
|
self.assertEqual(self.expected['create'],
|
||||||
mock_notify.call_args_list)
|
mock_notify.call_args_list)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_and_suspend_stack(self):
|
def test_create_and_suspend_stack(self):
|
||||||
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
||||||
as mock_notify:
|
as mock_notify:
|
||||||
@ -137,7 +135,6 @@ class NotificationTest(common.HeatTestCase):
|
|||||||
expected = self.expected['create'] + self.expected['suspend']
|
expected = self.expected['create'] + self.expected['suspend']
|
||||||
self.assertEqual(expected, mock_notify.call_args_list)
|
self.assertEqual(expected, mock_notify.call_args_list)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_and_delete_stack(self):
|
def test_create_and_delete_stack(self):
|
||||||
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
||||||
as mock_notify:
|
as mock_notify:
|
||||||
@ -271,7 +268,6 @@ class ScaleNotificationTest(common.HeatTestCase):
|
|||||||
|
|
||||||
return expected
|
return expected
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_scale_success(self):
|
def test_scale_success(self):
|
||||||
with mock.patch('heat.engine.notification.stack.send'):
|
with mock.patch('heat.engine.notification.stack.send'):
|
||||||
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
||||||
@ -297,7 +293,6 @@ class ScaleNotificationTest(common.HeatTestCase):
|
|||||||
self.assertEqual(1, len(group.get_instance_names()))
|
self.assertEqual(1, len(group.get_instance_names()))
|
||||||
mock_notify.assert_has_calls(expected)
|
mock_notify.assert_has_calls(expected)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_scaleup_failure(self):
|
def test_scaleup_failure(self):
|
||||||
with mock.patch('heat.engine.notification.stack.send'):
|
with mock.patch('heat.engine.notification.stack.send'):
|
||||||
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
with mock.patch('heat.openstack.common.notifier.api.notify') \
|
||||||
|
@ -983,7 +983,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.store()
|
self.stack.store()
|
||||||
self.stack.create()
|
self.stack.create()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_total_resources_nested(self):
|
def test_total_resources_nested(self):
|
||||||
self._setup_nested('zyzzyx')
|
self._setup_nested('zyzzyx')
|
||||||
self.assertEqual(4, self.stack.total_resources())
|
self.assertEqual(4, self.stack.total_resources())
|
||||||
@ -994,7 +993,6 @@ class StackTest(HeatTestCase):
|
|||||||
4,
|
4,
|
||||||
self.stack['A'].nested().root_stack.total_resources())
|
self.stack['A'].nested().root_stack.total_resources())
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_root_stack(self):
|
def test_root_stack(self):
|
||||||
self._setup_nested('toor')
|
self._setup_nested('toor')
|
||||||
self.assertEqual(self.stack, self.stack.root_stack)
|
self.assertEqual(self.stack, self.stack.root_stack)
|
||||||
@ -1002,7 +1000,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.stack, self.stack['A'].nested().root_stack)
|
self.stack, self.stack['A'].nested().root_stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_parent_resource(self):
|
def test_load_parent_resource(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'load_parent_resource',
|
self.stack = parser.Stack(self.ctx, 'load_parent_resource',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1036,7 +1033,6 @@ class StackTest(HeatTestCase):
|
|||||||
|
|
||||||
# Note tests creating a stack should be decorated with @stack_delete_after
|
# Note tests creating a stack should be decorated with @stack_delete_after
|
||||||
# to ensure the self.stack is properly cleaned up
|
# to ensure the self.stack is properly cleaned up
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_identifier(self):
|
def test_identifier(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'identifier_test',
|
self.stack = parser.Stack(self.ctx, 'identifier_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1047,7 +1043,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertTrue(identifier.stack_id)
|
self.assertTrue(identifier.stack_id)
|
||||||
self.assertFalse(identifier.path)
|
self.assertFalse(identifier.path)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_stack_abandon_data(self):
|
def test_get_stack_abandon_data(self):
|
||||||
tpl = {'Resources':
|
tpl = {'Resources':
|
||||||
{'A': {'Type': 'GenericResourceType'},
|
{'A': {'Type': 'GenericResourceType'},
|
||||||
@ -1069,7 +1064,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertIsNone(info['status'])
|
self.assertIsNone(info['status'])
|
||||||
self.assertEqual(tpl, info['template'])
|
self.assertEqual(tpl, info['template'])
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_set_param_id(self):
|
def test_set_param_id(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'param_arn_test',
|
self.stack = parser.Stack(self.ctx, 'param_arn_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1085,7 +1079,6 @@ class StackTest(HeatTestCase):
|
|||||||
identifier.arn())
|
identifier.arn())
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_set_param_id_update(self):
|
def test_set_param_id_update(self):
|
||||||
tmpl = {'Resources': {
|
tmpl = {'Resources': {
|
||||||
'AResource': {'Type': 'ResourceWithPropsType',
|
'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
@ -1116,7 +1109,6 @@ class StackTest(HeatTestCase):
|
|||||||
|
|
||||||
self.assertEqual(stack_arn, self.stack['AResource'].metadata['Bar'])
|
self.assertEqual(stack_arn, self.stack['AResource'].metadata['Bar'])
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_param_id(self):
|
def test_load_param_id(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'param_load_arn_test',
|
self.stack = parser.Stack(self.ctx, 'param_load_arn_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1128,7 +1120,6 @@ class StackTest(HeatTestCase):
|
|||||||
newstack = parser.Stack.load(self.ctx, stack_id=self.stack.id)
|
newstack = parser.Stack.load(self.ctx, stack_id=self.stack.id)
|
||||||
self.assertEqual(identifier.arn(), newstack.parameters['AWS::StackId'])
|
self.assertEqual(identifier.arn(), newstack.parameters['AWS::StackId'])
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_reads_tenant_id(self):
|
def test_load_reads_tenant_id(self):
|
||||||
self.ctx.tenant_id = 'foobar'
|
self.ctx.tenant_id = 'foobar'
|
||||||
self.stack = parser.Stack(self.ctx, 'stack_name', parser.Template({}))
|
self.stack = parser.Stack(self.ctx, 'stack_name', parser.Template({}))
|
||||||
@ -1138,7 +1129,6 @@ class StackTest(HeatTestCase):
|
|||||||
stack = parser.Stack.load(self.ctx, stack_id=stack_id)
|
stack = parser.Stack.load(self.ctx, stack_id=stack_id)
|
||||||
self.assertEqual('foobar', stack.tenant_id)
|
self.assertEqual('foobar', stack.tenant_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_created_time(self):
|
def test_created_time(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'creation_time_test',
|
self.stack = parser.Stack(self.ctx, 'creation_time_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1146,7 +1136,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.store()
|
self.stack.store()
|
||||||
self.assertIsNotNone(self.stack.created_time)
|
self.assertIsNotNone(self.stack.created_time)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_updated_time(self):
|
def test_updated_time(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'updated_time_test',
|
self.stack = parser.Stack(self.ctx, 'updated_time_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1160,7 +1149,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.update(newstack)
|
self.stack.update(newstack)
|
||||||
self.assertIsNotNone(self.stack.updated_time)
|
self.assertIsNotNone(self.stack.updated_time)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_access_policy_update(self):
|
def test_access_policy_update(self):
|
||||||
tmpl = {'Resources': {
|
tmpl = {'Resources': {
|
||||||
'R1': {'Type': 'GenericResourceType'},
|
'R1': {'Type': 'GenericResourceType'},
|
||||||
@ -1195,7 +1183,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.UPDATE, parser.Stack.COMPLETE),
|
self.assertEqual((parser.Stack.UPDATE, parser.Stack.COMPLETE),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'delete_test',
|
self.stack = parser.Stack(self.ctx, 'delete_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1211,7 +1198,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.DELETE, parser.Stack.COMPLETE),
|
self.assertEqual((parser.Stack.DELETE, parser.Stack.COMPLETE),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_user_creds(self):
|
def test_delete_user_creds(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'delete_test',
|
self.stack = parser.Stack(self.ctx, 'delete_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1235,7 +1221,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.DELETE, parser.Stack.COMPLETE),
|
self.assertEqual((parser.Stack.DELETE, parser.Stack.COMPLETE),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_trust(self):
|
def test_delete_trust(self):
|
||||||
cfg.CONF.set_override('deferred_auth_method', 'trusts')
|
cfg.CONF.set_override('deferred_auth_method', 'trusts')
|
||||||
|
|
||||||
@ -1258,7 +1243,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.DELETE, parser.Stack.COMPLETE),
|
self.assertEqual((parser.Stack.DELETE, parser.Stack.COMPLETE),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_trust_backup(self):
|
def test_delete_trust_backup(self):
|
||||||
cfg.CONF.set_override('deferred_auth_method', 'trusts')
|
cfg.CONF.set_override('deferred_auth_method', 'trusts')
|
||||||
|
|
||||||
@ -1285,7 +1269,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual(self.stack.state,
|
self.assertEqual(self.stack.state,
|
||||||
(parser.Stack.DELETE, parser.Stack.COMPLETE))
|
(parser.Stack.DELETE, parser.Stack.COMPLETE))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_trust_fail(self):
|
def test_delete_trust_fail(self):
|
||||||
cfg.CONF.set_override('deferred_auth_method', 'trusts')
|
cfg.CONF.set_override('deferred_auth_method', 'trusts')
|
||||||
|
|
||||||
@ -1313,7 +1296,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.assertIn('Error deleting trust', self.stack.status_reason)
|
self.assertIn('Error deleting trust', self.stack.status_reason)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_suspend_resume(self):
|
def test_suspend_resume(self):
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
@ -1336,7 +1318,6 @@ class StackTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_suspend_stack_suspended_ok(self):
|
def test_suspend_stack_suspended_ok(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
self.stack = parser.Stack(self.ctx, 'suspend_test',
|
self.stack = parser.Stack(self.ctx, 'suspend_test',
|
||||||
@ -1359,7 +1340,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resume_stack_resumeed_ok(self):
|
def test_resume_stack_resumeed_ok(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
self.stack = parser.Stack(self.ctx, 'suspend_test',
|
self.stack = parser.Stack(self.ctx, 'suspend_test',
|
||||||
@ -1386,7 +1366,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_suspend_fail(self):
|
def test_suspend_fail(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_suspend')
|
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_suspend')
|
||||||
@ -1410,7 +1389,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.status_reason)
|
self.stack.status_reason)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resume_fail(self):
|
def test_resume_fail(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_resume')
|
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_resume')
|
||||||
@ -1438,7 +1416,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.status_reason)
|
self.stack.status_reason)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_suspend_timeout(self):
|
def test_suspend_timeout(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_suspend')
|
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_suspend')
|
||||||
@ -1461,7 +1438,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('Suspend timed out', self.stack.status_reason)
|
self.assertEqual('Suspend timed out', self.stack.status_reason)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resume_timeout(self):
|
def test_resume_timeout(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_resume')
|
self.m.StubOutWithMock(generic_rsrc.GenericResource, 'handle_resume')
|
||||||
@ -1490,7 +1466,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('Resume timed out', self.stack.status_reason)
|
self.assertEqual('Resume timed out', self.stack.status_reason)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_rollback(self):
|
def test_delete_rollback(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'delete_rollback_test',
|
self.stack = parser.Stack(self.ctx, 'delete_rollback_test',
|
||||||
parser.Template({}), disable_rollback=False)
|
parser.Template({}), disable_rollback=False)
|
||||||
@ -1506,7 +1481,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.ROLLBACK, parser.Stack.COMPLETE),
|
self.assertEqual((parser.Stack.ROLLBACK, parser.Stack.COMPLETE),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_badaction(self):
|
def test_delete_badaction(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'delete_badaction_test',
|
self.stack = parser.Stack(self.ctx, 'delete_badaction_test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
@ -1522,7 +1496,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.DELETE, parser.Stack.FAILED),
|
self.assertEqual((parser.Stack.DELETE, parser.Stack.FAILED),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_adopt_stack(self):
|
def test_adopt_stack(self):
|
||||||
adopt_data = '''{
|
adopt_data = '''{
|
||||||
"action": "CREATE",
|
"action": "CREATE",
|
||||||
@ -1562,7 +1535,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.assertEqual('AResource', self.stack.output('TestOutput'))
|
self.assertEqual('AResource', self.stack.output('TestOutput'))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_adopt_stack_fails(self):
|
def test_adopt_stack_fails(self):
|
||||||
adopt_data = '''{
|
adopt_data = '''{
|
||||||
"action": "CREATE",
|
"action": "CREATE",
|
||||||
@ -1588,7 +1560,6 @@ class StackTest(HeatTestCase):
|
|||||||
' provided.')
|
' provided.')
|
||||||
self.assertEqual(expected, self.stack.status_reason)
|
self.assertEqual(expected, self.stack.status_reason)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_adopt_stack_rollback(self):
|
def test_adopt_stack_rollback(self):
|
||||||
adopt_data = '''{
|
adopt_data = '''{
|
||||||
"name": "my-test-stack-name",
|
"name": "my-test-stack-name",
|
||||||
@ -1611,7 +1582,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((self.stack.ROLLBACK, self.stack.COMPLETE),
|
self.assertEqual((self.stack.ROLLBACK, self.stack.COMPLETE),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_badstate(self):
|
def test_update_badstate(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'test_stack', parser.Template({}),
|
self.stack = parser.Stack(self.ctx, 'test_stack', parser.Template({}),
|
||||||
action=parser.Stack.CREATE,
|
action=parser.Stack.CREATE,
|
||||||
@ -1623,7 +1593,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual((parser.Stack.UPDATE, parser.Stack.FAILED),
|
self.assertEqual((parser.Stack.UPDATE, parser.Stack.FAILED),
|
||||||
self.stack.state)
|
self.stack.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_by_refid(self):
|
def test_resource_by_refid(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
|
|
||||||
@ -1656,7 +1625,6 @@ class StackTest(HeatTestCase):
|
|||||||
finally:
|
finally:
|
||||||
rsrc.state_set(rsrc.CREATE, rsrc.COMPLETE)
|
rsrc.state_set(rsrc.CREATE, rsrc.COMPLETE)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_add(self):
|
def test_update_add(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
|
|
||||||
@ -1677,7 +1645,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.assertIn('BResource', self.stack)
|
self.assertIn('BResource', self.stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_remove(self):
|
def test_update_remove(self):
|
||||||
tmpl = {'Resources': {
|
tmpl = {'Resources': {
|
||||||
'AResource': {'Type': 'GenericResourceType'},
|
'AResource': {'Type': 'GenericResourceType'},
|
||||||
@ -1699,7 +1666,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.assertNotIn('BResource', self.stack)
|
self.assertNotIn('BResource', self.stack)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_description(self):
|
def test_update_description(self):
|
||||||
tmpl = {'Description': 'ATemplate',
|
tmpl = {'Description': 'ATemplate',
|
||||||
'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
@ -1722,7 +1688,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('BTemplate',
|
self.assertEqual('BTemplate',
|
||||||
self.stack.t[self.stack.t.DESCRIPTION])
|
self.stack.t[self.stack.t.DESCRIPTION])
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_timeout(self):
|
def test_update_timeout(self):
|
||||||
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
tmpl = {'HeatTemplateFormatVersion': '2012-12-12',
|
||||||
'Description': 'ATemplate',
|
'Description': 'ATemplate',
|
||||||
@ -1746,7 +1711,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.assertEqual(30, self.stack.timeout_mins)
|
self.assertEqual(30, self.stack.timeout_mins)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_disable_rollback(self):
|
def test_update_disable_rollback(self):
|
||||||
tmpl = {'Description': 'ATemplate',
|
tmpl = {'Description': 'ATemplate',
|
||||||
'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
@ -1770,7 +1734,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.assertEqual(True, self.stack.disable_rollback)
|
self.assertEqual(True, self.stack.disable_rollback)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_modify_ok_replace(self):
|
def test_update_modify_ok_replace(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
'Properties': {'Foo': 'abc'}}}}
|
'Properties': {'Foo': 'abc'}}}}
|
||||||
@ -1799,7 +1762,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('xyz', self.stack['AResource'].properties['Foo'])
|
self.assertEqual('xyz', self.stack['AResource'].properties['Foo'])
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_modify_param_ok_replace(self):
|
def test_update_modify_param_ok_replace(self):
|
||||||
tmpl = {
|
tmpl = {
|
||||||
'HeatTemplateFormatVersion': '2012-12-12',
|
'HeatTemplateFormatVersion': '2012-12-12',
|
||||||
@ -1846,7 +1808,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('xyz', self.stack['AResource'].properties['Foo'])
|
self.assertEqual('xyz', self.stack['AResource'].properties['Foo'])
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_modify_update_failed(self):
|
def test_update_modify_update_failed(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
'Properties': {'Foo': 'abc'}}}}
|
'Properties': {'Foo': 'abc'}}}}
|
||||||
@ -1883,7 +1844,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_modify_replace_failed_delete(self):
|
def test_update_modify_replace_failed_delete(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
'Properties': {'Foo': 'abc'}}}}
|
'Properties': {'Foo': 'abc'}}}}
|
||||||
@ -1918,7 +1878,6 @@ class StackTest(HeatTestCase):
|
|||||||
# Unset here so destroy() is not stubbed for stack.delete cleanup
|
# Unset here so destroy() is not stubbed for stack.delete cleanup
|
||||||
self.m.UnsetStubs()
|
self.m.UnsetStubs()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_modify_replace_failed_create(self):
|
def test_update_modify_replace_failed_create(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
'Properties': {'Foo': 'abc'}}}}
|
'Properties': {'Foo': 'abc'}}}}
|
||||||
@ -1951,7 +1910,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_add_failed_create(self):
|
def test_update_add_failed_create(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
|
|
||||||
@ -1984,7 +1942,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertIn('BResource', re_stack)
|
self.assertIn('BResource', re_stack)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_rollback(self):
|
def test_update_rollback(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
'Properties': {'Foo': 'abc'}}}}
|
'Properties': {'Foo': 'abc'}}}}
|
||||||
@ -2020,7 +1977,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('abc', self.stack['AResource'].properties['Foo'])
|
self.assertEqual('abc', self.stack['AResource'].properties['Foo'])
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_rollback_fail(self):
|
def test_update_rollback_fail(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
tmpl = {'Resources': {'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
'Properties': {'Foo': 'abc'}}}}
|
'Properties': {'Foo': 'abc'}}}}
|
||||||
@ -2057,7 +2013,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_rollback_add(self):
|
def test_update_rollback_add(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'}}}
|
||||||
|
|
||||||
@ -2089,7 +2044,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertNotIn('BResource', self.stack)
|
self.assertNotIn('BResource', self.stack)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_rollback_remove(self):
|
def test_update_rollback_remove(self):
|
||||||
tmpl = {'Resources': {
|
tmpl = {'Resources': {
|
||||||
'AResource': {'Type': 'GenericResourceType'},
|
'AResource': {'Type': 'GenericResourceType'},
|
||||||
@ -2123,7 +2077,6 @@ class StackTest(HeatTestCase):
|
|||||||
# Unset here so delete() is not stubbed for stack.delete cleanup
|
# Unset here so delete() is not stubbed for stack.delete cleanup
|
||||||
self.m.UnsetStubs()
|
self.m.UnsetStubs()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_rollback_replace(self):
|
def test_update_rollback_replace(self):
|
||||||
tmpl = {'Resources': {
|
tmpl = {'Resources': {
|
||||||
'AResource': {'Type': 'ResourceWithPropsType',
|
'AResource': {'Type': 'ResourceWithPropsType',
|
||||||
@ -2158,7 +2111,6 @@ class StackTest(HeatTestCase):
|
|||||||
# Unset here so delete() is not stubbed for stack.delete cleanup
|
# Unset here so delete() is not stubbed for stack.delete cleanup
|
||||||
self.m.UnsetStubs()
|
self.m.UnsetStubs()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_replace_by_reference(self):
|
def test_update_replace_by_reference(self):
|
||||||
'''
|
'''
|
||||||
assertion:
|
assertion:
|
||||||
@ -2212,7 +2164,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual('inst-007', self.stack['BResource'].properties['Foo'])
|
self.assertEqual('inst-007', self.stack['BResource'].properties['Foo'])
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_with_new_resources_with_reference(self):
|
def test_update_with_new_resources_with_reference(self):
|
||||||
'''
|
'''
|
||||||
assertion:
|
assertion:
|
||||||
@ -2264,7 +2215,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual(3, len(self.stack.resources))
|
self.assertEqual(3, len(self.stack.resources))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_by_reference_and_rollback_1(self):
|
def test_update_by_reference_and_rollback_1(self):
|
||||||
'''
|
'''
|
||||||
assertion:
|
assertion:
|
||||||
@ -2325,7 +2275,6 @@ class StackTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_by_reference_and_rollback_2(self):
|
def test_update_by_reference_and_rollback_2(self):
|
||||||
'''
|
'''
|
||||||
assertion:
|
assertion:
|
||||||
@ -2395,7 +2344,6 @@ class StackTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_replace_parameters(self):
|
def test_update_replace_parameters(self):
|
||||||
'''
|
'''
|
||||||
assertion:
|
assertion:
|
||||||
@ -2553,7 +2501,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertRaises(ValueError, parser.Stack, self.ctx, '#test',
|
self.assertRaises(ValueError, parser.Stack, self.ctx, '#test',
|
||||||
parser.Template({}))
|
parser.Template({}))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_state_get_att(self):
|
def test_resource_state_get_att(self):
|
||||||
tmpl = {
|
tmpl = {
|
||||||
'Resources': {'AResource': {'Type': 'GenericResourceType'}},
|
'Resources': {'AResource': {'Type': 'GenericResourceType'}},
|
||||||
@ -2593,7 +2540,6 @@ class StackTest(HeatTestCase):
|
|||||||
rsrc.state_set(action, status)
|
rsrc.state_set(action, status)
|
||||||
self.assertIsNone(self.stack.output('TestOutput'))
|
self.assertIsNone(self.stack.output('TestOutput'))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_required_by(self):
|
def test_resource_required_by(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'},
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'},
|
||||||
'BResource': {'Type': 'GenericResourceType',
|
'BResource': {'Type': 'GenericResourceType',
|
||||||
@ -2619,7 +2565,6 @@ class StackTest(HeatTestCase):
|
|||||||
for r in ['CResource', 'DResource']:
|
for r in ['CResource', 'DResource']:
|
||||||
self.assertIn(r, required_by)
|
self.assertIn(r, required_by)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_multi_required_by(self):
|
def test_resource_multi_required_by(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'},
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'},
|
||||||
'BResource': {'Type': 'GenericResourceType'},
|
'BResource': {'Type': 'GenericResourceType'},
|
||||||
@ -2640,7 +2585,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertEqual(['DResource'],
|
self.assertEqual(['DResource'],
|
||||||
self.stack[r].required_by())
|
self.stack[r].required_by())
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_store_saves_owner(self):
|
def test_store_saves_owner(self):
|
||||||
"""
|
"""
|
||||||
The owner_id attribute of Store is saved to the database when stored.
|
The owner_id attribute of Store is saved to the database when stored.
|
||||||
@ -2654,7 +2598,6 @@ class StackTest(HeatTestCase):
|
|||||||
db_stack = db_api.stack_get(self.ctx, stack_ownee.id)
|
db_stack = db_api.stack_get(self.ctx, stack_ownee.id)
|
||||||
self.assertEqual(self.stack.id, db_stack.owner_id)
|
self.assertEqual(self.stack.id, db_stack.owner_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_store_saves_creds(self):
|
def test_store_saves_creds(self):
|
||||||
"""
|
"""
|
||||||
A user_creds entry is created on first stack store
|
A user_creds entry is created on first stack store
|
||||||
@ -2679,7 +2622,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.store()
|
self.stack.store()
|
||||||
self.assertEqual(user_creds_id, db_stack.user_creds_id)
|
self.assertEqual(user_creds_id, db_stack.user_creds_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_store_saves_creds_trust(self):
|
def test_store_saves_creds_trust(self):
|
||||||
"""
|
"""
|
||||||
A user_creds entry is created on first stack store
|
A user_creds entry is created on first stack store
|
||||||
@ -2713,7 +2655,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.store()
|
self.stack.store()
|
||||||
self.assertEqual(user_creds_id, db_stack.user_creds_id)
|
self.assertEqual(user_creds_id, db_stack.user_creds_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_honors_owner(self):
|
def test_load_honors_owner(self):
|
||||||
"""
|
"""
|
||||||
Loading a stack from the database will set the owner_id of the
|
Loading a stack from the database will set the owner_id of the
|
||||||
@ -2729,7 +2670,6 @@ class StackTest(HeatTestCase):
|
|||||||
saved_stack = parser.Stack.load(self.ctx, stack_id=stack_ownee.id)
|
saved_stack = parser.Stack.load(self.ctx, stack_id=stack_ownee.id)
|
||||||
self.assertEqual(self.stack.id, saved_stack.owner_id)
|
self.assertEqual(self.stack.id, saved_stack.owner_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_requires_deferred_auth(self):
|
def test_requires_deferred_auth(self):
|
||||||
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'},
|
tmpl = {'Resources': {'AResource': {'Type': 'GenericResourceType'},
|
||||||
'BResource': {'Type': 'GenericResourceType'},
|
'BResource': {'Type': 'GenericResourceType'},
|
||||||
@ -2744,7 +2684,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack['CResource'].requires_deferred_auth = True
|
self.stack['CResource'].requires_deferred_auth = True
|
||||||
self.assertTrue(self.stack.requires_deferred_auth())
|
self.assertTrue(self.stack.requires_deferred_auth())
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_stack_user_project_id_default(self):
|
def test_stack_user_project_id_default(self):
|
||||||
self.stack = parser.Stack(self.ctx, 'user_project_none',
|
self.stack = parser.Stack(self.ctx, 'user_project_none',
|
||||||
template.Template({}))
|
template.Template({}))
|
||||||
@ -2753,7 +2692,6 @@ class StackTest(HeatTestCase):
|
|||||||
db_stack = db_api.stack_get(self.ctx, self.stack.id)
|
db_stack = db_api.stack_get(self.ctx, self.stack.id)
|
||||||
self.assertIsNone(db_stack.stack_user_project_id)
|
self.assertIsNone(db_stack.stack_user_project_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_stack_user_project_id_constructor(self):
|
def test_stack_user_project_id_constructor(self):
|
||||||
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
|
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
|
||||||
clients.OpenStackClients.keystone().AndReturn(FakeKeystoneClient())
|
clients.OpenStackClients.keystone().AndReturn(FakeKeystoneClient())
|
||||||
@ -2772,7 +2710,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.stack.state)
|
self.stack.state)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_stack_user_project_id_delete_fail(self):
|
def test_stack_user_project_id_delete_fail(self):
|
||||||
|
|
||||||
class FakeKeystoneClientFail(FakeKeystoneClient):
|
class FakeKeystoneClientFail(FakeKeystoneClient):
|
||||||
@ -2797,7 +2734,6 @@ class StackTest(HeatTestCase):
|
|||||||
self.assertIn('Error deleting project', self.stack.status_reason)
|
self.assertIn('Error deleting project', self.stack.status_reason)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_stack_user_project_id_setter(self):
|
def test_stack_user_project_id_setter(self):
|
||||||
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
|
self.m.StubOutWithMock(clients.OpenStackClients, 'keystone')
|
||||||
clients.OpenStackClients.keystone().AndReturn(FakeKeystoneClient())
|
clients.OpenStackClients.keystone().AndReturn(FakeKeystoneClient())
|
||||||
|
@ -687,7 +687,6 @@ Outputs:
|
|||||||
self.assertEqual((stack.CREATE, stack.COMPLETE), stack.state)
|
self.assertEqual((stack.CREATE, stack.COMPLETE), stack.state)
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_template_resource_update_template_schema(self):
|
def test_template_resource_update_template_schema(self):
|
||||||
stack = self.create_stack()
|
stack = self.create_stack()
|
||||||
self.stack = stack
|
self.stack = stack
|
||||||
|
@ -158,7 +158,6 @@ class ResourceGroupTest(common.HeatTestCase):
|
|||||||
resgrp = resource_group.ResourceGroup('test', snip, stack)
|
resgrp = resource_group.ResourceGroup('test', snip, stack)
|
||||||
self.assertIsNone(resgrp.validate())
|
self.assertIsNone(resgrp.validate())
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete(self):
|
def test_delete(self):
|
||||||
"""Test basic delete."""
|
"""Test basic delete."""
|
||||||
resg = self._create_dummy_stack()
|
resg = self._create_dummy_stack()
|
||||||
@ -167,7 +166,6 @@ class ResourceGroupTest(common.HeatTestCase):
|
|||||||
self.assertEqual((resg.DELETE, resg.COMPLETE), resg.nested().state)
|
self.assertEqual((resg.DELETE, resg.COMPLETE), resg.nested().state)
|
||||||
self.assertEqual((resg.DELETE, resg.COMPLETE), resg.state)
|
self.assertEqual((resg.DELETE, resg.COMPLETE), resg.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
"""Test basic update."""
|
"""Test basic update."""
|
||||||
resg = self._create_dummy_stack()
|
resg = self._create_dummy_stack()
|
||||||
@ -179,7 +177,6 @@ class ResourceGroupTest(common.HeatTestCase):
|
|||||||
self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.nested().state)
|
self.assertEqual((resg.UPDATE, resg.COMPLETE), resg.nested().state)
|
||||||
self.assertEqual(3, len(resg.nested()))
|
self.assertEqual(3, len(resg.nested()))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_aggregate_attribs(self):
|
def test_aggregate_attribs(self):
|
||||||
"""
|
"""
|
||||||
Test attribute aggregation and that we mimic the nested resource's
|
Test attribute aggregation and that we mimic the nested resource's
|
||||||
@ -190,7 +187,6 @@ class ResourceGroupTest(common.HeatTestCase):
|
|||||||
self.assertEqual(expected, resg.FnGetAtt('foo'))
|
self.assertEqual(expected, resg.FnGetAtt('foo'))
|
||||||
self.assertEqual(expected, resg.FnGetAtt('Foo'))
|
self.assertEqual(expected, resg.FnGetAtt('Foo'))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_aggregate_refs(self):
|
def test_aggregate_refs(self):
|
||||||
"""
|
"""
|
||||||
Test resource id aggregation
|
Test resource id aggregation
|
||||||
@ -199,7 +195,6 @@ class ResourceGroupTest(common.HeatTestCase):
|
|||||||
expected = ['ID-0', 'ID-1']
|
expected = ['ID-0', 'ID-1']
|
||||||
self.assertEqual(expected, resg.FnGetAtt("refs"))
|
self.assertEqual(expected, resg.FnGetAtt("refs"))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_index_refs(self):
|
def test_index_refs(self):
|
||||||
"""Tests getting ids of individual resources."""
|
"""Tests getting ids of individual resources."""
|
||||||
resg = self._create_dummy_stack()
|
resg = self._create_dummy_stack()
|
||||||
|
@ -164,7 +164,6 @@ Resources:
|
|||||||
self.assertEqual(ref_id, rsrc.FnGetRefId())
|
self.assertEqual(ref_id, rsrc.FnGetRefId())
|
||||||
self.assertEqual(metadata, dict(rsrc.metadata))
|
self.assertEqual(metadata, dict(rsrc.metadata))
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_nova(self):
|
def test_security_group_nova(self):
|
||||||
#create script
|
#create script
|
||||||
clients.OpenStackClients.nova('compute').AndReturn(self.fc)
|
clients.OpenStackClients.nova('compute').AndReturn(self.fc)
|
||||||
@ -266,7 +265,6 @@ Resources:
|
|||||||
stack.delete()
|
stack.delete()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_nova_bad_source_group(self):
|
def test_security_group_nova_bad_source_group(self):
|
||||||
#create script
|
#create script
|
||||||
clients.OpenStackClients.nova('compute').AndReturn(self.fc)
|
clients.OpenStackClients.nova('compute').AndReturn(self.fc)
|
||||||
@ -337,7 +335,6 @@ Resources:
|
|||||||
stack.delete()
|
stack.delete()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_nova_exception(self):
|
def test_security_group_nova_exception(self):
|
||||||
#create script
|
#create script
|
||||||
clients.OpenStackClients.nova('compute').AndReturn(self.fc)
|
clients.OpenStackClients.nova('compute').AndReturn(self.fc)
|
||||||
@ -467,7 +464,6 @@ Resources:
|
|||||||
sg = stack['the_sg']
|
sg = stack['the_sg']
|
||||||
self.assertRaises(exception.EgressRuleNotAllowed, sg.validate)
|
self.assertRaises(exception.EgressRuleNotAllowed, sg.validate)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_neutron(self):
|
def test_security_group_neutron(self):
|
||||||
#create script
|
#create script
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
@ -716,7 +712,6 @@ Resources:
|
|||||||
stack.delete()
|
stack.delete()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_security_group_neutron_exception(self):
|
def test_security_group_neutron_exception(self):
|
||||||
#create script
|
#create script
|
||||||
clients.OpenStackClients.keystone().AndReturn(
|
clients.OpenStackClients.keystone().AndReturn(
|
||||||
|
@ -88,7 +88,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_handle_create_fail_keypair_raise(self):
|
def test_handle_create_fail_keypair_raise(self):
|
||||||
self.stack = self.create_stack(stack_name='create_fail_keypair')
|
self.stack = self.create_stack(stack_name='create_fail_keypair')
|
||||||
|
|
||||||
@ -106,7 +105,6 @@ class SignalTest(HeatTestCase):
|
|||||||
self.assertIsNone(rsrc.resource_id)
|
self.assertIsNone(rsrc.resource_id)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resource_data(self):
|
def test_resource_data(self):
|
||||||
self.stack = self.create_stack(stack_name='resource_data_test',
|
self.stack = self.create_stack(stack_name='resource_data_test',
|
||||||
stub=False)
|
stub=False)
|
||||||
@ -134,7 +132,6 @@ class SignalTest(HeatTestCase):
|
|||||||
self.assertEqual(4, len(rs_data.keys()))
|
self.assertEqual(4, len(rs_data.keys()))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_user_id(self):
|
def test_get_user_id(self):
|
||||||
self.stack = self.create_stack(stack_name='resource_data_test',
|
self.stack = self.create_stack(stack_name='resource_data_test',
|
||||||
stub=False)
|
stub=False)
|
||||||
@ -164,7 +161,6 @@ class SignalTest(HeatTestCase):
|
|||||||
self.assertEqual('1234', rsrc._get_user_id())
|
self.assertEqual('1234', rsrc._get_user_id())
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_FnGetAtt_Alarm_Url(self):
|
def test_FnGetAtt_Alarm_Url(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
|
|
||||||
@ -191,7 +187,6 @@ class SignalTest(HeatTestCase):
|
|||||||
self.assertEqual(expected_url, rsrc.FnGetAtt('AlarmUrl'))
|
self.assertEqual(expected_url, rsrc.FnGetAtt('AlarmUrl'))
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_FnGetAtt_Alarm_Url_is_cached(self):
|
def test_FnGetAtt_Alarm_Url_is_cached(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
|
|
||||||
@ -206,7 +201,6 @@ class SignalTest(HeatTestCase):
|
|||||||
self.assertEqual(first_url, second_url)
|
self.assertEqual(first_url, second_url)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_FnGetAtt_delete(self):
|
def test_FnGetAtt_delete(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
|
|
||||||
@ -224,7 +218,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_delete_not_found(self):
|
def test_delete_not_found(self):
|
||||||
self.stack = self.create_stack(stack_name='test_delete_not_found',
|
self.stack = self.create_stack(stack_name='test_delete_not_found',
|
||||||
stub=False)
|
stub=False)
|
||||||
@ -248,7 +241,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_signal(self):
|
def test_signal(self):
|
||||||
test_d = {'Data': 'foo', 'Reason': 'bar',
|
test_d = {'Data': 'foo', 'Reason': 'bar',
|
||||||
'Status': 'SUCCESS', 'UniqueId': '123'}
|
'Status': 'SUCCESS', 'UniqueId': '123'}
|
||||||
@ -271,7 +263,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_signal_different_reason_types(self):
|
def test_signal_different_reason_types(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
self.stack.create()
|
self.stack.create()
|
||||||
@ -323,7 +314,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_signal_wrong_resource(self):
|
def test_signal_wrong_resource(self):
|
||||||
# assert that we get the correct exception when calling a
|
# assert that we get the correct exception when calling a
|
||||||
# resource.signal() that does not have a handle_signal()
|
# resource.signal() that does not have a handle_signal()
|
||||||
@ -341,7 +331,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_signal_reception_wrong_state(self):
|
def test_signal_reception_wrong_state(self):
|
||||||
# assert that we get the correct exception when calling a
|
# assert that we get the correct exception when calling a
|
||||||
# resource.signal() that is in having a destructive action.
|
# resource.signal() that is in having a destructive action.
|
||||||
@ -361,7 +350,6 @@ class SignalTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_signal_reception_failed_call(self):
|
def test_signal_reception_failed_call(self):
|
||||||
# assert that we get the correct exception from resource.signal()
|
# assert that we get the correct exception from resource.signal()
|
||||||
# when resource.handle_signal() raises an exception.
|
# when resource.handle_signal() raises an exception.
|
||||||
|
@ -192,7 +192,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.parent_resource._validate_nested_resources,
|
self.parent_resource._validate_nested_resources,
|
||||||
template)
|
template)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_with_template_ok(self):
|
def test_create_with_template_ok(self):
|
||||||
self.parent_resource.create_with_template(self.templ,
|
self.parent_resource.create_with_template(self.templ,
|
||||||
{"KeyName": "key"})
|
{"KeyName": "key"})
|
||||||
@ -205,7 +204,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.assertEqual(self.stack.id, self.parent_resource.resource_id)
|
self.assertEqual(self.stack.id, self.parent_resource.resource_id)
|
||||||
self.assertIsNone(self.stack.timeout_mins)
|
self.assertIsNone(self.stack.timeout_mins)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_with_template_timeout_mins(self):
|
def test_create_with_template_timeout_mins(self):
|
||||||
self.assertIsNone(self.parent_stack.timeout_mins)
|
self.assertIsNone(self.parent_stack.timeout_mins)
|
||||||
self.m.StubOutWithMock(self.parent_stack, 'timeout_mins')
|
self.m.StubOutWithMock(self.parent_stack, 'timeout_mins')
|
||||||
@ -217,7 +215,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.assertEqual(100, self.stack.timeout_mins)
|
self.assertEqual(100, self.stack.timeout_mins)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_adopt_with_template_ok(self):
|
def test_adopt_with_template_ok(self):
|
||||||
adopt_data = {
|
adopt_data = {
|
||||||
"resources": {
|
"resources": {
|
||||||
@ -240,7 +237,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.assertEqual(self.templ, self.stack.t.t)
|
self.assertEqual(self.templ, self.stack.t.t)
|
||||||
self.assertEqual(self.stack.id, self.parent_resource.resource_id)
|
self.assertEqual(self.stack.id, self.parent_resource.resource_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_prepare_abandon(self):
|
def test_prepare_abandon(self):
|
||||||
self.parent_resource.create_with_template(self.templ,
|
self.parent_resource.create_with_template(self.templ,
|
||||||
{"KeyName": "key"})
|
{"KeyName": "key"})
|
||||||
@ -256,7 +252,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.assertEqual(template_format.parse(param_template),
|
self.assertEqual(template_format.parse(param_template),
|
||||||
ret['template'])
|
ret['template'])
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_with_template_validates(self):
|
def test_create_with_template_validates(self):
|
||||||
"""
|
"""
|
||||||
Creating a stack with a template validates the created stack, so that
|
Creating a stack with a template validates the created stack, so that
|
||||||
@ -271,7 +266,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.parent_resource.create_with_template,
|
self.parent_resource.create_with_template,
|
||||||
template, {'WebServer': 'foo'})
|
template, {'WebServer': 'foo'})
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_with_template_validates(self):
|
def test_update_with_template_validates(self):
|
||||||
"""Updating a stack with a template validates the created stack."""
|
"""Updating a stack with a template validates the created stack."""
|
||||||
create_result = self.parent_resource.create_with_template(
|
create_result = self.parent_resource.create_with_template(
|
||||||
@ -286,7 +280,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.parent_resource.update_with_template,
|
self.parent_resource.update_with_template,
|
||||||
template, {'WebServer': 'foo'})
|
template, {'WebServer': 'foo'})
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_with_template_ok(self):
|
def test_update_with_template_ok(self):
|
||||||
"""
|
"""
|
||||||
The update_with_template method updates the nested stack with the
|
The update_with_template method updates the nested stack with the
|
||||||
@ -316,7 +309,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.parent_stack.context, self.stack.id)
|
self.parent_stack.context, self.stack.id)
|
||||||
self.assertEqual(self.parent_stack.id, saved_stack.owner_id)
|
self.assertEqual(self.parent_stack.id, saved_stack.owner_id)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_with_template_timeout_mins(self):
|
def test_update_with_template_timeout_mins(self):
|
||||||
self.assertIsNone(self.parent_stack.timeout_mins)
|
self.assertIsNone(self.parent_stack.timeout_mins)
|
||||||
self.m.StubOutWithMock(self.parent_stack, 'timeout_mins')
|
self.m.StubOutWithMock(self.parent_stack, 'timeout_mins')
|
||||||
@ -339,7 +331,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.assertEqual(200, self.stack.timeout_mins)
|
self.assertEqual(200, self.stack.timeout_mins)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_with_template_files(self):
|
def test_update_with_template_files(self):
|
||||||
create_result = self.parent_resource.create_with_template(
|
create_result = self.parent_resource.create_with_template(
|
||||||
self.simple_template, {})
|
self.simple_template, {})
|
||||||
@ -357,7 +348,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
|
|
||||||
self.assertEqual({"foo": "bar"}, self.stack.t.files)
|
self.assertEqual({"foo": "bar"}, self.stack.t.files)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_with_template_state_err(self):
|
def test_update_with_template_state_err(self):
|
||||||
"""
|
"""
|
||||||
update_with_template_state_err method should raise error when update
|
update_with_template_state_err method should raise error when update
|
||||||
@ -391,7 +381,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_nested_ok(self):
|
def test_load_nested_ok(self):
|
||||||
self.parent_resource.create_with_template(self.templ,
|
self.parent_resource.create_with_template(self.templ,
|
||||||
{"KeyName": "key"})
|
{"KeyName": "key"})
|
||||||
@ -408,7 +397,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
self.parent_resource.nested()
|
self.parent_resource.nested()
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_load_nested_non_exist(self):
|
def test_load_nested_non_exist(self):
|
||||||
self.parent_resource.create_with_template(self.templ,
|
self.parent_resource.create_with_template(self.templ,
|
||||||
{"KeyName": "key"})
|
{"KeyName": "key"})
|
||||||
@ -476,7 +464,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_create_complete_state_err(self):
|
def test_create_complete_state_err(self):
|
||||||
"""
|
"""
|
||||||
check_create_complete should raise error when create task is
|
check_create_complete should raise error when create task is
|
||||||
@ -525,7 +512,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
# Restore state_set to let clean up proceed
|
# Restore state_set to let clean up proceed
|
||||||
self.stack.state_set = st_set
|
self.stack.state_set = st_set
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_suspend_complete_state_err(self):
|
def test_suspend_complete_state_err(self):
|
||||||
"""
|
"""
|
||||||
check_suspend_complete should raise error when suspend task is
|
check_suspend_complete should raise error when suspend task is
|
||||||
@ -555,7 +541,6 @@ class StackResourceTest(HeatTestCase):
|
|||||||
# Restore state_set to let clean up proceed
|
# Restore state_set to let clean up proceed
|
||||||
self.stack.state_set = st_set
|
self.stack.state_set = st_set
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_resume_complete_state_err(self):
|
def test_resume_complete_state_err(self):
|
||||||
"""
|
"""
|
||||||
check_resume_complete should raise error when resume task is
|
check_resume_complete should raise error when resume task is
|
||||||
|
@ -138,7 +138,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
|
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_post_success_to_handle(self):
|
def test_post_success_to_handle(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
wc.WaitConditionHandle.get_status().AndReturn([])
|
wc.WaitConditionHandle.get_status().AndReturn([])
|
||||||
@ -158,7 +157,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
self.assertEqual('WaitHandle', r.name)
|
self.assertEqual('WaitHandle', r.name)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_post_failure_to_handle(self):
|
def test_post_failure_to_handle(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
wc.WaitConditionHandle.get_status().AndReturn([])
|
wc.WaitConditionHandle.get_status().AndReturn([])
|
||||||
@ -179,7 +177,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
self.assertEqual('WaitHandle', r.name)
|
self.assertEqual('WaitHandle', r.name)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_post_success_to_handle_count(self):
|
def test_post_success_to_handle_count(self):
|
||||||
self.stack = self.create_stack(template=test_template_wc_count)
|
self.stack = self.create_stack(template=test_template_wc_count)
|
||||||
wc.WaitConditionHandle.get_status().AndReturn([])
|
wc.WaitConditionHandle.get_status().AndReturn([])
|
||||||
@ -201,7 +198,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
self.assertEqual('WaitHandle', r.name)
|
self.assertEqual('WaitHandle', r.name)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_post_failure_to_handle_count(self):
|
def test_post_failure_to_handle_count(self):
|
||||||
self.stack = self.create_stack(template=test_template_wc_count)
|
self.stack = self.create_stack(template=test_template_wc_count)
|
||||||
wc.WaitConditionHandle.get_status().AndReturn([])
|
wc.WaitConditionHandle.get_status().AndReturn([])
|
||||||
@ -222,7 +218,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
self.assertEqual('WaitHandle', r.name)
|
self.assertEqual('WaitHandle', r.name)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_timeout(self):
|
def test_timeout(self):
|
||||||
st = time.time()
|
st = time.time()
|
||||||
|
|
||||||
@ -254,7 +249,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_FnGetAtt(self):
|
def test_FnGetAtt(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
wc.WaitConditionHandle.get_status().AndReturn(['SUCCESS'])
|
wc.WaitConditionHandle.get_status().AndReturn(['SUCCESS'])
|
||||||
@ -284,7 +278,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
self.assertEqual(u'{"123": "foo", "456": "dog"}', wc_att)
|
self.assertEqual(u'{"123": "foo", "456": "dog"}', wc_att)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_validate_handle_url_bad_stackid(self):
|
def test_validate_handle_url_bad_stackid(self):
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
@ -305,7 +298,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_validate_handle_url_bad_stackname(self):
|
def test_validate_handle_url_bad_stackname(self):
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
@ -324,7 +316,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_validate_handle_url_bad_tenant(self):
|
def test_validate_handle_url_bad_tenant(self):
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
@ -343,7 +334,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_validate_handle_url_bad_resource(self):
|
def test_validate_handle_url_bad_resource(self):
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
@ -362,7 +352,6 @@ class WaitConditionTest(HeatTestCase):
|
|||||||
|
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_validate_handle_url_bad_resource_type(self):
|
def test_validate_handle_url_bad_resource_type(self):
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
stack_id = 'STACKABCD1234'
|
stack_id = 'STACKABCD1234'
|
||||||
@ -423,7 +412,6 @@ class WaitConditionHandleTest(HeatTestCase):
|
|||||||
|
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_handle(self):
|
def test_handle(self):
|
||||||
stack_id = 'STACKABCD1234'
|
stack_id = 'STACKABCD1234'
|
||||||
stack_name = 'test_stack2'
|
stack_name = 'test_stack2'
|
||||||
@ -456,7 +444,6 @@ class WaitConditionHandleTest(HeatTestCase):
|
|||||||
rsrc.handle_update, {}, {}, {})
|
rsrc.handle_update, {}, {}, {})
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_metadata_update(self):
|
def test_metadata_update(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
rsrc = self.stack['WaitHandle']
|
rsrc = self.stack['WaitHandle']
|
||||||
@ -471,7 +458,6 @@ class WaitConditionHandleTest(HeatTestCase):
|
|||||||
self.assertEqual(handle_metadata, rsrc.metadata)
|
self.assertEqual(handle_metadata, rsrc.metadata)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_metadata_update_invalid(self):
|
def test_metadata_update_invalid(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
rsrc = self.stack['WaitHandle']
|
rsrc = self.stack['WaitHandle']
|
||||||
@ -515,7 +501,6 @@ class WaitConditionHandleTest(HeatTestCase):
|
|||||||
new_metadata=err_metadata)
|
new_metadata=err_metadata)
|
||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_status(self):
|
def test_get_status(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
rsrc = self.stack['WaitHandle']
|
rsrc = self.stack['WaitHandle']
|
||||||
@ -542,7 +527,6 @@ class WaitConditionHandleTest(HeatTestCase):
|
|||||||
wc.WaitConditionHandle.keystone().MultipleTimes().AndReturn(self.fc)
|
wc.WaitConditionHandle.keystone().MultipleTimes().AndReturn(self.fc)
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_get_status_reason(self):
|
def test_get_status_reason(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
rsrc = self.stack['WaitHandle']
|
rsrc = self.stack['WaitHandle']
|
||||||
@ -614,7 +598,6 @@ class WaitConditionUpdateTest(HeatTestCase):
|
|||||||
self.stack_id = stack_id
|
self.stack_id = stack_id
|
||||||
return stack
|
return stack
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update(self):
|
def test_update(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -639,7 +622,6 @@ class WaitConditionUpdateTest(HeatTestCase):
|
|||||||
|
|
||||||
self.assertEqual((rsrc.UPDATE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.UPDATE, rsrc.COMPLETE), rsrc.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_handle_update(self):
|
def test_handle_update(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -669,7 +651,6 @@ class WaitConditionUpdateTest(HeatTestCase):
|
|||||||
self.assertEqual(5, rsrc.properties['Count'])
|
self.assertEqual(5, rsrc.properties['Count'])
|
||||||
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
self.assertEqual((rsrc.CREATE, rsrc.COMPLETE), rsrc.state)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_handle_update_restored_from_db(self):
|
def test_handle_update_restored_from_db(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -709,7 +690,6 @@ class WaitConditionUpdateTest(HeatTestCase):
|
|||||||
metadata['UniqueId'] = metadata['UniqueId'] * 2
|
metadata['UniqueId'] = metadata['UniqueId'] * 2
|
||||||
rsrc.metadata_update(new_metadata=metadata)
|
rsrc.metadata_update(new_metadata=metadata)
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_handle_update_timeout(self):
|
def test_handle_update_timeout(self):
|
||||||
self.stack = self.create_stack()
|
self.stack = self.create_stack()
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
@ -752,7 +732,6 @@ class WaitConditionUpdateTest(HeatTestCase):
|
|||||||
self.m.VerifyAll()
|
self.m.VerifyAll()
|
||||||
self.m.UnsetStubs()
|
self.m.UnsetStubs()
|
||||||
|
|
||||||
@utils.stack_delete_after
|
|
||||||
def test_update_updatehandle(self):
|
def test_update_updatehandle(self):
|
||||||
self.stack = self.create_stack(test_template_update_waitcondition)
|
self.stack = self.create_stack(test_template_update_waitcondition)
|
||||||
self.m.ReplayAll()
|
self.m.ReplayAll()
|
||||||
|
@ -11,10 +11,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import functools
|
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
import sys
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
@ -47,32 +45,6 @@ def random_name():
|
|||||||
for x in range(10))
|
for x in range(10))
|
||||||
|
|
||||||
|
|
||||||
def stack_delete_after(test_fn):
|
|
||||||
"""
|
|
||||||
Decorator which calls test class self.stack.delete()
|
|
||||||
to ensure tests clean up their stacks regardless of test success/failure
|
|
||||||
"""
|
|
||||||
@functools.wraps(test_fn)
|
|
||||||
def wrapped_test(test_case, *args, **kwargs):
|
|
||||||
def delete_stack():
|
|
||||||
stack = getattr(test_case, 'stack', None)
|
|
||||||
if stack is not None and stack.id is not None:
|
|
||||||
stack.delete()
|
|
||||||
|
|
||||||
try:
|
|
||||||
test_fn(test_case, *args, **kwargs)
|
|
||||||
except:
|
|
||||||
exc_class, exc_val, exc_tb = sys.exc_info()
|
|
||||||
try:
|
|
||||||
delete_stack()
|
|
||||||
finally:
|
|
||||||
raise exc_class, exc_val, exc_tb
|
|
||||||
else:
|
|
||||||
delete_stack()
|
|
||||||
|
|
||||||
return wrapped_test
|
|
||||||
|
|
||||||
|
|
||||||
def setup_dummy_db():
|
def setup_dummy_db():
|
||||||
options.cfg.set_defaults(options.database_opts, sqlite_synchronous=False)
|
options.cfg.set_defaults(options.database_opts, sqlite_synchronous=False)
|
||||||
options.set_defaults(sql_connection="sqlite://", sqlite_db='heat.db')
|
options.set_defaults(sql_connection="sqlite://", sqlite_db='heat.db')
|
||||||
|
Loading…
Reference in New Issue
Block a user