Browse Source

[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
tags/3.0.0^0
lkuchlan 2 months ago
parent
commit
cf00bfa46b
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      config_tempest/services/share.py

+ 14
- 6
config_tempest/services/share.py View File

@@ -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')



Loading…
Cancel
Save