|
|
|
@ -474,31 +474,31 @@ class ProjectAdminTests(NetworkAPITestCase):
|
|
|
|
|
|
|
|
|
|
def test_create_network_shared(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:shared', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:shared', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_external(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:router:external', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:router:external', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_default(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:is_default', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:is_default', self.alt_target) |
|
|
|
|
|
|
|
|
@ -515,45 +515,45 @@ class ProjectAdminTests(NetworkAPITestCase):
|
|
|
|
|
|
|
|
|
|
def test_create_network_segments(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:segments', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:segments', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_provider_network_type(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:network_type', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:network_type', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_provider_physical_network(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:physical_network', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:physical_network', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_provider_segmentation_id(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:segmentation_id', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:segmentation_id', |
|
|
|
|
self.alt_target) |
|
|
|
@ -577,44 +577,44 @@ class ProjectAdminTests(NetworkAPITestCase):
|
|
|
|
|
|
|
|
|
|
def test_get_network_segments(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:segments', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:segments', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_provider_network_type(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:network_type', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:network_type', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_provider_physical_network(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:physical_network', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:physical_network', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_provider_segmentation_id(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:segmentation_id', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:segmentation_id', |
|
|
|
|
self.alt_target) |
|
|
|
@ -629,76 +629,76 @@ class ProjectAdminTests(NetworkAPITestCase):
|
|
|
|
|
|
|
|
|
|
def test_update_network_segments(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:segments', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:segments', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_shared(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:shared', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:shared', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_provider_network_type(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:network_type', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:network_type', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_provider_physical_network(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:physical_network', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:physical_network', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_provider_segmentation_id(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:segmentation_id', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:segmentation_id', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_external(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:router:external', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:router:external', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_default(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:is_default', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:is_default', self.alt_target) |
|
|
|
|
|
|
|
|
@ -745,31 +745,31 @@ class ProjectReaderTests(ProjectMemberTests):
|
|
|
|
|
|
|
|
|
|
def test_create_network_shared(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:shared', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:shared', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_external(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:router:external', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:router:external', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_default(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:is_default', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:is_default', self.alt_target) |
|
|
|
|
|
|
|
|
@ -787,89 +787,89 @@ class ProjectReaderTests(ProjectMemberTests):
|
|
|
|
|
|
|
|
|
|
def test_create_network_segments(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:segments', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:segments', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_provider_network_type(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:network_type', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:network_type', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_provider_physical_network(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:physical_network', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:physical_network', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_create_network_provider_segmentation_id(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:segmentation_id', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'create_network:provider:segmentation_id', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_segments(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:segments', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:segments', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_provider_network_type(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:network_type', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:network_type', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_provider_physical_network(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:physical_network', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:physical_network', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_get_network_provider_segmentation_id(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:segmentation_id', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'get_network:provider:segmentation_id', |
|
|
|
|
self.alt_target) |
|
|
|
@ -884,76 +884,76 @@ class ProjectReaderTests(ProjectMemberTests):
|
|
|
|
|
|
|
|
|
|
def test_update_network_segments(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:segments', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:segments', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_shared(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:shared', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:shared', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_provider_network_type(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:network_type', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:network_type', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_provider_physical_network(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:physical_network', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:physical_network', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_provider_segmentation_id(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:segmentation_id', |
|
|
|
|
self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:provider:segmentation_id', |
|
|
|
|
self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_external(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:router:external', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:router:external', self.alt_target) |
|
|
|
|
|
|
|
|
|
def test_update_network_default(self): |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:is_default', self.target) |
|
|
|
|
self.assertRaises( |
|
|
|
|
base_policy.PolicyNotAuthorized, |
|
|
|
|
base_policy.InvalidScope, |
|
|
|
|
policy.enforce, |
|
|
|
|
self.context, 'update_network:is_default', self.alt_target) |
|
|
|
|
|
|
|
|
|