Skip read-only test for CIFS

When using the CIFS protocol and trying to share a share by IP, the
share fails to instantiate and the manila service produces this error:

  InvalidShareAccessLevel: Invalid or unsupported share access level: ro.

There are no Manila Share backends that support CIFS shares with read
only access when authenticating with IP addresses[1]. This patch causes
the test to be skipped in such a case.

[1] https://docs.openstack.org/manila/latest/admin/share_back_ends_feature_support_mapping.html#mapping-of-share-drivers-and-share-access-rules-support

Change-Id: Ic30eaf3c2b7f75eb4bc62159faceb6bd30d7e03b
This commit is contained in:
Colleen Murphy 2019-06-07 15:00:48 -07:00 committed by Colleen Murphy
parent 2e4f3489f6
commit f38c4c3655
1 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,11 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
@tc.attr(base.TAG_NEGATIVE, base.TAG_BACKEND)
def test_write_with_ro_access(self):
'''Test if an instance with ro access can write on the share.'''
if self.protocol.upper() == 'CIFS':
msg = ("Skipped for CIFS protocol because RO access is not "
"supported for shares by IP.")
raise self.skipException(msg)
test_data = "Some test data to write"
instance = self.boot_instance(wait_until="BUILD")