Add new URLs for APIs ported from extensions
After port of extensions to core API we need to rename their URLs.
So, rename URLs and bump microversion for it.
Make new URLs work only with new microversion(s) 2.7+
and old with old microversions 1.0-2.6.
Add separate API router for v2 API as now we should split v1 and v2
logic.
Also, move updated APIs under v2 directory that will be used by both
API routers - v1 and v2.
List of updated collections is following:
- os-availability-zone -> availability-zones
- os-services -> services
- os-quota-sets -> quota-sets
- os-quota-class-sets -> quota-class-sets
- os-share-manage -> shares/manage
- os-share-unmanage -> shares/%s/action
List of updated member actions is following:
- os-share-unmanage/%(share_id)s/unmanage -> shares/%(share_id)s/action
- types/%(id)s/os-share-type-access -> types/%(id)s/share_type_access
List of updated action names is following:
- os-access_allow -> access_allow
- os-access_deny -> access_deny
- os-access_list -> access_list
- os-reset_status -> reset_status
- os-force_delete -> force_delete
- os-migrate_share -> migrate_share
- os-extend -> extend
- os-shrink -> shrink
List of updated attribute names is following:
- os-share-type-access -> share-type-access
Partially implements bp ext-to-core
Change-Id: I82f00114db985b4b3bf4db0a64191559508ac600
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index b2da080..de7c542 100644
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -26,6 +26,7 @@
from tempest import test
from tempest_lib.common.utils import data_utils
from tempest_lib import exceptions
+import testtools
from manila_tempest_tests import clients_share as clients
from manila_tempest_tests import share_exceptions
@@ -89,6 +90,21 @@
return wrapped_func
+def is_microversion_supported(microversion):
+ if (float(microversion) > float(CONF.share.max_api_microversion) or
+ float(microversion) < float(CONF.share.min_api_microversion)):
+ return False
+ return True
+
+
+def skip_if_microversion_not_supported(microversion):
+ """Decorator for tests that are microversion-specific."""
+ if not is_microversion_supported(microversion):
+ reason = ("Skipped. Test requires microversion '%s'." % microversion)
+ return testtools.skip(reason)
+ return lambda f: f
+
+
class BaseSharesTest(test.BaseTestCase):
"""Base test case class for all Manila API tests."""
@@ -107,6 +123,11 @@
# Will be cleaned up in tearDown method
method_isolated_creds = []
+ def skip_if_microversion_not_supported(self, microversion):
+ if not is_microversion_supported(microversion):
+ raise self.skipException(
+ "Microversion '%s' is not supported." % microversion)
+
@classmethod
def get_client_with_isolated_creds(cls,
name=None,
@@ -525,7 +546,7 @@
def create_share_type(cls, name, is_public=True, client=None,
cleanup_in_class=True, **kwargs):
if client is None:
- client = cls.shares_client
+ client = cls.shares_v2_client
share_type = client.create_share_type(name, is_public, **kwargs)
resource = {
"type": "share_type",