Change the expected status response from Forbidden to NotFound
In some share metadata operations performed on a share resource in another project by member and reader users, the response code is 403/Forbidden but actually it should be 404/Not Found. Related-Bug: #2004230 Change-Id: I23f592aa0616dd000c91366056b19f73d4a92fa5
This commit is contained in:
parent
d6a4d27f49
commit
2c06e81bfd
@ -420,7 +420,7 @@ class TestProjectMemberTestsNFS(ShareRbacSharesTests, base.BaseSharesTest):
|
|||||||
alt_share = self.create_share(
|
alt_share = self.create_share(
|
||||||
self.alt_project_share_v2_client, self.share_type['id'])
|
self.alt_project_share_v2_client, self.share_type['id'])
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'reset_state', expected_status=lib_exc.NotFound,
|
'reset_state', expected_status=lib_exc.Forbidden,
|
||||||
s_id=alt_share['id'], status="error")
|
s_id=alt_share['id'], status="error")
|
||||||
|
|
||||||
@decorators.idempotent_id('56a07567-d0a9-460a-9267-fcd82306a371')
|
@decorators.idempotent_id('56a07567-d0a9-460a-9267-fcd82306a371')
|
||||||
@ -465,7 +465,7 @@ class TestProjectMemberTestsNFS(ShareRbacSharesTests, base.BaseSharesTest):
|
|||||||
alt_share = self.create_share(
|
alt_share = self.create_share(
|
||||||
self.alt_project_share_v2_client, self.share_type['id'])
|
self.alt_project_share_v2_client, self.share_type['id'])
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'set_metadata', expected_status=lib_exc.Forbidden,
|
'set_metadata', expected_status=lib_exc.NotFound,
|
||||||
resource_id=alt_share['id'], metadata={'key': 'value'})
|
resource_id=alt_share['id'], metadata={'key': 'value'})
|
||||||
|
|
||||||
@decorators.idempotent_id('a69a2b85-3374-4621-83a9-89937ddb520b')
|
@decorators.idempotent_id('a69a2b85-3374-4621-83a9-89937ddb520b')
|
||||||
@ -482,7 +482,7 @@ class TestProjectMemberTestsNFS(ShareRbacSharesTests, base.BaseSharesTest):
|
|||||||
self.alt_project_share_v2_client, self.share_type['id'],
|
self.alt_project_share_v2_client, self.share_type['id'],
|
||||||
metadata=metadata)
|
metadata=metadata)
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'get_metadata', expected_status=lib_exc.Forbidden,
|
'get_metadata', expected_status=lib_exc.NotFound,
|
||||||
resource_id=alt_share['id'])
|
resource_id=alt_share['id'])
|
||||||
|
|
||||||
@decorators.idempotent_id('bea5518a-338e-494d-9034-1d03658ed58b')
|
@decorators.idempotent_id('bea5518a-338e-494d-9034-1d03658ed58b')
|
||||||
@ -498,7 +498,7 @@ class TestProjectMemberTestsNFS(ShareRbacSharesTests, base.BaseSharesTest):
|
|||||||
self.alt_project_share_v2_client, self.share_type['id'],
|
self.alt_project_share_v2_client, self.share_type['id'],
|
||||||
metadata={'key': 'value'})
|
metadata={'key': 'value'})
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'delete_metadata', expected_status=lib_exc.Forbidden,
|
'delete_metadata', expected_status=lib_exc.NotFound,
|
||||||
resource_id=alt_share['id'], key='key')
|
resource_id=alt_share['id'], key='key')
|
||||||
|
|
||||||
|
|
||||||
@ -551,7 +551,7 @@ class TestProjectReaderTestsNFS(TestProjectMemberTestsNFS):
|
|||||||
alt_share = self.create_share(
|
alt_share = self.create_share(
|
||||||
self.alt_project_share_v2_client, self.share_type['id'])
|
self.alt_project_share_v2_client, self.share_type['id'])
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'delete_share', expected_status=lib_exc.NotFound,
|
'delete_share', expected_status=lib_exc.Forbidden,
|
||||||
share_id=alt_share['id'])
|
share_id=alt_share['id'])
|
||||||
|
|
||||||
@decorators.idempotent_id('cb040955-5897-409f-aea0-84b6ae16b77e')
|
@decorators.idempotent_id('cb040955-5897-409f-aea0-84b6ae16b77e')
|
||||||
@ -596,7 +596,7 @@ class TestProjectReaderTestsNFS(TestProjectMemberTestsNFS):
|
|||||||
self.alt_project_share_v2_client, self.share_type['id'],
|
self.alt_project_share_v2_client, self.share_type['id'],
|
||||||
size=CONF.share.share_size + 1)
|
size=CONF.share.share_size + 1)
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'shrink_share', expected_status=lib_exc.NotFound,
|
'shrink_share', expected_status=lib_exc.Forbidden,
|
||||||
share_id=alt_share['id'], new_size=CONF.share.share_size)
|
share_id=alt_share['id'], new_size=CONF.share.share_size)
|
||||||
|
|
||||||
@decorators.idempotent_id('0b57aedb-6b68-498f-814e-173c47e6c307')
|
@decorators.idempotent_id('0b57aedb-6b68-498f-814e-173c47e6c307')
|
||||||
@ -612,7 +612,7 @@ class TestProjectReaderTestsNFS(TestProjectMemberTestsNFS):
|
|||||||
alt_share = self.create_share(
|
alt_share = self.create_share(
|
||||||
self.alt_project_share_v2_client, self.share_type['id'])
|
self.alt_project_share_v2_client, self.share_type['id'])
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'extend_share', expected_status=lib_exc.NotFound,
|
'extend_share', expected_status=lib_exc.Forbidden,
|
||||||
share_id=alt_share['id'], new_size=CONF.share.share_size + 1)
|
share_id=alt_share['id'], new_size=CONF.share.share_size + 1)
|
||||||
|
|
||||||
@decorators.idempotent_id('3def3f4e-33fc-4726-8818-6cffbc2cab51')
|
@decorators.idempotent_id('3def3f4e-33fc-4726-8818-6cffbc2cab51')
|
||||||
|
@ -497,7 +497,7 @@ class TestProjectReaderTestsNFS(TestProjectMemberTestsNFS):
|
|||||||
alt_snap = self.create_snapshot(
|
alt_snap = self.create_snapshot(
|
||||||
self.alt_project_share_v2_client, self.alt_share['id'])
|
self.alt_project_share_v2_client, self.alt_share['id'])
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'delete_snapshot', expected_status=lib_exc.NotFound,
|
'delete_snapshot', expected_status=lib_exc.Forbidden,
|
||||||
snap_id=alt_snap['id'])
|
snap_id=alt_snap['id'])
|
||||||
|
|
||||||
@decorators.idempotent_id('ed0af390-e3d0-432b-9147-c0d569181b92')
|
@decorators.idempotent_id('ed0af390-e3d0-432b-9147-c0d569181b92')
|
||||||
@ -517,7 +517,7 @@ class TestProjectReaderTestsNFS(TestProjectMemberTestsNFS):
|
|||||||
alt_snap = self.create_snapshot(
|
alt_snap = self.create_snapshot(
|
||||||
self.alt_project_share_v2_client, self.alt_share['id'])
|
self.alt_project_share_v2_client, self.alt_share['id'])
|
||||||
self.do_request(
|
self.do_request(
|
||||||
'rename_snapshot', expected_status=lib_exc.NotFound,
|
'rename_snapshot', expected_status=lib_exc.Forbidden,
|
||||||
snapshot_id=alt_snap['id'], name=name)
|
snapshot_id=alt_snap['id'], name=name)
|
||||||
|
|
||||||
@decorators.idempotent_id('b8c9c9a4-3b2a-4b1c-80d8-2ec87d708111')
|
@decorators.idempotent_id('b8c9c9a4-3b2a-4b1c-80d8-2ec87d708111')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user