Merge "Removes duplicate code autoscale_complete"
This commit is contained in:
commit
93ce8e1d30
|
@ -589,3 +589,11 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
|
||||||
if len(matched) == num_expected:
|
if len(matched) == num_expected:
|
||||||
return matched
|
return matched
|
||||||
time.sleep(build_interval)
|
time.sleep(build_interval)
|
||||||
|
|
||||||
|
def check_autoscale_complete(self, stack_id, expected_num):
|
||||||
|
res_list = self.client.resources.list(stack_id)
|
||||||
|
all_res_complete = all(res.resource_status in ('UPDATE_COMPLETE',
|
||||||
|
'CREATE_COMPLETE')
|
||||||
|
for res in res_list)
|
||||||
|
all_res = len(res_list) == expected_num
|
||||||
|
return all_res and all_res_complete
|
||||||
|
|
|
@ -48,14 +48,6 @@ class AutoscalingLoadBalancerTest(scenario_base.ScenarioTestsBase):
|
||||||
resp.add(r.text)
|
resp.add(r.text)
|
||||||
self.assertEqual(expected_num, len(resp))
|
self.assertEqual(expected_num, len(resp))
|
||||||
|
|
||||||
def autoscale_complete(self, stack_id, expected_num):
|
|
||||||
res_list = self.client.resources.list(stack_id)
|
|
||||||
all_res_complete = all(res.resource_status in ('UPDATE_COMPLETE',
|
|
||||||
'CREATE_COMPLETE')
|
|
||||||
for res in res_list)
|
|
||||||
all_res = len(res_list) == expected_num
|
|
||||||
return all_res and all_res_complete
|
|
||||||
|
|
||||||
def test_autoscaling_loadbalancer_neutron(self):
|
def test_autoscaling_loadbalancer_neutron(self):
|
||||||
"""Check work of AutoScaing and Neutron LBaaS v1 resource in Heat.
|
"""Check work of AutoScaing and Neutron LBaaS v1 resource in Heat.
|
||||||
|
|
||||||
|
@ -111,7 +103,7 @@ class AutoscalingLoadBalancerTest(scenario_base.ScenarioTestsBase):
|
||||||
asg = self.client.resources.get(sid, 'asg')
|
asg = self.client.resources.get(sid, 'asg')
|
||||||
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.autoscale_complete,
|
self.check_autoscale_complete,
|
||||||
asg.physical_resource_id, 2)
|
asg.physical_resource_id, 2)
|
||||||
|
|
||||||
# Check number of distinctive responses, must now be 2
|
# Check number of distinctive responses, must now be 2
|
||||||
|
|
|
@ -48,14 +48,6 @@ class AutoscalingLoadBalancerv2Test(scenario_base.ScenarioTestsBase):
|
||||||
resp.add(r.text)
|
resp.add(r.text)
|
||||||
self.assertEqual(expected_num, len(resp))
|
self.assertEqual(expected_num, len(resp))
|
||||||
|
|
||||||
def autoscale_complete(self, stack_id, expected_num):
|
|
||||||
res_list = self.client.resources.list(stack_id)
|
|
||||||
all_res_complete = all(res.resource_status in ('UPDATE_COMPLETE',
|
|
||||||
'CREATE_COMPLETE')
|
|
||||||
for res in res_list)
|
|
||||||
all_res = len(res_list) == expected_num
|
|
||||||
return all_res and all_res_complete
|
|
||||||
|
|
||||||
def test_autoscaling_loadbalancer_neutron(self):
|
def test_autoscaling_loadbalancer_neutron(self):
|
||||||
"""Check work of AutoScaing and Neutron LBaaS v2 resource in Heat.
|
"""Check work of AutoScaing and Neutron LBaaS v2 resource in Heat.
|
||||||
|
|
||||||
|
@ -109,7 +101,7 @@ class AutoscalingLoadBalancerv2Test(scenario_base.ScenarioTestsBase):
|
||||||
asg = self.client.resources.get(sid, 'asg')
|
asg = self.client.resources.get(sid, 'asg')
|
||||||
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.autoscale_complete,
|
self.check_autoscale_complete,
|
||||||
asg.physical_resource_id, 2)
|
asg.physical_resource_id, 2)
|
||||||
|
|
||||||
# Check number of distinctive responses, must now be 2
|
# Check number of distinctive responses, must now be 2
|
||||||
|
|
Loading…
Reference in New Issue