Consolidate waiters methods
Currently, for each resource there is a waiter method. The code is almost the same in all waiter methods. This patch suggests proposes to consolidate these methods. Change-Id: I92f4628051731a9f7e05404b48a96d2ed27a855b
This commit is contained in:
parent
8868f18b7c
commit
f7fc5b6494
|
@ -19,7 +19,6 @@ import six
|
||||||
from tempest import config
|
from tempest import config
|
||||||
from tempest.lib import exceptions
|
from tempest.lib import exceptions
|
||||||
|
|
||||||
from manila_tempest_tests.common import constants
|
|
||||||
from manila_tempest_tests.services.share.v2.json import shares_client
|
from manila_tempest_tests.services.share.v2.json import shares_client
|
||||||
from manila_tempest_tests import share_exceptions
|
from manila_tempest_tests import share_exceptions
|
||||||
|
|
||||||
|
@ -27,279 +26,82 @@ CONF = config.CONF
|
||||||
LATEST_MICROVERSION = CONF.share.max_api_microversion
|
LATEST_MICROVERSION = CONF.share.max_api_microversion
|
||||||
|
|
||||||
|
|
||||||
def wait_for_share_instance_status(client, instance_id, status,
|
def _get_access_rule(body, rule_id):
|
||||||
version=LATEST_MICROVERSION):
|
for rule in body:
|
||||||
"""Waits for a share to reach a given status."""
|
if rule['id'] in rule_id:
|
||||||
body = client.get_share_instance(instance_id, version=version)
|
return rule
|
||||||
instance_status = body['status']
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while instance_status != status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
body = client.get_share_instance(instance_id)
|
|
||||||
instance_status = body['status']
|
|
||||||
if instance_status == status:
|
|
||||||
return
|
|
||||||
elif 'error' in instance_status.lower():
|
|
||||||
raise share_exceptions.ShareInstanceBuildErrorException(
|
|
||||||
id=instance_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('Share instance %s failed to reach %s status within'
|
|
||||||
' the required time (%s s).' %
|
|
||||||
(instance_id, status, client.build_timeout))
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_share_status(client, share_id, status, status_attr='status',
|
def _get_name_of_raise_method(resource_name):
|
||||||
version=LATEST_MICROVERSION):
|
if resource_name == 'snapshot_access_rule':
|
||||||
"""Waits for a share to reach a given status."""
|
return 'AccessRuleBuildErrorException'
|
||||||
|
if resource_name == 'share_replica':
|
||||||
|
return 'ShareInstanceBuildErrorException'
|
||||||
|
resource_name = resource_name.title()
|
||||||
|
name = resource_name.replace('_', '')
|
||||||
|
return name + 'BuildErrorException'
|
||||||
|
|
||||||
|
|
||||||
|
def wait_for_resource_status(client, resource_id, status,
|
||||||
|
resource_name='share', rule_id=None,
|
||||||
|
status_attr='status',
|
||||||
|
raise_rule_in_error_state=True,
|
||||||
|
version=LATEST_MICROVERSION):
|
||||||
|
"""Waits for a resource to reach a given status."""
|
||||||
|
|
||||||
|
get_resource_action = {
|
||||||
|
'share': 'get_share',
|
||||||
|
'snapshot': 'get_snapshot',
|
||||||
|
'share_server': 'show_share_server',
|
||||||
|
'share_instance': 'get_share_instance',
|
||||||
|
'snapshot_instance': 'get_snapshot_instance',
|
||||||
|
'access_rule': 'list_access_rules',
|
||||||
|
'snapshot_access_rule': 'get_snapshot_access_rule',
|
||||||
|
'share_group': 'get_share_group',
|
||||||
|
'share_group_snapshot': 'get_share_group_snapshot',
|
||||||
|
'share_replica': 'get_share_replica',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Since API v2 requests require an additional parameter for micro-versions,
|
||||||
|
# it's necessary to pass the required parameters according to the version.
|
||||||
|
resource_action = getattr(client, get_resource_action[resource_name])
|
||||||
|
method_args = [resource_id]
|
||||||
|
method_kwargs = {}
|
||||||
if isinstance(client, shares_client.SharesV2Client):
|
if isinstance(client, shares_client.SharesV2Client):
|
||||||
body = client.get_share(share_id, version=version)
|
method_kwargs.update({'version': version})
|
||||||
else:
|
if resource_name == 'snapshot_access_rule':
|
||||||
body = client.get_share(share_id)
|
method_args.insert(1, rule_id)
|
||||||
share_status = body[status_attr]
|
body = resource_action(*method_args, **method_kwargs)
|
||||||
|
|
||||||
|
if resource_name == 'access_rule':
|
||||||
|
status_attr = 'state'
|
||||||
|
body = _get_access_rule(body, rule_id)
|
||||||
|
|
||||||
|
resource_status = body[status_attr]
|
||||||
start = int(time.time())
|
start = int(time.time())
|
||||||
|
|
||||||
exp_status = status if isinstance(status, list) else [status]
|
exp_status = status if isinstance(status, list) else [status]
|
||||||
while share_status not in exp_status:
|
while resource_status not in exp_status:
|
||||||
time.sleep(client.build_interval)
|
time.sleep(client.build_interval)
|
||||||
if isinstance(client, shares_client.SharesV2Client):
|
body = resource_action(*method_args, **method_kwargs)
|
||||||
body = client.get_share(share_id, version=version)
|
|
||||||
else:
|
if resource_name == 'access_rule':
|
||||||
body = client.get_share(share_id)
|
status_attr = 'state'
|
||||||
share_status = body[status_attr]
|
body = _get_access_rule(body, rule_id)
|
||||||
if share_status in exp_status:
|
|
||||||
|
resource_status = body[status_attr]
|
||||||
|
|
||||||
|
if resource_status in exp_status:
|
||||||
return
|
return
|
||||||
elif 'error' in share_status.lower():
|
elif 'error' in resource_status.lower() and raise_rule_in_error_state:
|
||||||
raise share_exceptions.ShareBuildErrorException(
|
raise_method = _get_name_of_raise_method(resource_name)
|
||||||
share_id=share_id)
|
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 >= client.build_timeout:
|
||||||
message = ("Share's %(status_attr)s failed to transition to "
|
message = ('%s %s failed to reach %s status (current %s) '
|
||||||
"%(status)s within the required "
|
|
||||||
"time %(seconds)s." %
|
|
||||||
{"status_attr": status_attr, "status": exp_status,
|
|
||||||
"seconds": client.build_timeout})
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_snapshot_status(client, snapshot_id, status,
|
|
||||||
version=LATEST_MICROVERSION):
|
|
||||||
"""Waits for a snapshot to reach a given status."""
|
|
||||||
if isinstance(client, shares_client.SharesV2Client):
|
|
||||||
body = client.get_snapshot(snapshot_id, version=version)
|
|
||||||
else:
|
|
||||||
body = client.get_snapshot(snapshot_id)
|
|
||||||
snapshot_name = body['name']
|
|
||||||
snapshot_status = body['status']
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while snapshot_status != status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
if isinstance(client, shares_client.SharesV2Client):
|
|
||||||
body = client.get_snapshot(snapshot_id, version=version)
|
|
||||||
else:
|
|
||||||
body = client.get_snapshot(snapshot_id)
|
|
||||||
snapshot_status = body['status']
|
|
||||||
if snapshot_status in status:
|
|
||||||
return
|
|
||||||
if 'error' in snapshot_status:
|
|
||||||
raise (share_exceptions.
|
|
||||||
SnapshotBuildErrorException(snapshot_id=snapshot_id))
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('Share Snapshot %s failed to reach %s status '
|
|
||||||
'within the required time (%s s).' %
|
'within the required time (%s s).' %
|
||||||
(snapshot_name, status, client.build_timeout))
|
(resource_name.replace('_', ' '), resource_id, status,
|
||||||
raise exceptions.TimeoutException(message)
|
resource_status, client.build_timeout))
|
||||||
|
|
||||||
|
|
||||||
def wait_for_access_rule_status(client, share_id, rule_id, status,
|
|
||||||
raise_rule_in_error_state=True):
|
|
||||||
"""Waits for an access rule to reach a given status."""
|
|
||||||
rule_status = "new"
|
|
||||||
start = int(time.time())
|
|
||||||
while rule_status != status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
rules = client.list_access_rules(share_id)
|
|
||||||
for rule in rules:
|
|
||||||
if rule["id"] in rule_id:
|
|
||||||
rule_status = rule['state']
|
|
||||||
break
|
|
||||||
if 'error' in rule_status and raise_rule_in_error_state:
|
|
||||||
raise share_exceptions.AccessRuleBuildErrorException(
|
|
||||||
rule_id=rule_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('Share Access Rule %s failed to reach %s status '
|
|
||||||
'within the required time (%s s).' %
|
|
||||||
(rule_id, status, client.build_timeout))
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_snapshot_instance_status(client, instance_id, expected_status):
|
|
||||||
"""Waits for a snapshot instance status to reach a given status."""
|
|
||||||
body = client.get_snapshot_instance(instance_id)
|
|
||||||
instance_status = body['status']
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while instance_status != expected_status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
body = client.get_snapshot_instance(instance_id)
|
|
||||||
instance_status = body['status']
|
|
||||||
if instance_status == expected_status:
|
|
||||||
return
|
|
||||||
if 'error' in instance_status:
|
|
||||||
raise share_exceptions.SnapshotInstanceBuildErrorException(
|
|
||||||
id=instance_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('The status of snapshot instance %(id)s failed to '
|
|
||||||
'reach %(expected_status)s status within the '
|
|
||||||
'required time (%(time)ss). Current '
|
|
||||||
'status: %(current_status)s.' %
|
|
||||||
{
|
|
||||||
'expected_status': expected_status,
|
|
||||||
'time': client.build_timeout,
|
|
||||||
'id': instance_id,
|
|
||||||
'current_status': instance_status,
|
|
||||||
})
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_share_group_status(client, share_group_id, status):
|
|
||||||
"""Waits for a share group to reach a given status."""
|
|
||||||
body = client.get_share_group(share_group_id)
|
|
||||||
sg_name = body['name']
|
|
||||||
sg_status = body['status']
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while sg_status != status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
body = client.get_share_group(share_group_id)
|
|
||||||
sg_status = body['status']
|
|
||||||
if 'error' in sg_status and status != 'error':
|
|
||||||
raise share_exceptions.ShareGroupBuildErrorException(
|
|
||||||
share_group_id=share_group_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
sg_name = sg_name or share_group_id
|
|
||||||
message = ('Share Group %s failed to reach %s status '
|
|
||||||
'within the required time (%s s). '
|
|
||||||
'Current status: %s' %
|
|
||||||
(sg_name, status, client.build_timeout, sg_status))
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_share_group_snapshot_status(client, share_group_snapshot_id,
|
|
||||||
status):
|
|
||||||
"""Waits for a share group snapshot to reach a given status."""
|
|
||||||
body = client.get_share_group_snapshot(share_group_snapshot_id)
|
|
||||||
sg_snapshot_name = body['name']
|
|
||||||
sg_snapshot_status = body['status']
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while sg_snapshot_status != status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
body = client.get_share_group_snapshot(share_group_snapshot_id)
|
|
||||||
sg_snapshot_status = body['status']
|
|
||||||
if 'error' in sg_snapshot_status and status != 'error':
|
|
||||||
raise share_exceptions.ShareGroupSnapshotBuildErrorException(
|
|
||||||
share_group_snapshot_id=share_group_snapshot_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('Share Group Snapshot %s failed to reach %s status '
|
|
||||||
'within the required time (%s s).' %
|
|
||||||
(sg_snapshot_name, status, client.build_timeout))
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_share_server_status(client, server_id, status,
|
|
||||||
status_attr='status'):
|
|
||||||
"""Waits for a share to reach a given status."""
|
|
||||||
body = client.show_share_server(server_id)
|
|
||||||
server_status = body[status_attr]
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while server_status != status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
body = client.show_share_server(server_id)
|
|
||||||
server_status = body[status_attr]
|
|
||||||
if server_status in status:
|
|
||||||
return
|
|
||||||
elif constants.STATUS_ERROR in server_status.lower():
|
|
||||||
raise share_exceptions.ShareServerBuildErrorException(
|
|
||||||
server_id=server_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ("Share server's %(status_attr)s failed to "
|
|
||||||
"transition to %(status)s within the required "
|
|
||||||
"time %(seconds)s." %
|
|
||||||
{"status_attr": status_attr, "status": status,
|
|
||||||
"seconds": client.build_timeout})
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_share_replica_status(client, replica_id, expected_status,
|
|
||||||
status_attr='status'):
|
|
||||||
"""Waits for a replica's status_attr to reach a given status."""
|
|
||||||
body = client.get_share_replica(replica_id)
|
|
||||||
replica_status = body[status_attr]
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while replica_status != expected_status:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
body = client.get_share_replica(replica_id)
|
|
||||||
replica_status = body[status_attr]
|
|
||||||
if replica_status == expected_status:
|
|
||||||
return
|
|
||||||
if ('error' in replica_status
|
|
||||||
and expected_status != constants.STATUS_ERROR):
|
|
||||||
raise share_exceptions.ShareInstanceBuildErrorException(
|
|
||||||
id=replica_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('The %(status_attr)s of Replica %(id)s failed to '
|
|
||||||
'reach %(expected_status)s status within the '
|
|
||||||
'required time (%(time)ss). Current '
|
|
||||||
'%(status_attr)s: %(current_status)s.' %
|
|
||||||
{
|
|
||||||
'status_attr': status_attr,
|
|
||||||
'expected_status': expected_status,
|
|
||||||
'time': client.build_timeout,
|
|
||||||
'id': replica_id,
|
|
||||||
'current_status': replica_status,
|
|
||||||
})
|
|
||||||
raise exceptions.TimeoutException(message)
|
|
||||||
|
|
||||||
|
|
||||||
def wait_for_snapshot_access_rule_status(client, snapshot_id, rule_id,
|
|
||||||
expected_state='active'):
|
|
||||||
rule = client.get_snapshot_access_rule(snapshot_id, rule_id)
|
|
||||||
state = rule['state']
|
|
||||||
start = int(time.time())
|
|
||||||
|
|
||||||
while state != expected_state:
|
|
||||||
time.sleep(client.build_interval)
|
|
||||||
rule = client.get_snapshot_access_rule(snapshot_id, rule_id)
|
|
||||||
state = rule['state']
|
|
||||||
if state == expected_state:
|
|
||||||
return
|
|
||||||
if 'error' in state:
|
|
||||||
raise share_exceptions.AccessRuleBuildErrorException(
|
|
||||||
snapshot_id)
|
|
||||||
|
|
||||||
if int(time.time()) - start >= client.build_timeout:
|
|
||||||
message = ('The status of snapshot access rule %(id)s failed '
|
|
||||||
'to reach %(expected_state)s state within the '
|
|
||||||
'required time (%(time)ss). Current '
|
|
||||||
'state: %(current_state)s.' %
|
|
||||||
{
|
|
||||||
'expected_state': expected_state,
|
|
||||||
'time': client.build_timeout,
|
|
||||||
'id': rule_id,
|
|
||||||
'current_state': state,
|
|
||||||
})
|
|
||||||
raise exceptions.TimeoutException(message)
|
raise exceptions.TimeoutException(message)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -621,6 +621,15 @@ class SharesV2Client(shares_client.SharesClient):
|
||||||
self.expected_success(202, resp.status)
|
self.expected_success(202, resp.status)
|
||||||
return body
|
return body
|
||||||
|
|
||||||
|
###############
|
||||||
|
|
||||||
|
def show_share_server(self, share_server_id, version=LATEST_MICROVERSION):
|
||||||
|
"""Get share server info."""
|
||||||
|
uri = "share-servers/%s" % share_server_id
|
||||||
|
resp, body = self.get(uri, version=version)
|
||||||
|
self.expected_success(200, resp.status)
|
||||||
|
return self._parse_resp(body)
|
||||||
|
|
||||||
###############
|
###############
|
||||||
|
|
||||||
def get_snapshot_instance(self, instance_id, version=LATEST_MICROVERSION):
|
def get_snapshot_instance(self, instance_id, version=LATEST_MICROVERSION):
|
||||||
|
@ -746,7 +755,7 @@ class SharesV2Client(shares_client.SharesClient):
|
||||||
self.expected_success(202, resp.status)
|
self.expected_success(202, resp.status)
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def get_access(self, access_id, version=LATEST_MICROVERSION):
|
def get_access_rule(self, access_id, version=LATEST_MICROVERSION):
|
||||||
resp, body = self.get("share-access-rules/%s" % access_id,
|
resp, body = self.get("share-access-rules/%s" % access_id,
|
||||||
version=version)
|
version=version)
|
||||||
self.expected_success(200, resp.status)
|
self.expected_success(200, resp.status)
|
||||||
|
@ -1657,9 +1666,10 @@ class SharesV2Client(shares_client.SharesClient):
|
||||||
self.expected_success(202, resp.status)
|
self.expected_success(202, resp.status)
|
||||||
return self._parse_resp(body)
|
return self._parse_resp(body)
|
||||||
|
|
||||||
def get_snapshot_access_rule(self, snapshot_id, rule_id):
|
def get_snapshot_access_rule(self, snapshot_id, rule_id,
|
||||||
|
version=LATEST_MICROVERSION):
|
||||||
resp, body = self.get("snapshots/%s/access-list" % snapshot_id,
|
resp, body = self.get("snapshots/%s/access-list" % snapshot_id,
|
||||||
version=LATEST_MICROVERSION)
|
version=version)
|
||||||
body = self._parse_resp(body)
|
body = self._parse_resp(body)
|
||||||
found_rules = [r for r in body if r['id'] == rule_id]
|
found_rules = [r for r in body if r['id'] == rule_id]
|
||||||
|
|
||||||
|
|
|
@ -17,33 +17,34 @@ from tempest.lib import exceptions
|
||||||
|
|
||||||
|
|
||||||
class ShareBuildErrorException(exceptions.TempestException):
|
class ShareBuildErrorException(exceptions.TempestException):
|
||||||
message = "Share %(share_id)s failed to build and is in ERROR status"
|
message = "Share %(resource_id)s failed to build and is in ERROR status"
|
||||||
|
|
||||||
|
|
||||||
class ShareInstanceBuildErrorException(exceptions.TempestException):
|
class ShareInstanceBuildErrorException(exceptions.TempestException):
|
||||||
message = "Share instance %(id)s failed to build and is in ERROR status"
|
message = ("Share instance %(resource_id)s failed to build and is in "
|
||||||
|
"ERROR status")
|
||||||
|
|
||||||
|
|
||||||
class ShareGroupBuildErrorException(exceptions.TempestException):
|
class ShareGroupBuildErrorException(exceptions.TempestException):
|
||||||
message = ("Share group %(share_group_id)s failed to build and "
|
message = ("Share group %(resource_id)s failed to build and "
|
||||||
"is in ERROR status")
|
"is in ERROR status")
|
||||||
|
|
||||||
|
|
||||||
class AccessRuleBuildErrorException(exceptions.TempestException):
|
class AccessRuleBuildErrorException(exceptions.TempestException):
|
||||||
message = "Share's rule with id %(rule_id)s is in ERROR status"
|
message = "Share's rule with id %(resource_id)s is in ERROR status"
|
||||||
|
|
||||||
|
|
||||||
class SnapshotBuildErrorException(exceptions.TempestException):
|
class SnapshotBuildErrorException(exceptions.TempestException):
|
||||||
message = "Snapshot %(snapshot_id)s failed to build and is in ERROR status"
|
message = "Snapshot %(resource_id)s failed to build and is in ERROR status"
|
||||||
|
|
||||||
|
|
||||||
class SnapshotInstanceBuildErrorException(exceptions.TempestException):
|
class SnapshotInstanceBuildErrorException(exceptions.TempestException):
|
||||||
message = ("Snapshot instance %(id)s failed to build and is in "
|
message = ("Snapshot instance %(resource_id)s failed to build and is in "
|
||||||
"ERROR status.")
|
"ERROR status.")
|
||||||
|
|
||||||
|
|
||||||
class ShareGroupSnapshotBuildErrorException(exceptions.TempestException):
|
class ShareGroupSnapshotBuildErrorException(exceptions.TempestException):
|
||||||
message = ("Share Group Snapshot %(share_group_snapshot_id)s failed "
|
message = ("Share Group Snapshot %(resource_id)s failed "
|
||||||
"to build and is in ERROR status")
|
"to build and is in ERROR status")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,24 +40,20 @@ class AdminActionsTest(base.BaseSharesAdminTest):
|
||||||
# create share
|
# create share
|
||||||
cls.sh = cls.create_share(share_type_id=cls.share_type_id)
|
cls.sh = cls.create_share(share_type_id=cls.share_type_id)
|
||||||
|
|
||||||
def _wait_for_resource_status(self, resource_id, resource_type):
|
|
||||||
wait_for_resource_status = getattr(
|
|
||||||
waiters, "wait_for_{}_status".format(resource_type))
|
|
||||||
wait_for_resource_status(
|
|
||||||
self.shares_v2_client, resource_id, "available")
|
|
||||||
|
|
||||||
def _reset_resource_available(self, resource_id, resource_type="shares"):
|
def _reset_resource_available(self, resource_id, resource_type="shares"):
|
||||||
self.shares_v2_client.reset_state(
|
self.shares_v2_client.reset_state(
|
||||||
resource_id, s_type=resource_type, status="available")
|
resource_id, s_type=resource_type, status="available")
|
||||||
self._wait_for_resource_status(resource_id, resource_type[:-1])
|
waiters.wait_for_resource_status(
|
||||||
|
self.shares_v2_client, resource_id, "available",
|
||||||
|
resource_name=resource_type[:-1])
|
||||||
|
|
||||||
@decorators.idempotent_id('4f8c6ae9-0656-445f-a911-fbf98fe761d0')
|
@decorators.idempotent_id('4f8c6ae9-0656-445f-a911-fbf98fe761d0')
|
||||||
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
|
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
|
||||||
@ddt.data("error", "available", "error_deleting", "deleting", "creating")
|
@ddt.data("error", "available", "error_deleting", "deleting", "creating")
|
||||||
def test_reset_share_state(self, status):
|
def test_reset_share_state(self, status):
|
||||||
self.shares_v2_client.reset_state(self.sh["id"], status=status)
|
self.shares_v2_client.reset_state(self.sh["id"], status=status)
|
||||||
waiters.wait_for_share_status(self.shares_v2_client,
|
waiters.wait_for_resource_status(self.shares_v2_client,
|
||||||
self.sh["id"], status)
|
self.sh["id"], status)
|
||||||
self.addCleanup(self._reset_resource_available, self.sh["id"])
|
self.addCleanup(self._reset_resource_available, self.sh["id"])
|
||||||
|
|
||||||
@decorators.idempotent_id('13075b2d-fe83-41bf-b6ef-99cfcc00257d')
|
@decorators.idempotent_id('13075b2d-fe83-41bf-b6ef-99cfcc00257d')
|
||||||
|
@ -69,8 +65,9 @@ class AdminActionsTest(base.BaseSharesAdminTest):
|
||||||
share_instance_id = sh_instance["id"]
|
share_instance_id = sh_instance["id"]
|
||||||
self.shares_v2_client.reset_state(
|
self.shares_v2_client.reset_state(
|
||||||
share_instance_id, s_type="share_instances", status=status)
|
share_instance_id, s_type="share_instances", status=status)
|
||||||
waiters.wait_for_share_instance_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_instance_id, status)
|
self.shares_v2_client, share_instance_id, status,
|
||||||
|
resource_name='share_instance')
|
||||||
self.addCleanup(self._reset_resource_available,
|
self.addCleanup(self._reset_resource_available,
|
||||||
share_instance_id, "share_instances")
|
share_instance_id, "share_instances")
|
||||||
|
|
||||||
|
@ -83,8 +80,9 @@ class AdminActionsTest(base.BaseSharesAdminTest):
|
||||||
snapshot = self.create_snapshot_wait_for_active(self.sh["id"])
|
snapshot = self.create_snapshot_wait_for_active(self.sh["id"])
|
||||||
self.shares_v2_client.reset_state(
|
self.shares_v2_client.reset_state(
|
||||||
snapshot["id"], s_type="snapshots", status=status)
|
snapshot["id"], s_type="snapshots", status=status)
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, snapshot["id"], status)
|
self.shares_v2_client, snapshot["id"], status,
|
||||||
|
resource_name='snapshot')
|
||||||
self.addCleanup(self._reset_resource_available,
|
self.addCleanup(self._reset_resource_available,
|
||||||
snapshot["id"], "snapshots")
|
snapshot["id"], "snapshots")
|
||||||
|
|
||||||
|
@ -154,5 +152,6 @@ class AdminActionsTest(base.BaseSharesAdminTest):
|
||||||
def test_reset_share_task_state(self):
|
def test_reset_share_task_state(self):
|
||||||
for task_state in self.task_states:
|
for task_state in self.task_states:
|
||||||
self.shares_v2_client.reset_task_state(self.sh["id"], task_state)
|
self.shares_v2_client.reset_task_state(self.sh["id"], task_state)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.sh["id"], task_state, 'task_state')
|
self.shares_v2_client, self.sh["id"], task_state,
|
||||||
|
status_attr='task_state')
|
||||||
|
|
|
@ -114,7 +114,7 @@ class MigrationBase(base.BaseSharesAdminTest):
|
||||||
self.shares_v2_client.create_access_rule(
|
self.shares_v2_client.create_access_rule(
|
||||||
share['id'], access_to="50.50.50.50", access_level="rw")
|
share['id'], access_to="50.50.50.50", access_level="rw")
|
||||||
|
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client,
|
self.shares_v2_client,
|
||||||
share['id'], constants.RULE_STATE_ACTIVE,
|
share['id'], constants.RULE_STATE_ACTIVE,
|
||||||
status_attr='access_rules_status')
|
status_attr='access_rules_status')
|
||||||
|
@ -122,7 +122,7 @@ class MigrationBase(base.BaseSharesAdminTest):
|
||||||
self.shares_v2_client.create_access_rule(
|
self.shares_v2_client.create_access_rule(
|
||||||
share['id'], access_to="51.51.51.51", access_level="ro")
|
share['id'], access_to="51.51.51.51", access_level="ro")
|
||||||
|
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.RULE_STATE_ACTIVE,
|
self.shares_v2_client, share['id'], constants.RULE_STATE_ACTIVE,
|
||||||
status_attr='access_rules_status')
|
status_attr='access_rules_status')
|
||||||
|
|
||||||
|
@ -237,14 +237,14 @@ class MigrationBase(base.BaseSharesAdminTest):
|
||||||
if resize == 'extend':
|
if resize == 'extend':
|
||||||
new_size = CONF.share.share_size + 2
|
new_size = CONF.share.share_size + 2
|
||||||
self.shares_v2_client.extend_share(share['id'], new_size)
|
self.shares_v2_client.extend_share(share['id'], new_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
||||||
share = self.shares_v2_client.get_share(share["id"])
|
share = self.shares_v2_client.get_share(share["id"])
|
||||||
self.assertEqual(new_size, int(share["size"]))
|
self.assertEqual(new_size, int(share["size"]))
|
||||||
else:
|
else:
|
||||||
new_size = CONF.share.share_size
|
new_size = CONF.share.share_size
|
||||||
self.shares_v2_client.shrink_share(share['id'], new_size)
|
self.shares_v2_client.shrink_share(share['id'], new_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
||||||
share = self.shares_v2_client.get_share(share["id"])
|
share = self.shares_v2_client.get_share(share["id"])
|
||||||
self.assertEqual(new_size, int(share["size"]))
|
self.assertEqual(new_size, int(share["size"]))
|
||||||
|
|
|
@ -94,8 +94,9 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
|
||||||
@base.skip_if_microversion_lt("2.22")
|
@base.skip_if_microversion_lt("2.22")
|
||||||
def test_migration_get_progress_None(self):
|
def test_migration_get_progress_None(self):
|
||||||
self.shares_v2_client.reset_task_state(self.share["id"], None)
|
self.shares_v2_client.reset_task_state(self.share["id"], None)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], None, 'task_state')
|
self.shares_v2_client, self.share["id"], None,
|
||||||
|
status_attr='task_state')
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
lib_exc.BadRequest, self.shares_v2_client.migration_get_progress,
|
lib_exc.BadRequest, self.shares_v2_client.migration_get_progress,
|
||||||
self.share['id'])
|
self.share['id'])
|
||||||
|
@ -228,14 +229,14 @@ class MigrationNegativeTest(base.BaseSharesAdminTest):
|
||||||
def test_migrate_share_not_available(self):
|
def test_migrate_share_not_available(self):
|
||||||
self.shares_client.reset_state(self.share['id'],
|
self.shares_client.reset_state(self.share['id'],
|
||||||
constants.STATUS_ERROR)
|
constants.STATUS_ERROR)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share['id'], constants.STATUS_ERROR)
|
self.shares_v2_client, self.share['id'], constants.STATUS_ERROR)
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
lib_exc.BadRequest, self.shares_v2_client.migrate_share,
|
lib_exc.BadRequest, self.shares_v2_client.migrate_share,
|
||||||
self.share['id'], self.dest_pool)
|
self.share['id'], self.dest_pool)
|
||||||
self.shares_client.reset_state(self.share['id'],
|
self.shares_client.reset_state(self.share['id'],
|
||||||
constants.STATUS_AVAILABLE)
|
constants.STATUS_AVAILABLE)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share['id'],
|
self.shares_v2_client, self.share['id'],
|
||||||
constants.STATUS_AVAILABLE)
|
constants.STATUS_AVAILABLE)
|
||||||
|
|
||||||
|
|
|
@ -108,9 +108,10 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
|
||||||
share["id"], self.replica_zone, cleanup=False,
|
share["id"], self.replica_zone, cleanup=False,
|
||||||
client=self.admin_client, version=version)
|
client=self.admin_client, version=version)
|
||||||
# Wait for replica state to update after creation
|
# Wait for replica state to update after creation
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'],
|
self.admin_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# List replicas
|
# List replicas
|
||||||
replica_list = self.admin_client.list_share_replicas(
|
replica_list = self.admin_client.list_share_replicas(
|
||||||
|
@ -125,10 +126,10 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
|
||||||
self.admin_client.reset_share_replica_state(
|
self.admin_client.reset_share_replica_state(
|
||||||
replica['id'], constants.REPLICATION_STATE_OUT_OF_SYNC,
|
replica['id'], constants.REPLICATION_STATE_OUT_OF_SYNC,
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'],
|
self.admin_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_OUT_OF_SYNC,
|
constants.REPLICATION_STATE_OUT_OF_SYNC,
|
||||||
status_attr='replica_state')
|
resource_name='share_replica', status_attr='replica_state')
|
||||||
|
|
||||||
# Promote 'out_of_sync' replica to 'active' state.
|
# Promote 'out_of_sync' replica to 'active' state.
|
||||||
self.promote_share_replica(replica['id'], self.admin_client,
|
self.promote_share_replica(replica['id'], self.admin_client,
|
||||||
|
@ -160,8 +161,9 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
|
||||||
version=version)
|
version=version)
|
||||||
self.admin_client.reset_share_replica_status(
|
self.admin_client.reset_share_replica_status(
|
||||||
replica['id'], constants.STATUS_ERROR_DELETING, version=version)
|
replica['id'], constants.STATUS_ERROR_DELETING, version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'], constants.STATUS_ERROR_DELETING)
|
self.admin_client, replica['id'], constants.STATUS_ERROR_DELETING,
|
||||||
|
resource_name='share_replica')
|
||||||
self.admin_client.force_delete_share_replica(replica['id'],
|
self.admin_client.force_delete_share_replica(replica['id'],
|
||||||
version=version)
|
version=version)
|
||||||
self.admin_client.wait_for_resource_deletion(replica_id=replica['id'])
|
self.admin_client.wait_for_resource_deletion(replica_id=replica['id'])
|
||||||
|
@ -183,8 +185,9 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
|
||||||
self.admin_client.reset_share_replica_status(replica['id'],
|
self.admin_client.reset_share_replica_status(replica['id'],
|
||||||
constants.STATUS_ERROR,
|
constants.STATUS_ERROR,
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'], constants.STATUS_ERROR)
|
self.admin_client, replica['id'], constants.STATUS_ERROR,
|
||||||
|
resource_name='share_replica')
|
||||||
|
|
||||||
@decorators.idempotent_id('258844da-a853-42b6-87db-b16e616018c6')
|
@decorators.idempotent_id('258844da-a853-42b6-87db-b16e616018c6')
|
||||||
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
|
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
|
||||||
|
@ -203,9 +206,9 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
|
||||||
self.admin_client.reset_share_replica_state(replica['id'],
|
self.admin_client.reset_share_replica_state(replica['id'],
|
||||||
constants.STATUS_ERROR,
|
constants.STATUS_ERROR,
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'], constants.STATUS_ERROR,
|
self.admin_client, replica['id'], constants.STATUS_ERROR,
|
||||||
status_attr='replica_state')
|
resource_name='share_replica', status_attr='replica_state')
|
||||||
|
|
||||||
@decorators.idempotent_id('2969565a-85e8-4c61-9dfb-cc7f7ca9f6dd')
|
@decorators.idempotent_id('2969565a-85e8-4c61-9dfb-cc7f7ca9f6dd')
|
||||||
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
|
@tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
|
||||||
|
@ -221,21 +224,23 @@ class ReplicationAdminTest(base.BaseSharesMixedTest):
|
||||||
cleanup_in_class=False,
|
cleanup_in_class=False,
|
||||||
client=self.admin_client,
|
client=self.admin_client,
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'],
|
self.admin_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# Set replica_state to 'out_of_sync'.
|
# Set replica_state to 'out_of_sync'.
|
||||||
self.admin_client.reset_share_replica_state(
|
self.admin_client.reset_share_replica_state(
|
||||||
replica['id'], constants.REPLICATION_STATE_OUT_OF_SYNC,
|
replica['id'], constants.REPLICATION_STATE_OUT_OF_SYNC,
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'],
|
self.admin_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_OUT_OF_SYNC,
|
constants.REPLICATION_STATE_OUT_OF_SYNC,
|
||||||
status_attr='replica_state')
|
resource_name='share_replica', status_attr='replica_state')
|
||||||
|
|
||||||
# Attempt resync
|
# Attempt resync
|
||||||
self.admin_client.resync_share_replica(replica['id'], version=version)
|
self.admin_client.resync_share_replica(replica['id'], version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, replica['id'],
|
self.admin_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
|
@ -86,7 +86,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
|
||||||
# Test extend share
|
# Test extend share
|
||||||
new_size = self.share["size"] + 1
|
new_size = self.share["size"] + 1
|
||||||
self.admin_client.extend_share(self.share["id"], new_size)
|
self.admin_client.extend_share(self.share["id"], new_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, self.share["id"], "available")
|
self.admin_client, self.share["id"], "available")
|
||||||
share = self.admin_client.get_share(self.share["id"])
|
share = self.admin_client.get_share(self.share["id"])
|
||||||
self.assertEqual(new_size, int(share["size"]))
|
self.assertEqual(new_size, int(share["size"]))
|
||||||
|
@ -99,7 +99,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
|
||||||
share = self.admin_client.get_share(self.share["id"])
|
share = self.admin_client.get_share(self.share["id"])
|
||||||
new_size = self.share["size"] - 1
|
new_size = self.share["size"] - 1
|
||||||
self.admin_client.shrink_share(self.share["id"], new_size)
|
self.admin_client.shrink_share(self.share["id"], new_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, share["id"], "available")
|
self.admin_client, share["id"], "available")
|
||||||
shrink_share = self.admin_client.get_share(self.share["id"])
|
shrink_share = self.admin_client.get_share(self.share["id"])
|
||||||
self.assertEqual(new_size, int(shrink_share["size"]))
|
self.assertEqual(new_size, int(shrink_share["size"]))
|
||||||
|
@ -129,7 +129,7 @@ class ReplicationActionsAdminTest(base.BaseSharesMixedTest):
|
||||||
managed_share = self.admin_client.manage_share(
|
managed_share = self.admin_client.manage_share(
|
||||||
share['host'], share['share_proto'],
|
share['host'], share['share_proto'],
|
||||||
export_path, self.share_type_id)
|
export_path, self.share_type_id)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.admin_client, managed_share['id'], 'available')
|
self.admin_client, managed_share['id'], 'available')
|
||||||
|
|
||||||
# Add managed share to cleanup queue
|
# Add managed share to cleanup queue
|
||||||
|
|
|
@ -108,9 +108,9 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
|
||||||
'client': self.shares_client})
|
'client': self.shares_client})
|
||||||
|
|
||||||
# Wait for success
|
# Wait for success
|
||||||
waiters.wait_for_share_status(self.shares_v2_client,
|
waiters.wait_for_resource_status(self.shares_v2_client,
|
||||||
managed_share['id'],
|
managed_share['id'],
|
||||||
constants.STATUS_AVAILABLE)
|
constants.STATUS_AVAILABLE)
|
||||||
|
|
||||||
# Verify data of managed share
|
# Verify data of managed share
|
||||||
self.assertEqual(name, managed_share['name'])
|
self.assertEqual(name, managed_share['name'])
|
||||||
|
|
|
@ -67,7 +67,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
|
||||||
# Manage the share and wait for the expected state.
|
# Manage the share and wait for the expected state.
|
||||||
# Return the managed share object.
|
# Return the managed share object.
|
||||||
managed_share = self.shares_v2_client.manage_share(**params)
|
managed_share = self.shares_v2_client.manage_share(**params)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, managed_share['id'], state)
|
self.shares_v2_client, managed_share['id'], state)
|
||||||
|
|
||||||
return managed_share
|
return managed_share
|
||||||
|
@ -168,7 +168,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
|
||||||
invalid_share = self.shares_v2_client.manage_share(
|
invalid_share = self.shares_v2_client.manage_share(
|
||||||
**invalid_params
|
**invalid_params
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, invalid_share['id'],
|
self.shares_v2_client, invalid_share['id'],
|
||||||
constants.STATUS_MANAGE_ERROR)
|
constants.STATUS_MANAGE_ERROR)
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ class ManageNFSShareNegativeTest(base.BaseSharesAdminTest):
|
||||||
)
|
)
|
||||||
invalid_share = self.shares_v2_client.manage_share(**invalid_params)
|
invalid_share = self.shares_v2_client.manage_share(**invalid_params)
|
||||||
|
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, invalid_share['id'],
|
self.shares_v2_client, invalid_share['id'],
|
||||||
constants.STATUS_MANAGE_ERROR)
|
constants.STATUS_MANAGE_ERROR)
|
||||||
self._unmanage_share_and_wait(share)
|
self._unmanage_share_and_wait(share)
|
||||||
|
|
|
@ -329,8 +329,9 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
|
||||||
share_server['id'],
|
share_server['id'],
|
||||||
status=state,
|
status=state,
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_server['id'], status=state
|
self.shares_v2_client, share_server['id'], state,
|
||||||
|
resource_name="share_server"
|
||||||
)
|
)
|
||||||
|
|
||||||
# bring the share server back in the active state
|
# bring the share server back in the active state
|
||||||
|
@ -338,9 +339,9 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
|
||||||
share_server['id'],
|
share_server['id'],
|
||||||
status=constants.SERVER_STATE_ACTIVE,
|
status=constants.SERVER_STATE_ACTIVE,
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_server['id'],
|
self.shares_v2_client, share_server['id'],
|
||||||
status=constants.SERVER_STATE_ACTIVE
|
constants.SERVER_STATE_ACTIVE, resource_name="share_server"
|
||||||
)
|
)
|
||||||
|
|
||||||
# delete share
|
# delete share
|
||||||
|
|
|
@ -165,9 +165,9 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
|
||||||
share['share_server_id'],
|
share['share_server_id'],
|
||||||
status=constants.SERVER_STATE_ACTIVE,
|
status=constants.SERVER_STATE_ACTIVE,
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['share_server_id'],
|
self.shares_v2_client, share['share_server_id'],
|
||||||
constants.SERVER_STATE_ACTIVE,
|
constants.SERVER_STATE_ACTIVE, resource_name='share_server'
|
||||||
)
|
)
|
||||||
|
|
||||||
# delete share
|
# delete share
|
||||||
|
@ -207,9 +207,9 @@ class ManageShareServersNegativeTest(base.BaseSharesAdminTest):
|
||||||
share['share_server_id'],
|
share['share_server_id'],
|
||||||
status=constants.SERVER_STATE_ACTIVE,
|
status=constants.SERVER_STATE_ACTIVE,
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['share_server_id'],
|
self.shares_v2_client, share['share_server_id'],
|
||||||
constants.SERVER_STATE_ACTIVE,
|
constants.SERVER_STATE_ACTIVE, resource_name='share_server'
|
||||||
)
|
)
|
||||||
|
|
||||||
# delete share
|
# delete share
|
||||||
|
|
|
@ -97,7 +97,7 @@ class MigrationShareServerBase(base.BaseSharesAdminTest):
|
||||||
access_to=rule.get('access_to'),
|
access_to=rule.get('access_to'),
|
||||||
access_level=rule.get('access_level')
|
access_level=rule.get('access_level')
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.RULE_STATE_ACTIVE,
|
self.shares_v2_client, share['id'], constants.RULE_STATE_ACTIVE,
|
||||||
status_attr='access_rules_status')
|
status_attr='access_rules_status')
|
||||||
|
|
||||||
|
@ -141,8 +141,10 @@ class MigrationShareServerBase(base.BaseSharesAdminTest):
|
||||||
|
|
||||||
# Check the snapshot status if possible.
|
# Check the snapshot status if possible.
|
||||||
if snapshot_id:
|
if snapshot_id:
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, snapshot_id, constants.STATUS_AVAILABLE)
|
self.shares_v2_client, snapshot_id, constants.STATUS_AVAILABLE,
|
||||||
|
resource_name='snapshot'
|
||||||
|
)
|
||||||
|
|
||||||
# Check the share server destination status.
|
# Check the share server destination status.
|
||||||
dest_server = self.shares_v2_client.show_share_server(dest_server_id)
|
dest_server = self.shares_v2_client.show_share_server(dest_server_id)
|
||||||
|
@ -277,9 +279,12 @@ class ShareServerMigrationBasicNFS(MigrationShareServerBase):
|
||||||
src_server_id, dest_host, preserve_snapshots=preserve_snapshots)
|
src_server_id, dest_host, preserve_snapshots=preserve_snapshots)
|
||||||
|
|
||||||
expected_state = constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE
|
expected_state = constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, src_server_id, expected_state,
|
self.shares_v2_client, src_server_id,
|
||||||
status_attr='task_state')
|
expected_state, resource_name='share_server',
|
||||||
|
status_attr='task_state'
|
||||||
|
)
|
||||||
|
|
||||||
# Get for the destination share server.
|
# Get for the destination share server.
|
||||||
dest_server_id = self._get_share_server_destination_for_migration(
|
dest_server_id = self._get_share_server_destination_for_migration(
|
||||||
src_server_id)
|
src_server_id)
|
||||||
|
@ -297,8 +302,9 @@ class ShareServerMigrationBasicNFS(MigrationShareServerBase):
|
||||||
|
|
||||||
# Wait for the migration cancelled status.
|
# Wait for the migration cancelled status.
|
||||||
expected_state = constants.TASK_STATE_MIGRATION_CANCELLED
|
expected_state = constants.TASK_STATE_MIGRATION_CANCELLED
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, src_server_id, expected_state,
|
self.shares_v2_client, src_server_id,
|
||||||
|
expected_state, resource_name='share_server',
|
||||||
status_attr='task_state')
|
status_attr='task_state')
|
||||||
|
|
||||||
# After the cancel operation, we need to validate again the resources.
|
# After the cancel operation, we need to validate again the resources.
|
||||||
|
@ -342,9 +348,11 @@ class ShareServerMigrationBasicNFS(MigrationShareServerBase):
|
||||||
preserve_snapshots=preserve_snapshots)
|
preserve_snapshots=preserve_snapshots)
|
||||||
|
|
||||||
expected_state = constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE
|
expected_state = constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, src_server_id, expected_state,
|
self.shares_v2_client, src_server_id,
|
||||||
status_attr='task_state')
|
expected_state, resource_name='share_server',
|
||||||
|
status_attr='task_state'
|
||||||
|
)
|
||||||
# Get for the destination share server.
|
# Get for the destination share server.
|
||||||
dest_server_id = self._get_share_server_destination_for_migration(
|
dest_server_id = self._get_share_server_destination_for_migration(
|
||||||
src_server_id)
|
src_server_id)
|
||||||
|
@ -362,8 +370,10 @@ class ShareServerMigrationBasicNFS(MigrationShareServerBase):
|
||||||
|
|
||||||
# It's necessary wait for the destination server went to active status.
|
# It's necessary wait for the destination server went to active status.
|
||||||
expected_status = constants.SERVER_STATE_ACTIVE
|
expected_status = constants.SERVER_STATE_ACTIVE
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, dest_server_id, expected_status)
|
self.shares_v2_client, dest_server_id, expected_status,
|
||||||
|
resource_name='share_server'
|
||||||
|
)
|
||||||
|
|
||||||
# Check if the source server went to inactive status if it exists.
|
# Check if the source server went to inactive status if it exists.
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -246,11 +246,12 @@ class ShareServerMigrationStartNegativesNFS(MigrationShareServerNegative):
|
||||||
def resource_cleanup(cls):
|
def resource_cleanup(cls):
|
||||||
states = [constants.TASK_STATE_MIGRATION_DRIVER_IN_PROGRESS,
|
states = [constants.TASK_STATE_MIGRATION_DRIVER_IN_PROGRESS,
|
||||||
constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE]
|
constants.TASK_STATE_MIGRATION_DRIVER_PHASE1_DONE]
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
cls.shares_v2_client, cls.server_id, status=states,
|
cls.shares_v2_client, cls.server_id, states,
|
||||||
|
resource_name="share_server",
|
||||||
status_attr="task_state")
|
status_attr="task_state")
|
||||||
cls.shares_v2_client.share_server_migration_cancel(cls.server_id)
|
cls.shares_v2_client.share_server_migration_cancel(cls.server_id)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
cls.shares_v2_client, cls.share['id'], status="available")
|
cls.shares_v2_client, cls.share['id'], status="available")
|
||||||
super(ShareServerMigrationStartNegativesNFS, cls).resource_cleanup()
|
super(ShareServerMigrationStartNegativesNFS, cls).resource_cleanup()
|
||||||
|
|
||||||
|
|
|
@ -129,8 +129,9 @@ class ShareSnapshotInstancesTest(base.BaseSharesAdminTest):
|
||||||
for status in ("error", "available"):
|
for status in ("error", "available"):
|
||||||
self.shares_v2_client.reset_snapshot_instance_status(
|
self.shares_v2_client.reset_snapshot_instance_status(
|
||||||
sii, status=status)
|
sii, status=status)
|
||||||
waiters.wait_for_snapshot_instance_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, sii, expected_status=status)
|
self.shares_v2_client, sii, status,
|
||||||
|
resource_name='snapshot_instance')
|
||||||
self.shares_v2_client.delete_snapshot(snapshot['id'])
|
self.shares_v2_client.delete_snapshot(snapshot['id'])
|
||||||
self.shares_v2_client.wait_for_resource_deletion(
|
self.shares_v2_client.wait_for_resource_deletion(
|
||||||
snapshot_id=snapshot['id'])
|
snapshot_id=snapshot['id'])
|
||||||
|
|
|
@ -234,7 +234,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
|
||||||
share = self.create_share(
|
share = self.create_share(
|
||||||
name=share_name, share_type_id=st_create["share_type"]["id"])
|
name=share_name, share_type_id=st_create["share_type"]["id"])
|
||||||
self.assertEqual(share["name"], share_name)
|
self.assertEqual(share["name"], share_name)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, share["id"], "available")
|
self.shares_client, share["id"], "available")
|
||||||
|
|
||||||
# Verify share info
|
# Verify share info
|
||||||
|
|
|
@ -100,8 +100,9 @@ class ManageNFSSnapshotTest(base.BaseSharesAdminTest):
|
||||||
'client': self.shares_v2_client})
|
'client': self.shares_v2_client})
|
||||||
|
|
||||||
# Wait for success
|
# Wait for success
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, snapshot['id'], constants.STATUS_AVAILABLE
|
self.shares_v2_client, snapshot['id'], constants.STATUS_AVAILABLE,
|
||||||
|
resource_name='snapshot'
|
||||||
)
|
)
|
||||||
|
|
||||||
# Verify manage snapshot API response
|
# Verify manage snapshot API response
|
||||||
|
|
|
@ -121,9 +121,9 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
|
||||||
'invalid_provider_location',
|
'invalid_provider_location',
|
||||||
driver_options={}
|
driver_options={}
|
||||||
)
|
)
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, invalid_snap['id'],
|
self.shares_v2_client, invalid_snap['id'],
|
||||||
constants.STATUS_MANAGE_ERROR
|
constants.STATUS_MANAGE_ERROR, resource_name='snapshot'
|
||||||
)
|
)
|
||||||
self.shares_v2_client.unmanage_snapshot(invalid_snap['id'])
|
self.shares_v2_client.unmanage_snapshot(invalid_snap['id'])
|
||||||
|
|
||||||
|
@ -132,9 +132,9 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
|
||||||
self.share['id'],
|
self.share['id'],
|
||||||
snap['provider_location']
|
snap['provider_location']
|
||||||
)
|
)
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, managed_snap['id'],
|
self.shares_v2_client, managed_snap['id'],
|
||||||
constants.STATUS_AVAILABLE
|
constants.STATUS_AVAILABLE, resource_name='snapshot'
|
||||||
)
|
)
|
||||||
self._delete_snapshot_and_wait(managed_snap)
|
self._delete_snapshot_and_wait(managed_snap)
|
||||||
|
|
||||||
|
|
|
@ -481,7 +481,7 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
client = d["kwargs"]["client"]
|
client = d["kwargs"]["client"]
|
||||||
share_id = d["share"]["id"]
|
share_id = d["share"]["id"]
|
||||||
try:
|
try:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
client, share_id, "available")
|
client, share_id, "available")
|
||||||
d["available"] = True
|
d["available"] = True
|
||||||
except (share_exceptions.ShareBuildErrorException,
|
except (share_exceptions.ShareBuildErrorException,
|
||||||
|
@ -541,8 +541,9 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
else:
|
else:
|
||||||
cls.method_resources.insert(0, resource)
|
cls.method_resources.insert(0, resource)
|
||||||
|
|
||||||
waiters.wait_for_share_group_status(
|
waiters.wait_for_resource_status(
|
||||||
client, share_group['id'], 'available')
|
client, share_group['id'], 'available',
|
||||||
|
resource_name='share_group')
|
||||||
return share_group
|
return share_group
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -591,7 +592,8 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
cls.class_resources.insert(0, resource)
|
cls.class_resources.insert(0, resource)
|
||||||
else:
|
else:
|
||||||
cls.method_resources.insert(0, resource)
|
cls.method_resources.insert(0, resource)
|
||||||
waiters.wait_for_snapshot_status(client, snapshot["id"], "available")
|
waiters.wait_for_resource_status(client, snapshot["id"], "available",
|
||||||
|
resource_name='snapshot')
|
||||||
return snapshot
|
return snapshot
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -612,8 +614,9 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
cls.class_resources.insert(0, resource)
|
cls.class_resources.insert(0, resource)
|
||||||
else:
|
else:
|
||||||
cls.method_resources.insert(0, resource)
|
cls.method_resources.insert(0, resource)
|
||||||
waiters.wait_for_share_group_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
client, sg_snapshot["id"], "available")
|
client, sg_snapshot["id"], "available",
|
||||||
|
resource_name="share_group_snapshot")
|
||||||
return sg_snapshot
|
return sg_snapshot
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -699,8 +702,9 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
cls.class_resources.insert(0, resource)
|
cls.class_resources.insert(0, resource)
|
||||||
else:
|
else:
|
||||||
cls.method_resources.insert(0, resource)
|
cls.method_resources.insert(0, resource)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
client, replica["id"], constants.STATUS_AVAILABLE)
|
client, replica["id"], constants.STATUS_AVAILABLE,
|
||||||
|
resource_name='share_replica')
|
||||||
return replica
|
return replica
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -718,9 +722,9 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
version=CONF.share.max_api_microversion):
|
version=CONF.share.max_api_microversion):
|
||||||
client = client or cls.shares_v2_client
|
client = client or cls.shares_v2_client
|
||||||
replica = client.promote_share_replica(replica_id, version=version)
|
replica = client.promote_share_replica(replica_id, version=version)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
client, replica["id"], constants.REPLICATION_STATE_ACTIVE,
|
client, replica["id"], constants.REPLICATION_STATE_ACTIVE,
|
||||||
status_attr="replica_state")
|
resource_name='share_replica', status_attr="replica_state")
|
||||||
return replica
|
return replica
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -1086,7 +1090,7 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
'share_network_id': self.shares_v2_client.share_network_id}
|
'share_network_id': self.shares_v2_client.share_network_id}
|
||||||
share = self.shares_v2_client.create_share(**params)
|
share = self.shares_v2_client.create_share(**params)
|
||||||
self.addCleanup(self.shares_v2_client.delete_share, share['id'])
|
self.addCleanup(self.shares_v2_client.delete_share, share['id'])
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], "error")
|
self.shares_v2_client, share['id'], "error")
|
||||||
return waiters.wait_for_message(self.shares_v2_client, share['id'])
|
return waiters.wait_for_message(self.shares_v2_client, share['id'])
|
||||||
|
|
||||||
|
@ -1101,8 +1105,10 @@ class BaseSharesTest(test.BaseTestCase):
|
||||||
|
|
||||||
rule = client.create_access_rule(share_id, access_type, access_to,
|
rule = client.create_access_rule(share_id, access_type, access_to,
|
||||||
access_level)
|
access_level)
|
||||||
waiters.wait_for_access_rule_status(client, share_id, rule['id'],
|
waiters.wait_for_resource_status(
|
||||||
status, raise_rule_in_error_state)
|
client, share_id, status, resource_name='access_rule',
|
||||||
|
rule_id=rule['id'],
|
||||||
|
raise_rule_in_error_state=raise_rule_in_error_state)
|
||||||
if cleanup:
|
if cleanup:
|
||||||
self.addCleanup(client.wait_for_resource_deletion,
|
self.addCleanup(client.wait_for_resource_deletion,
|
||||||
rule_id=rule['id'], share_id=share_id)
|
rule_id=rule['id'], share_id=share_id)
|
||||||
|
@ -1184,7 +1190,7 @@ class BaseSharesAdminTest(BaseSharesTest):
|
||||||
description=description,
|
description=description,
|
||||||
share_server_id=share_server_id
|
share_server_id=share_server_id
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, managed_share['id'],
|
self.shares_v2_client, managed_share['id'],
|
||||||
constants.STATUS_AVAILABLE
|
constants.STATUS_AVAILABLE
|
||||||
)
|
)
|
||||||
|
@ -1206,9 +1212,9 @@ class BaseSharesAdminTest(BaseSharesTest):
|
||||||
params.get('identifier', share_server['identifier']),
|
params.get('identifier', share_server['identifier']),
|
||||||
share_network_subnet_id=subnet_id,
|
share_network_subnet_id=subnet_id,
|
||||||
)
|
)
|
||||||
waiters.wait_for_share_server_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, managed_share_server['id'],
|
self.shares_v2_client, managed_share_server['id'],
|
||||||
constants.SERVER_STATE_ACTIVE,
|
constants.SERVER_STATE_ACTIVE, resource_name='share_server'
|
||||||
)
|
)
|
||||||
|
|
||||||
return managed_share_server
|
return managed_share_server
|
||||||
|
|
|
@ -87,7 +87,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
|
||||||
self.access_to[self.access_type].pop(), 'rw', metadata=data)
|
self.access_to[self.access_type].pop(), 'rw', metadata=data)
|
||||||
|
|
||||||
# read metadata
|
# read metadata
|
||||||
get_access = self.shares_v2_client.get_access(access["id"])
|
get_access = self.shares_v2_client.get_access_rule(access["id"])
|
||||||
|
|
||||||
# verify metadata
|
# verify metadata
|
||||||
self.assertEqual(data, get_access['metadata'])
|
self.assertEqual(data, get_access['metadata'])
|
||||||
|
@ -97,7 +97,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
|
||||||
self.shares_v2_client.delete_access_metadata(access["id"], key)
|
self.shares_v2_client.delete_access_metadata(access["id"], key)
|
||||||
|
|
||||||
# verify deletion of metadata
|
# verify deletion of metadata
|
||||||
access_without_md = self.shares_v2_client.get_access(access["id"])
|
access_without_md = self.shares_v2_client.get_access_rule(access["id"])
|
||||||
self.assertEqual({}, access_without_md['metadata'])
|
self.assertEqual({}, access_without_md['metadata'])
|
||||||
self.shares_v2_client.delete_access_rule(self.share["id"],
|
self.shares_v2_client.delete_access_rule(self.share["id"],
|
||||||
access["id"])
|
access["id"])
|
||||||
|
@ -113,7 +113,7 @@ class AccessRulesMetadataTest(base.BaseSharesMixedTest):
|
||||||
self.shares_v2_client.update_access_metadata(
|
self.shares_v2_client.update_access_metadata(
|
||||||
access_id=self.access['id'], metadata=md2)
|
access_id=self.access['id'], metadata=md2)
|
||||||
# get metadata
|
# get metadata
|
||||||
get_access = self.shares_v2_client.get_access(self.access['id'])
|
get_access = self.shares_v2_client.get_access_rule(self.access['id'])
|
||||||
|
|
||||||
# verify metadata
|
# verify metadata
|
||||||
self.md1.update(md2)
|
self.md1.update(md2)
|
||||||
|
|
|
@ -130,9 +130,10 @@ class ReplicationTest(base.BaseSharesMixedTest):
|
||||||
replica = self.create_share_replica(share["id"], self.replica_zone,
|
replica = self.create_share_replica(share["id"], self.replica_zone,
|
||||||
cleanup=False)
|
cleanup=False)
|
||||||
# Wait for replica state to update after creation
|
# Wait for replica state to update after creation
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, replica['id'],
|
self.shares_v2_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
# Promote the first in_sync replica to active state
|
# Promote the first in_sync replica to active state
|
||||||
promoted_replica = self.promote_share_replica(replica['id'])
|
promoted_replica = self.promote_share_replica(replica['id'])
|
||||||
# Delete the demoted replica so promoted replica can be cleaned
|
# Delete the demoted replica so promoted replica can be cleaned
|
||||||
|
@ -192,15 +193,16 @@ class ReplicationTest(base.BaseSharesMixedTest):
|
||||||
access_type, access_to = self._get_access_rule_data_from_config()
|
access_type, access_to = self._get_access_rule_data_from_config()
|
||||||
rule = self.shares_v2_client.create_access_rule(
|
rule = self.shares_v2_client.create_access_rule(
|
||||||
self.shares[0]["id"], access_type, access_to, 'ro')
|
self.shares[0]["id"], access_type, access_to, 'ro')
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.shares[0]["id"], rule["id"],
|
self.shares_v2_client, self.shares[0]["id"],
|
||||||
constants.RULE_STATE_ACTIVE)
|
constants.RULE_STATE_ACTIVE, resource_name='access_rule',
|
||||||
|
rule_id=rule["id"])
|
||||||
|
|
||||||
# Create the replica
|
# Create the replica
|
||||||
self._verify_create_replica()
|
self._verify_create_replica()
|
||||||
|
|
||||||
# Verify access_rules_status transitions to 'active' state.
|
# Verify access_rules_status transitions to 'active' state.
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.shares[0]["id"],
|
self.shares_v2_client, self.shares[0]["id"],
|
||||||
constants.RULE_STATE_ACTIVE, status_attr='access_rules_status')
|
constants.RULE_STATE_ACTIVE, status_attr='access_rules_status')
|
||||||
|
|
||||||
|
@ -221,7 +223,7 @@ class ReplicationTest(base.BaseSharesMixedTest):
|
||||||
self.shares_v2_client.create_access_rule(
|
self.shares_v2_client.create_access_rule(
|
||||||
self.shares[0]["id"], access_type, access_to, 'ro')
|
self.shares[0]["id"], access_type, access_to, 'ro')
|
||||||
|
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.shares[0]["id"],
|
self.shares_v2_client, self.shares[0]["id"],
|
||||||
constants.RULE_STATE_ACTIVE, status_attr='access_rules_status')
|
constants.RULE_STATE_ACTIVE, status_attr='access_rules_status')
|
||||||
|
|
||||||
|
@ -281,9 +283,9 @@ class ReplicationTest(base.BaseSharesMixedTest):
|
||||||
access_type, access_to = self._get_access_rule_data_from_config()
|
access_type, access_to = self._get_access_rule_data_from_config()
|
||||||
rule = self.shares_v2_client.create_access_rule(
|
rule = self.shares_v2_client.create_access_rule(
|
||||||
share["id"], access_type, access_to, 'ro')
|
share["id"], access_type, access_to, 'ro')
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share["id"], rule["id"],
|
self.shares_v2_client, share["id"], constants.RULE_STATE_ACTIVE,
|
||||||
constants.RULE_STATE_ACTIVE)
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
|
|
||||||
original_replica = self.shares_v2_client.list_share_replicas(
|
original_replica = self.shares_v2_client.list_share_replicas(
|
||||||
share["id"])[0]
|
share["id"])[0]
|
||||||
|
@ -340,23 +342,26 @@ class ReplicationTest(base.BaseSharesMixedTest):
|
||||||
new_replica = self.create_share_replica(share["id"],
|
new_replica = self.create_share_replica(share["id"],
|
||||||
self.replica_zone,
|
self.replica_zone,
|
||||||
cleanup_in_class=False)
|
cleanup_in_class=False)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, new_replica['id'],
|
self.shares_v2_client, new_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# Promote the new replica to active and verify the replica states
|
# Promote the new replica to active and verify the replica states
|
||||||
self.promote_share_replica(new_replica['id'])
|
self.promote_share_replica(new_replica['id'])
|
||||||
self._verify_active_replica_count(share["id"])
|
self._verify_active_replica_count(share["id"])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, original_replica['id'],
|
self.shares_v2_client, original_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# Promote the original replica back to active
|
# Promote the original replica back to active
|
||||||
self.promote_share_replica(original_replica['id'])
|
self.promote_share_replica(original_replica['id'])
|
||||||
self._verify_active_replica_count(share["id"])
|
self._verify_active_replica_count(share["id"])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, new_replica['id'],
|
self.shares_v2_client, new_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
@decorators.idempotent_id('1452156b-75a5-4f3c-a921-834732a03b0a')
|
@decorators.idempotent_id('1452156b-75a5-4f3c-a921-834732a03b0a')
|
||||||
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
|
@tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
|
||||||
|
|
|
@ -152,9 +152,10 @@ class ReplicationExportLocationsTest(base.BaseSharesMixedTest):
|
||||||
)
|
)
|
||||||
primary_replica = self.shares_v2_client.get_share_replica(
|
primary_replica = self.shares_v2_client.get_share_replica(
|
||||||
primary_replica_exports[0]['share_instance_id'])
|
primary_replica_exports[0]['share_instance_id'])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, replica['id'],
|
self.shares_v2_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# Share export locations list API
|
# Share export locations list API
|
||||||
share_exports = self.shares_v2_client.list_share_export_locations(
|
share_exports = self.shares_v2_client.list_share_export_locations(
|
||||||
|
|
|
@ -147,10 +147,10 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
|
||||||
# Set replica state to out of sync
|
# Set replica state to out of sync
|
||||||
self.admin_client.reset_share_replica_state(
|
self.admin_client.reset_share_replica_state(
|
||||||
replica['id'], constants.REPLICATION_STATE_OUT_OF_SYNC)
|
replica['id'], constants.REPLICATION_STATE_OUT_OF_SYNC)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, replica['id'],
|
self.shares_v2_client, replica['id'],
|
||||||
constants.REPLICATION_STATE_OUT_OF_SYNC,
|
constants.REPLICATION_STATE_OUT_OF_SYNC,
|
||||||
status_attr='replica_state')
|
resource_name='share_replica', status_attr='replica_state')
|
||||||
# Try promoting the first out_of_sync replica to active state
|
# Try promoting the first out_of_sync replica to active state
|
||||||
self.assertRaises(lib_exc.Forbidden,
|
self.assertRaises(lib_exc.Forbidden,
|
||||||
self.shares_v2_client.promote_share_replica,
|
self.shares_v2_client.promote_share_replica,
|
||||||
|
@ -177,9 +177,10 @@ class ReplicationNegativeTest(ReplicationNegativeBase):
|
||||||
replica = self.create_share_replica(share["id"], self.replica_zone,
|
replica = self.create_share_replica(share["id"], self.replica_zone,
|
||||||
cleanup_in_class=False)
|
cleanup_in_class=False)
|
||||||
# By default, 'writable' replica is expected to be in active state
|
# By default, 'writable' replica is expected to be in active state
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, replica["id"],
|
self.shares_v2_client, replica["id"],
|
||||||
constants.REPLICATION_STATE_ACTIVE, status_attr='replica_state')
|
constants.REPLICATION_STATE_ACTIVE, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# Try promoting the replica
|
# Try promoting the replica
|
||||||
self.shares_v2_client.promote_share_replica(replica['id'])
|
self.shares_v2_client.promote_share_replica(replica['id'])
|
||||||
|
|
|
@ -87,9 +87,10 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
|
||||||
self.replica_zone,
|
self.replica_zone,
|
||||||
cleanup=False)
|
cleanup=False)
|
||||||
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
snapshot = self.create_snapshot_wait_for_active(share["id"])
|
snapshot = self.create_snapshot_wait_for_active(share["id"])
|
||||||
self.promote_share_replica(share_replica['id'])
|
self.promote_share_replica(share_replica['id'])
|
||||||
|
@ -123,13 +124,15 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
|
||||||
self.replica_zone,
|
self.replica_zone,
|
||||||
cleanup=False)
|
cleanup=False)
|
||||||
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
# Wait for snapshot1 to become available
|
# Wait for snapshot1 to become available
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, snapshot['id'], "available")
|
self.shares_v2_client, snapshot['id'], "available",
|
||||||
|
resource_name='snapshot')
|
||||||
|
|
||||||
self.promote_share_replica(share_replica['id'])
|
self.promote_share_replica(share_replica['id'])
|
||||||
self.delete_share_replica(original_replica['id'])
|
self.delete_share_replica(original_replica['id'])
|
||||||
|
@ -163,15 +166,17 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
|
||||||
self.replica_zone,
|
self.replica_zone,
|
||||||
cleanup=False)
|
cleanup=False)
|
||||||
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
snapshot2 = self.create_snapshot_wait_for_active(share["id"])
|
snapshot2 = self.create_snapshot_wait_for_active(share["id"])
|
||||||
|
|
||||||
# Wait for snapshot1 to become available
|
# Wait for snapshot1 to become available
|
||||||
waiters.wait_for_snapshot_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, snapshot1['id'], "available")
|
self.shares_v2_client, snapshot1['id'], "available",
|
||||||
|
resource_name='snapshot')
|
||||||
|
|
||||||
self.promote_share_replica(share_replica['id'])
|
self.promote_share_replica(share_replica['id'])
|
||||||
# Remove the original active replica to ensure that snapshot is
|
# Remove the original active replica to ensure that snapshot is
|
||||||
|
@ -206,9 +211,10 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
|
||||||
share_network_id=self.sn_id)
|
share_network_id=self.sn_id)
|
||||||
share_replica = self.create_share_replica(share["id"],
|
share_replica = self.create_share_replica(share["id"],
|
||||||
self.replica_zone)
|
self.replica_zone)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
snapshot = self.create_snapshot_wait_for_active(share["id"])
|
snapshot = self.create_snapshot_wait_for_active(share["id"])
|
||||||
self.shares_v2_client.delete_snapshot(snapshot['id'])
|
self.shares_v2_client.delete_snapshot(snapshot['id'])
|
||||||
self.shares_v2_client.wait_for_resource_deletion(
|
self.shares_v2_client.wait_for_resource_deletion(
|
||||||
|
@ -235,9 +241,10 @@ class ReplicationSnapshotTest(base.BaseSharesMixedTest):
|
||||||
self.replica_zone,
|
self.replica_zone,
|
||||||
cleanup=False)
|
cleanup=False)
|
||||||
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
self.addCleanup(self.delete_share_replica, original_replica['id'])
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
self.promote_share_replica(share_replica['id'])
|
self.promote_share_replica(share_replica['id'])
|
||||||
# Delete the demoted replica so promoted replica can be cleaned
|
# Delete the demoted replica so promoted replica can be cleaned
|
||||||
# during the cleanup
|
# during the cleanup
|
||||||
|
|
|
@ -116,7 +116,7 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
|
||||||
self.share['id'],
|
self.share['id'],
|
||||||
snapshot['id'],
|
snapshot['id'],
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share['id'],
|
self.shares_v2_client, self.share['id'],
|
||||||
constants.STATUS_AVAILABLE)
|
constants.STATUS_AVAILABLE)
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
|
||||||
self.shares_v2_client.revert_to_snapshot(self.share['id'],
|
self.shares_v2_client.revert_to_snapshot(self.share['id'],
|
||||||
snapshot1['id'],
|
snapshot1['id'],
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share['id'],
|
self.shares_v2_client, self.share['id'],
|
||||||
constants.STATUS_AVAILABLE)
|
constants.STATUS_AVAILABLE)
|
||||||
|
|
||||||
|
@ -161,9 +161,10 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
|
||||||
|
|
||||||
share_replica = self.create_share_replica(share["id"],
|
share_replica = self.create_share_replica(share["id"],
|
||||||
self.replica_zone)
|
self.replica_zone)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
||||||
snapshot = self.create_snapshot_wait_for_active(share["id"])
|
snapshot = self.create_snapshot_wait_for_active(share["id"])
|
||||||
|
|
||||||
|
@ -171,8 +172,9 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest):
|
||||||
share['id'],
|
share['id'],
|
||||||
snapshot['id'],
|
snapshot['id'],
|
||||||
version=version)
|
version=version)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
||||||
waiters.wait_for_share_replica_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_replica['id'],
|
self.shares_v2_client, share_replica['id'],
|
||||||
constants.REPLICATION_STATE_IN_SYNC, status_attr='replica_state')
|
constants.REPLICATION_STATE_IN_SYNC, resource_name='share_replica',
|
||||||
|
status_attr='replica_state')
|
||||||
|
|
|
@ -56,10 +56,11 @@ def _create_delete_ro_access_rule(self, version):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_le(version, '2.9'):
|
if utils.is_microversion_le(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
# If the 'access_rules_status' transitions to 'active',
|
# If the 'access_rules_status' transitions to 'active',
|
||||||
|
@ -138,13 +139,15 @@ class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -191,13 +194,15 @@ class ShareIpRulesForNFSTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -292,13 +297,15 @@ class ShareUserRulesForNFSTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -394,13 +401,15 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -442,13 +451,15 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -507,8 +518,9 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual(access_level, rule['access_level'])
|
self.assertEqual(access_level, rule['access_level'])
|
||||||
for key in ('deleted', 'deleted_at', 'instance_mappings'):
|
for key in ('deleted', 'deleted_at', 'instance_mappings'):
|
||||||
self.assertNotIn(key, rule.keys())
|
self.assertNotIn(key, rule.keys())
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
|
|
||||||
self.shares_v2_client.delete_access_rule(
|
self.shares_v2_client.delete_access_rule(
|
||||||
self.share["id"], rule["id"], version=version)
|
self.share["id"], rule["id"], version=version)
|
||||||
|
@ -521,8 +533,9 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesMixedTest):
|
||||||
# Grant access to the share
|
# Grant access to the share
|
||||||
access1 = self.shares_v2_client.create_access_rule(
|
access1 = self.shares_v2_client.create_access_rule(
|
||||||
self.share['id'], self.access_type, self.access_to, 'rw')
|
self.share['id'], self.access_type, self.access_to, 'rw')
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share['id'], access1['id'], 'active')
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=access1["id"])
|
||||||
|
|
||||||
# Create a new user in the current project
|
# Create a new user in the current project
|
||||||
project = self.os_admin.projects_client.show_project(
|
project = self.os_admin.projects_client.show_project(
|
||||||
|
@ -538,9 +551,9 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesMixedTest):
|
||||||
# used in access1
|
# used in access1
|
||||||
access2 = user_client.shares_v2_client.create_access_rule(
|
access2 = user_client.shares_v2_client.create_access_rule(
|
||||||
share2['id'], self.access_type, self.access_to, 'rw')
|
share2['id'], self.access_type, self.access_to, 'rw')
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
user_client.shares_v2_client, share2['id'], access2['id'],
|
user_client.shares_v2_client, share2['id'], "active",
|
||||||
'active')
|
resource_name='access_rule', rule_id=access2['id'])
|
||||||
|
|
||||||
|
|
||||||
@ddt.ddt
|
@ddt.ddt
|
||||||
|
@ -616,13 +629,15 @@ class ShareRulesTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name="access_rule", rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name="access_rule", rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -701,13 +716,15 @@ class ShareRulesTest(base.BaseSharesMixedTest):
|
||||||
self.assertEqual("queued_to_apply", rule['state'])
|
self.assertEqual("queued_to_apply", rule['state'])
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name="access_rule", rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name="access_rule", rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share["id"], "active",
|
self.shares_v2_client, share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
|
|
@ -104,13 +104,15 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
|
||||||
self.share["id"], access_type, access_to, version=version)
|
self.share["id"], access_type, access_to, version=version)
|
||||||
|
|
||||||
if utils.is_microversion_eq(version, '1.0'):
|
if utils.is_microversion_eq(version, '1.0'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, self.share["id"], rule["id"], "active")
|
self.shares_client, self.share["id"], "active",
|
||||||
|
resource_name='access_rule', rule_id=rule["id"])
|
||||||
elif utils.is_microversion_eq(version, '2.9'):
|
elif utils.is_microversion_eq(version, '2.9'):
|
||||||
waiters.wait_for_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], rule["id"], "active")
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
|
resource_name="access_rule", rule_id=rule["id"])
|
||||||
else:
|
else:
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status', version=version)
|
status_attr='access_rules_status', version=version)
|
||||||
|
|
||||||
|
@ -154,7 +156,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
|
||||||
self.share["id"], "ip", access_to)
|
self.share["id"], "ip", access_to)
|
||||||
self.addCleanup(self.shares_v2_client.delete_access_rule,
|
self.addCleanup(self.shares_v2_client.delete_access_rule,
|
||||||
self.share["id"], rule['id'])
|
self.share["id"], rule['id'])
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.share["id"], "active",
|
self.shares_v2_client, self.share["id"], "active",
|
||||||
status_attr='access_rules_status')
|
status_attr='access_rules_status')
|
||||||
|
|
||||||
|
@ -186,7 +188,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesMixedTest):
|
||||||
share = self.create_share(share_type_id=share_type['id'],
|
share = self.create_share(share_type_id=share_type['id'],
|
||||||
cleanup_in_class=False,
|
cleanup_in_class=False,
|
||||||
wait_for_status=False)
|
wait_for_status=False)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.STATUS_ERROR)
|
self.shares_v2_client, share['id'], constants.STATUS_ERROR)
|
||||||
self.assertRaises(lib_exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
self.admin_client.create_access_rule,
|
self.admin_client.create_access_rule,
|
||||||
|
@ -460,7 +462,7 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesMixedTest):
|
||||||
# Check share's access_rules_status has transitioned to "active" status
|
# Check share's access_rules_status has transitioned to "active" status
|
||||||
self.alt_shares_v2_client.delete_access_rule(
|
self.alt_shares_v2_client.delete_access_rule(
|
||||||
share_alt['id'], rule1['id'])
|
share_alt['id'], rule1['id'])
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.alt_shares_v2_client, share_alt['id'], 'active',
|
self.alt_shares_v2_client, share_alt['id'], 'active',
|
||||||
status_attr='access_rules_status')
|
status_attr='access_rules_status')
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
|
||||||
|
|
||||||
# Create a share into the share network
|
# Create a share into the share network
|
||||||
share = self.shares_v2_client.create_share(**args)
|
share = self.shares_v2_client.create_share(**args)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
||||||
share = self.shares_v2_client.get_share(share['id'])
|
share = self.shares_v2_client.get_share(share['id'])
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Do some necessary cleanup
|
# Do some necessary cleanup
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, managed_share['id'],
|
self.shares_v2_client, managed_share['id'],
|
||||||
constants.STATUS_AVAILABLE)
|
constants.STATUS_AVAILABLE)
|
||||||
self.shares_client.delete_share(managed_share['id'])
|
self.shares_client.delete_share(managed_share['id'])
|
||||||
|
@ -256,7 +256,7 @@ class ShareNetworkSubnetsNegativeTest(base.BaseSharesAdminTest):
|
||||||
|
|
||||||
# Create a share into the share network
|
# Create a share into the share network
|
||||||
share = self.shares_v2_client.create_share(**args)
|
share = self.shares_v2_client.create_share(**args)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
self.shares_v2_client, share['id'], constants.STATUS_AVAILABLE)
|
||||||
share = self.admin_shares_v2_client.get_share(share['id'])
|
share = self.admin_shares_v2_client.get_share(share['id'])
|
||||||
share_server = self.admin_shares_v2_client.show_share_server(
|
share_server = self.admin_shares_v2_client.show_share_server(
|
||||||
|
|
|
@ -665,7 +665,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
|
||||||
|
|
||||||
# extend share and wait for active status
|
# extend share and wait for active status
|
||||||
self.shares_v2_client.extend_share(share['id'], new_size)
|
self.shares_v2_client.extend_share(share['id'], new_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, share['id'], 'available')
|
self.shares_client, share['id'], 'available')
|
||||||
|
|
||||||
# check state and new size
|
# check state and new size
|
||||||
|
@ -693,7 +693,7 @@ class SharesActionsTest(base.BaseSharesMixedTest):
|
||||||
|
|
||||||
# shrink share and wait for active status
|
# shrink share and wait for active status
|
||||||
self.shares_v2_client.shrink_share(share['id'], new_size)
|
self.shares_v2_client.shrink_share(share['id'], new_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_client, share['id'], 'available')
|
self.shares_client, share['id'], 'available')
|
||||||
|
|
||||||
# check state and new size
|
# check state and new size
|
||||||
|
|
|
@ -52,8 +52,10 @@ class BaseShareSnapshotRulesTest(base.BaseSharesMixedTest):
|
||||||
for key in ('deleted', 'deleted_at', 'instance_mappings'):
|
for key in ('deleted', 'deleted_at', 'instance_mappings'):
|
||||||
self.assertNotIn(key, list(six.iterkeys(rule)))
|
self.assertNotIn(key, list(six.iterkeys(rule)))
|
||||||
|
|
||||||
waiters.wait_for_snapshot_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.snapshot['id'], rule['id'])
|
self.shares_v2_client, self.snapshot['id'], 'active',
|
||||||
|
resource_name='snapshot_access_rule', rule_id=rule['id'],
|
||||||
|
status_attr='state')
|
||||||
|
|
||||||
# delete rule and wait for deletion
|
# delete rule and wait for deletion
|
||||||
self.shares_v2_client.delete_snapshot_access_rule(self.snapshot['id'],
|
self.shares_v2_client.delete_snapshot_access_rule(self.snapshot['id'],
|
||||||
|
|
|
@ -93,8 +93,10 @@ class SnapshotIpRulesForNFSNegativeTest(
|
||||||
rule = self.shares_v2_client.create_snapshot_access_rule(
|
rule = self.shares_v2_client.create_snapshot_access_rule(
|
||||||
self.snap['id'], access_type, access_to)
|
self.snap['id'], access_type, access_to)
|
||||||
|
|
||||||
waiters.wait_for_snapshot_access_rule_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, self.snap['id'], rule['id'])
|
self.shares_v2_client, self.snap['id'], 'active',
|
||||||
|
resource_name='snapshot_access_rule', rule_id=rule['id'],
|
||||||
|
status_attr='state')
|
||||||
|
|
||||||
# try create duplicate of rule
|
# try create duplicate of rule
|
||||||
self.assertRaises(lib_exc.BadRequest,
|
self.assertRaises(lib_exc.BadRequest,
|
||||||
|
|
|
@ -348,7 +348,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||||
"""
|
"""
|
||||||
client = client or self.shares_client
|
client = client or self.shares_client
|
||||||
client.delete_access_rule(share_id, access_rule_id)
|
client.delete_access_rule(share_id, access_rule_id)
|
||||||
share_waiters.wait_for_share_status(
|
share_waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share_id, "active",
|
self.shares_v2_client, share_id, "active",
|
||||||
status_attr='access_rules_status')
|
status_attr='access_rules_status')
|
||||||
|
|
||||||
|
@ -424,7 +424,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||||
client.update_access_metadata(
|
client.update_access_metadata(
|
||||||
metadata={"access_to": "{}".format(access_to)},
|
metadata={"access_to": "{}".format(access_to)},
|
||||||
access_id=access_rule['id'])
|
access_id=access_rule['id'])
|
||||||
get_access = client.get_access(access_rule['id'])
|
get_access = client.get_access_rule(access_rule['id'])
|
||||||
# Set 'access_key' and 'access_to' attributes for being use in mount
|
# Set 'access_key' and 'access_to' attributes for being use in mount
|
||||||
# operation.
|
# operation.
|
||||||
setattr(self, 'access_key', get_access['access_key'])
|
setattr(self, 'access_key', get_access['access_key'])
|
||||||
|
@ -533,7 +533,8 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||||
self.addCleanup(client.delete_share,
|
self.addCleanup(client.delete_share,
|
||||||
share['id'])
|
share['id'])
|
||||||
|
|
||||||
share_waiters.wait_for_share_status(client, share['id'], 'available')
|
share_waiters.wait_for_resource_status(client, share['id'],
|
||||||
|
'available')
|
||||||
return share
|
return share
|
||||||
|
|
||||||
def _create_snapshot(self, share_id, client=None, **kwargs):
|
def _create_snapshot(self, share_id, client=None, **kwargs):
|
||||||
|
@ -542,8 +543,8 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||||
self.addCleanup(
|
self.addCleanup(
|
||||||
client.wait_for_resource_deletion, snapshot_id=snapshot['id'])
|
client.wait_for_resource_deletion, snapshot_id=snapshot['id'])
|
||||||
self.addCleanup(client.delete_snapshot, snapshot['id'])
|
self.addCleanup(client.delete_snapshot, snapshot['id'])
|
||||||
share_waiters.wait_for_snapshot_status(
|
share_waiters.wait_for_resource_status(
|
||||||
client, snapshot["id"], "available")
|
client, snapshot["id"], "available", resource_name='snapshot')
|
||||||
return snapshot
|
return snapshot
|
||||||
|
|
||||||
def _wait_for_share_server_deletion(self, sn_id, client=None):
|
def _wait_for_share_server_deletion(self, sn_id, client=None):
|
||||||
|
@ -593,7 +594,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||||
access = client.create_access_rule(share_id, access_type, access_to,
|
access = client.create_access_rule(share_id, access_type, access_to,
|
||||||
access_level)
|
access_level)
|
||||||
|
|
||||||
share_waiters.wait_for_share_status(
|
share_waiters.wait_for_resource_status(
|
||||||
client, share_id, "active", status_attr='access_rules_status')
|
client, share_id, "active", status_attr='access_rules_status')
|
||||||
|
|
||||||
if cleanup:
|
if cleanup:
|
||||||
|
@ -619,8 +620,10 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
|
||||||
self.addCleanup(client.delete_snapshot_access_rule,
|
self.addCleanup(client.delete_snapshot_access_rule,
|
||||||
snapshot_id, access['id'])
|
snapshot_id, access['id'])
|
||||||
|
|
||||||
share_waiters.wait_for_snapshot_access_rule_status(
|
share_waiters.wait_for_resource_status(
|
||||||
client, snapshot_id, access['id'])
|
client, snapshot_id, 'active',
|
||||||
|
resource_name='snapshot_access_rule', rule_id=access['id'],
|
||||||
|
status_attr='state')
|
||||||
|
|
||||||
return access
|
return access
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class ShareExtendBase(manager.ShareScenarioTest):
|
||||||
extended_share_size = default_share_size + 1
|
extended_share_size = default_share_size + 1
|
||||||
self.shares_v2_client.extend_share(share["id"],
|
self.shares_v2_client.extend_share(share["id"],
|
||||||
new_size=extended_share_size)
|
new_size=extended_share_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share["id"], constants.STATUS_AVAILABLE)
|
self.shares_v2_client, share["id"], constants.STATUS_AVAILABLE)
|
||||||
share = self.shares_v2_client.get_share(share["id"])
|
share = self.shares_v2_client.get_share(share["id"])
|
||||||
self.assertEqual(extended_share_size, int(share["size"]))
|
self.assertEqual(extended_share_size, int(share["size"]))
|
||||||
|
|
|
@ -132,7 +132,7 @@ class ShareManageUnmanageBase(manager.ShareScenarioTest):
|
||||||
share['share_proto'],
|
share['share_proto'],
|
||||||
locations[0],
|
locations[0],
|
||||||
share_type['id'])
|
share_type['id'])
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_admin_v2_client, managed_share['id'], 'available')
|
self.shares_admin_v2_client, managed_share['id'], 'available')
|
||||||
|
|
||||||
LOG.debug('Step 11 - grant access again')
|
LOG.debug('Step 11 - grant access again')
|
||||||
|
@ -166,7 +166,7 @@ class ShareManageUnmanageBase(manager.ShareScenarioTest):
|
||||||
share['share_proto'],
|
share['share_proto'],
|
||||||
locations[0],
|
locations[0],
|
||||||
share_type['id'])
|
share_type['id'])
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_admin_v2_client, remanaged_share['id'], 'manage_error')
|
self.shares_admin_v2_client, remanaged_share['id'], 'manage_error')
|
||||||
|
|
||||||
self.shares_admin_v2_client.reset_state(remanaged_share['id'])
|
self.shares_admin_v2_client.reset_state(remanaged_share['id'])
|
||||||
|
|
|
@ -87,7 +87,7 @@ class ShareShrinkBase(manager.ShareScenarioTest):
|
||||||
LOG.debug('Step 8 - try update size, shrink and wait')
|
LOG.debug('Step 8 - try update size, shrink and wait')
|
||||||
self.shares_v2_client.shrink_share(share['id'],
|
self.shares_v2_client.shrink_share(share['id'],
|
||||||
new_size=default_share_size)
|
new_size=default_share_size)
|
||||||
waiters.wait_for_share_status(
|
waiters.wait_for_resource_status(
|
||||||
self.shares_v2_client, share['id'],
|
self.shares_v2_client, share['id'],
|
||||||
['shrinking_possible_data_loss_error', 'available'])
|
['shrinking_possible_data_loss_error', 'available'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue