Fixed Share server migration test related to CIFS.
Modify "wait_for_resource_status" method so that we can pass the timeout
parameter from test cases and modify the test cases as per lib changes.
Change-Id: Id67589bf2d2094355003a16e3379867ba81bfb6b
diff --git a/manila_tempest_tests/common/waiters.py b/manila_tempest_tests/common/waiters.py
index 8a97c8e..11a02d3 100644
--- a/manila_tempest_tests/common/waiters.py
+++ b/manila_tempest_tests/common/waiters.py
@@ -45,7 +45,8 @@
resource_name='share', rule_id=None,
status_attr='status',
raise_rule_in_error_state=True,
- version=LATEST_MICROVERSION):
+ version=LATEST_MICROVERSION,
+ timeout=None):
"""Waits for a resource to reach a given status."""
get_resource_action = {
@@ -86,6 +87,9 @@
start = int(time.time())
exp_status = status if isinstance(status, list) else [status]
+ resource_status_check_time_out = client.build_timeout
+ if timeout is not None:
+ resource_status_check_time_out = timeout
while resource_status not in exp_status:
time.sleep(client.build_interval)
body = resource_action(*method_args, **method_kwargs)[rn]
@@ -102,11 +106,11 @@
raise_method = _get_name_of_raise_method(resource_name)
resource_exception = getattr(share_exceptions, raise_method)
raise resource_exception(resource_id=resource_id)
- if int(time.time()) - start >= client.build_timeout:
+ if int(time.time()) - start >= resource_status_check_time_out:
message = ('%s %s failed to reach %s status (current %s) '
'within the required time (%s s).' %
(resource_name.replace('_', ' '), resource_id, status,
- resource_status, client.build_timeout))
+ resource_status, resource_status_check_time_out))
raise exceptions.TimeoutException(message)