From cf00bfa46b27afe11d240d7e9351cd7c2412a6b7 Mon Sep 17 00:00:00 2001 From: lkuchlan Date: Sun, 24 May 2020 12:36:55 +0300 Subject: [PATCH] [share] Specify supported protocols Since Manila has a number of different storage protocols, manila-tempest-plugin uses 'enable_protocols' parameter for skipping unsupported tests. Currently, we override this parameter on each the job. Change-Id: Ib28820939d0f19136a942c356008fe7996969d43 --- config_tempest/services/share.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/config_tempest/services/share.py b/config_tempest/services/share.py index d14ce38a..ed1f87b1 100644 --- a/config_tempest/services/share.py +++ b/config_tempest/services/share.py @@ -23,8 +23,11 @@ from tempest.lib import exceptions class ShareService(VersionedService): - def get_share_pools(self): - body = self.do_get(self.service_url + '/scheduler-stats/pools') + def get_share_pools(self, detail=False): + url = self.service_url + '/scheduler-stats/pools' + if detail: + url += '/detail' + body = self.do_get(url) body = json.loads(body) return body @@ -35,16 +38,21 @@ class ShareService(VersionedService): conf.set('share', 'max_api_microversion', m_vs['max_microversion']) try: - pools = self.get_share_pools()['pools'] + pools = self.get_share_pools(detail=True)['pools'] except exceptions.Forbidden: C.LOG.warning("User has no permissions to list back-end storage " "pools - storage back-ends can't be discovered.") return if pools: - backends = [ - pool['backend'] for pool in pools - ] + backends = [] + enable_protocols = [] + for pool in pools: + backends.append(pool['backend']) + protocol = pool['capabilities']['storage_protocol'].lower() + enable_protocols.extend(protocol.split('_')) + conf.set('share', 'backend_names', ','.join(backends)) + conf.set('share', 'enable_protocols', ','.join(enable_protocols)) if len(backends) > 1: conf.set('share', 'multi_backend', 'True')