Fix CIFS access for non-multitenant setup

In the case that multitenancy_enabled is false, the CIFS tests fail,
first because the auxiliary access function returns None, which means
the access object cannot be used by the caller, and second because if a
floating IP address isn't chosen explicitly as the share point, the
server's fixed IP may be chosen which is not in the same segment as the
share server, which means the share will not be accessible. This patch
fixes both issues by making the auxiliary access granting function
consistent for both NFS and CIFS and differentiating instead on
multitenancy_enabled.

Change-Id: Id6a44ea8c6b88d121983566dbb176f48e470094f
This commit is contained in:
Colleen Murphy 2019-06-10 11:11:40 -07:00
parent 26e3ce1599
commit 2e4f3489f6
1 changed files with 2 additions and 7 deletions

View File

@ -311,11 +311,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
client=None):
share = share or self.share
client = client or self.shares_v2_client
if self.protocol.lower() == 'cifs':
self.allow_access_ip(
share['id'], instance=instance, cleanup=False,
snapshot=snapshot, access_level=access_level, client=client)
elif not CONF.share.multitenancy_enabled:
if not CONF.share.multitenancy_enabled:
if self.ipv6_enabled:
server_ip = self._get_ipv6_server_ip(instance)
else:
@ -326,8 +322,7 @@ class ShareScenarioTest(manager.NetworkScenarioTest):
share['id'], ip=server_ip,
instance=instance, cleanup=False, snapshot=snapshot,
access_level=access_level, client=client)
elif (CONF.share.multitenancy_enabled and
self.protocol.lower() == 'nfs'):
else:
return self.allow_access_ip(
share['id'], instance=instance, cleanup=False,
snapshot=snapshot, access_level=access_level, client=client)