From d361aec71bd8f47945b0f98ec769422c5b2ddf07 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 31 Jul 2022 01:28:02 +0900 Subject: [PATCH] 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 --- .../functional/test_template_resource.py | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/heat_integrationtests/functional/test_template_resource.py b/heat_integrationtests/functional/test_template_resource.py index f2a513b3a6..34ecab1196 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})