Adds get default share type function
This patch set adds the get default share type
function to client used by our tempest tests.
Also leverages this new function to get the default
share type, instead of using the get share types
command which was breaking in case the default
share type name was different than "default"
Closes-Bug: #1905796
Change-Id: If3508cd17a8640e88b21110d1d61dc424b94709e
diff --git a/manila_tempest_tests/services/share/json/shares_client.py b/manila_tempest_tests/services/share/json/shares_client.py
index 87d7e47..3684cf4 100644
--- a/manila_tempest_tests/services/share/json/shares_client.py
+++ b/manila_tempest_tests/services/share/json/shares_client.py
@@ -637,6 +637,11 @@
self.expected_success(200, resp.status)
return self._parse_resp(body)
+ def get_default_share_type(self):
+ resp, body = self.get("types/default")
+ self.expected_success(200, resp.status)
+ return self._parse_resp(body)
+
def add_access_to_share_type(self, share_type_id, project_id):
uri = 'types/%s/action' % share_type_id
post_body = {'project': project_id}
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index fc03da3..84c87bd 100644
--- a/manila_tempest_tests/tests/scenario/manager_share.py
+++ b/manila_tempest_tests/tests/scenario/manager_share.py
@@ -452,8 +452,7 @@
def get_share_type(self):
if CONF.share.default_share_type_name:
- return self.shares_client.get_share_type(
- CONF.share.default_share_type_name)['share_type']
+ return self.shares_client.get_default_share_type()['share_type']
return self._create_share_type(
data_utils.rand_name("share_type"),
extra_specs={