From a5e156f44b9e8d1be65b0bd6cdb9a8990f531e86 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Sat, 19 Oct 2013 12:04:04 -1000 Subject: [PATCH] Add a test for TimeoutInMinutes accepting a str int The nested stack resource should accept a number as a string for TimeoutInMinutes. The actual fix has been fixed by: https://review.openstack.org/#/c/52564/ but this just proves it. Change-Id: I769a34eb536177b405a585158df383bbd3021cf9 Partial-bug: #1240903 --- heat/tests/test_nested_stack.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/heat/tests/test_nested_stack.py b/heat/tests/test_nested_stack.py index 92e21c94372..ac5080bdd9e 100644 --- a/heat/tests/test_nested_stack.py +++ b/heat/tests/test_nested_stack.py @@ -14,6 +14,7 @@ import copy +import json from oslo.config import cfg @@ -109,6 +110,20 @@ def test_nested_stack_create(self): self.m.VerifyAll() + def test_nested_stack_create_with_timeout(self): + urlfetch.get('https://server.test/the.template').MultipleTimes().\ + AndReturn(self.nested_template) + self.m.ReplayAll() + + timeout_template = template_format.parse( + copy.deepcopy(self.test_template)) + props = timeout_template['Resources']['the_nested']['Properties'] + props['TimeoutInMinutes'] = '50' + + stack = self.create_stack(json.dumps(timeout_template)) + self.assertEquals(stack.state, (stack.CREATE, stack.COMPLETE)) + self.m.VerifyAll() + def test_nested_stack_create_exceeds_resource_limit(self): cfg.CONF.set_override('max_resources_per_stack', 1) resource._register_class('GenericResource',