Allow visibility of external subnet as shared ones
The Neutron network can have the attribute "external". If a network is external, can be seen by other projects, same as when it is shared. However the subnets cannot be seen now. This issue is being solved in LP#2051831, in [1]. This patch changes the logic implemented in [2], where the subnets belonging to an external network where hidden to a non-admin user of other project. [1]https://review.opendev.org/c/openstack/neutron/+/907313 [2]https://review.opendev.org/c/openstack/tempest/+/484960 Related-Bug: #2051831 Change-Id: I58b2a1ddf9b0fe85d96617863d121aebb7d81e58
This commit is contained in:
parent
3619d297d5
commit
2779712635
@ -389,17 +389,20 @@ class NetworksTest(BaseNetworkTestResources):
|
|||||||
# belong to other tests and their state may have changed during this
|
# belong to other tests and their state may have changed during this
|
||||||
# test
|
# test
|
||||||
body = self.subnets_client.list_subnets(network_id=public_network_id)
|
body = self.subnets_client.list_subnets(network_id=public_network_id)
|
||||||
|
extensions = [
|
||||||
|
ext['alias'] for ext in
|
||||||
|
self.network_extensions_client.list_extensions()['extensions']]
|
||||||
|
is_sen_ext = 'subnet-external-network' in extensions
|
||||||
|
|
||||||
# check subnet visibility of external_network
|
# check subnet visibility of external_network
|
||||||
if external_network['shared']:
|
if external_network['shared'] or is_sen_ext:
|
||||||
self.assertNotEmpty(body['subnets'], "Subnets should be visible "
|
self.assertNotEmpty(body['subnets'],
|
||||||
"for shared public network %s"
|
'Subnets should be visible for shared or '
|
||||||
% public_network_id)
|
'external networks %s' % public_network_id)
|
||||||
else:
|
else:
|
||||||
self.assertEmpty(body['subnets'], "Subnets should not be visible "
|
self.assertEmpty(body['subnets'],
|
||||||
"for non-shared public "
|
'Subnets should not be visible for non-shared or'
|
||||||
"network %s"
|
'non-external networks %s' % public_network_id)
|
||||||
% public_network_id)
|
|
||||||
|
|
||||||
@decorators.idempotent_id('c72c1c0c-2193-4aca-ccc4-b1442640bbbb')
|
@decorators.idempotent_id('c72c1c0c-2193-4aca-ccc4-b1442640bbbb')
|
||||||
@utils.requires_ext(extension="standard-attr-description",
|
@utils.requires_ext(extension="standard-attr-description",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user