Change public share tests

Manila changed the default RBAC policy
for public shares in the Stein release
but maintained compatibility to the older
expectation that regular/unprivileged
users could create public shares, or
modify private shares to become public [1].

This compatibility is being dropped [2]
So we must adjust the functional test
expectations here.

[1] https://review.opendev.org/634864
[2] https://review.opendev.org/776869

Depends-On: I6e7608be57de8987117f3f4ace018a7eb91c8bd2
Change-Id: I57111b676487fef0c82f749e90b165465151f0c1
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
This commit is contained in:
Goutham Pacha Ravi 2021-02-23 15:07:17 -08:00
parent 5285705e44
commit 9bc7cec016
3 changed files with 12 additions and 6 deletions

View File

@ -78,7 +78,15 @@ class SharesReadWriteBase(base.BaseTestCase):
self.assertEqual('False', create['is_public'])
self.user_client.update_share(
create['id'], new_name, new_description, True)
create['id'], name=new_name, description=new_description)
get = self.user_client.get_share(create['id'])
self.assertEqual(new_name, get['name'])
self.assertEqual(new_description, get['description'])
self.assertEqual('False', get['is_public'])
# only admins operating at system scope can set a share to be public
self.admin_client.update_share(create['id'], is_public=True)
get = self.user_client.get_share(create['id'])
self.assertEqual(new_name, get['name'])

View File

@ -144,11 +144,11 @@ class SharesListReadWriteTest(base.BaseTestCase):
name=self.public_name,
description=self.public_description,
public=True,
client=self.get_user_client())
client=self.admin_client)
for share_id in (self.private_share['id'], self.public_share['id'],
self.admin_private_share['id']):
self.get_admin_client().wait_for_resource_status(
self.admin_client.wait_for_resource_status(
share_id, constants.STATUS_AVAILABLE)
def _list_shares(self, filters=None):
@ -314,8 +314,7 @@ class SharesListReadWriteTest(base.BaseTestCase):
self.create_share(
name=u'共享名称',
description=u'共享描述',
public=True,
client=self.get_user_client())
client=self.user_client)
filters = {'name~': u'名称'}
shares = self.user_client.list_shares(filters=filters)
self.assertGreater(len(shares), 0)

View File

@ -38,7 +38,6 @@ class SnapshotAccessReadBase(base.BaseTestCase):
"snapshot access tests." % self.protocol)
self.share = self.create_share(share_protocol=self.protocol,
public=True,
client=self.get_user_client())
int_range = range(0, 10)