Fix API test for external subnet visibility

The test_external_network_visibility test incorrectly
assumes that subnets will never be visible on external
networks. However, this is not true in the case that a
network is both external and shared.

This updates the test to ignore shared networks.

Change-Id: I0219e17d2ec70939039344826d35cb533b3ce065
Closes-Bug: #1553595
This commit is contained in:
Kevin Benton 2016-03-05 17:49:48 -08:00
parent d4def2bd3e
commit 391c2327c3

@ -406,7 +406,10 @@ class NetworksTestJSON(base.BaseNetworkTest):
def test_external_network_visibility(self):
"""Verifies user can see external networks but not subnets."""
body = self.client.list_networks(**{'router:external': True})
networks = [network['id'] for network in body['networks']]
# shared external networks are excluded since their subnets are
# visible
networks = [network['id'] for network in body['networks']
if not network['shared']]
self.assertNotEmpty(networks, "No external networks found")
nonexternal = [net for net in body['networks'] if