diff --git a/heat_integrationtests/common/test.py b/heat_integrationtests/common/test.py index 88988ec480..86d7d0a55d 100644 --- a/heat_integrationtests/common/test.py +++ b/heat_integrationtests/common/test.py @@ -520,9 +520,10 @@ class HeatIntegrationTest(testscenarios.WithScenarios, return self.list_resources(nested_identifier) return self.client.resources.list(nested_identifier) - def list_resources(self, stack_identifier): + def list_resources(self, stack_identifier, filter_func=None): resources = self.client.resources.list(stack_identifier) - return dict((r.resource_name, r.resource_type) for r in resources) + return dict((r.resource_name, r.resource_type) for r in resources + if (filter_func(r) if callable(filter_func) else True)) def get_resource_stack_id(self, r): stack_link = [l for l in r.links if l.get('rel') == 'stack'][0] diff --git a/heat_integrationtests/functional/test_conditions.py b/heat_integrationtests/functional/test_conditions.py index ebb3c0829e..9feb7cd2c3 100644 --- a/heat_integrationtests/functional/test_conditions.py +++ b/heat_integrationtests/functional/test_conditions.py @@ -309,7 +309,8 @@ class CreateUpdateResConditionTest(functional_base.FunctionalTestsBase): def res_assert_for_prod(self, resources, bj_prod=True, fj_zone=False, shannxi_provice=False): - res_names = [res.resource_name for res in resources] + res_names = {res.resource_name for res in resources + if res.resource_status != 'DELETE_COMPLETE'} if bj_prod: self.assertEqual(4, len(resources)) self.assertIn('beijing_prod_res', res_names) @@ -331,7 +332,8 @@ class CreateUpdateResConditionTest(functional_base.FunctionalTestsBase): def res_assert_for_test(self, resources, fj_zone=False, shannxi_provice=False): - res_names = [res.resource_name for res in resources] + res_names = {res.resource_name for res in resources + if res.resource_status != 'DELETE_COMPLETE'} if fj_zone: self.assertEqual(4, len(resources)) diff --git a/heat_integrationtests/functional/test_create_update.py b/heat_integrationtests/functional/test_create_update.py index 3d4ca76487..29a094d247 100644 --- a/heat_integrationtests/functional/test_create_update.py +++ b/heat_integrationtests/functional/test_create_update.py @@ -701,7 +701,11 @@ resources: expected_status='UPDATE_IN_PROGRESS') def check_resources(): - resources = self.list_resources(stack_identifier) + def is_complete(r): + return r.resource_status in {'CREATE_COMPLETE', + 'UPDATE_COMPLETE'} + + resources = self.list_resources(stack_identifier, is_complete) if len(resources) < 2: return False self.assertIn('test3', resources)