Merge "Check group metadata for autoscaling completion"
This commit is contained in:
commit
d1c381d5ad
@ -753,13 +753,13 @@ class HeatIntegrationTest(testtools.testcase.WithAttributes,
|
|||||||
time.sleep(build_interval)
|
time.sleep(build_interval)
|
||||||
|
|
||||||
def check_autoscale_complete(self, stack_id, expected_num, parent_stack,
|
def check_autoscale_complete(self, stack_id, expected_num, parent_stack,
|
||||||
policy):
|
group_name):
|
||||||
res_list = self.client.resources.list(stack_id)
|
res_list = self.client.resources.list(stack_id)
|
||||||
all_res_complete = all(res.resource_status in ('UPDATE_COMPLETE',
|
all_res_complete = all(res.resource_status in ('UPDATE_COMPLETE',
|
||||||
'CREATE_COMPLETE')
|
'CREATE_COMPLETE')
|
||||||
for res in res_list)
|
for res in res_list)
|
||||||
all_res = len(res_list) == expected_num
|
all_res = len(res_list) == expected_num
|
||||||
if all_res and all_res_complete:
|
if all_res and all_res_complete:
|
||||||
metadata = self.client.resources.metadata(parent_stack, policy)
|
metadata = self.client.resources.metadata(parent_stack, group_name)
|
||||||
return not metadata.get('scaling_in_progress')
|
return not metadata.get('scaling_in_progress')
|
||||||
return False
|
return False
|
||||||
|
@ -106,7 +106,7 @@ class AutoscalingLoadBalancerTest(scenario_base.ScenarioTestsBase):
|
|||||||
test.call_until_true(self.conf.build_timeout,
|
test.call_until_true(self.conf.build_timeout,
|
||||||
self.conf.build_interval,
|
self.conf.build_interval,
|
||||||
self.check_autoscale_complete,
|
self.check_autoscale_complete,
|
||||||
asg.physical_resource_id, 2, sid, 'scale_up')
|
asg.physical_resource_id, 2, sid, 'asg')
|
||||||
|
|
||||||
# Check number of distinctive responses, must now be 2
|
# Check number of distinctive responses, must now be 2
|
||||||
self.check_num_responses(lb_url, 2)
|
self.check_num_responses(lb_url, 2)
|
||||||
|
@ -106,7 +106,7 @@ class AutoscalingLoadBalancerv2Test(scenario_base.ScenarioTestsBase):
|
|||||||
test.call_until_true(self.conf.build_timeout,
|
test.call_until_true(self.conf.build_timeout,
|
||||||
self.conf.build_interval,
|
self.conf.build_interval,
|
||||||
self.check_autoscale_complete,
|
self.check_autoscale_complete,
|
||||||
asg.physical_resource_id, 2, sid, 'scale_up')
|
asg.physical_resource_id, 2, sid, 'asg')
|
||||||
|
|
||||||
# Check number of distinctive responses, must now be 2
|
# Check number of distinctive responses, must now be 2
|
||||||
self.check_num_responses(lb_url, 2)
|
self.check_num_responses(lb_url, 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user