diff options
author | Takashi Kajinami <tkajinam@redhat.com> | 2022-07-31 01:28:02 +0900 |
---|---|---|
committer | Takashi Kajinami <tkajinam@redhat.com> | 2022-08-01 13:50:29 +0900 |
commit | d361aec71bd8f47945b0f98ec769422c5b2ddf07 (patch) | |
tree | 5c527e7295fa7c5c2bfd6c5cd80e5e94777a240a | |
parent | bb97ed77ae9625353059d0c79fed0a599803971d (diff) | |
download | heat-d361aec71bd8f47945b0f98ec769422c5b2ddf07.tar.gz |
Replace KeyPair resource by TestResource
... because we don't really intend to test the actual resource logic
but behavior of the engine logic to manage resources.
Depends-on: https://review.opendev.org/851669
Story: 2010201
Task: 45918
Change-Id: If651dbe34792c8ec72320a6d389a1bc1f2d23d13
-rw-r--r-- | heat_integrationtests/functional/test_template_resource.py | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/heat_integrationtests/functional/test_template_resource.py b/heat_integrationtests/functional/test_template_resource.py index f2a513b3a..34ecab119 100644 --- a/heat_integrationtests/functional/test_template_resource.py +++ b/heat_integrationtests/functional/test_template_resource.py @@ -15,7 +15,6 @@ import json from heatclient import exc as heat_exceptions import yaml -from heat_integrationtests.common import test from heat_integrationtests.functional import functional_base @@ -517,14 +516,13 @@ class TemplateResourceUpdateFailedTest(functional_base.FunctionalTestsBase): main_template = ''' HeatTemplateFormatVersion: '2012-12-12' Resources: - keypair: - Type: OS::Nova::KeyPair + test: + Type: OS::Heat::TestResource Properties: - name: replace-this - save_private_key: false + fail: replace-this server: Type: server_fail.yaml - DependsOn: keypair + DependsOn: test ''' nested_templ = ''' HeatTemplateFormatVersion: '2012-12-12' @@ -535,21 +533,18 @@ Resources: def setUp(self): super(TemplateResourceUpdateFailedTest, self).setUp() - self.assign_keypair() def test_update_on_failed_create(self): - # create a stack with "server" dependent on "keypair", but - # keypair fails, so "server" is not created properly. + # create a stack with "server" dependent on "test", but + # "test" fails, so "server" is not created properly. # We then fix the template and it should succeed. - broken_templ = self.main_template.replace('replace-this', - self.keypair_name) + broken_templ = self.main_template.replace('replace-this', 'true') stack_identifier = self.stack_create( template=broken_templ, files={'server_fail.yaml': self.nested_templ}, expected_status='CREATE_FAILED') - fixed_templ = self.main_template.replace('replace-this', - test.rand_name()) + fixed_templ = self.main_template.replace('replace-this', 'false') self.update_stack(stack_identifier, fixed_templ, files={'server_fail.yaml': self.nested_templ}) |