diff --git a/neutron_tempest_plugin/api/test_auto_allocated_topology.py b/neutron_tempest_plugin/api/test_auto_allocated_topology.py index 4d70bfca..21774024 100644 --- a/neutron_tempest_plugin/api/test_auto_allocated_topology.py +++ b/neutron_tempest_plugin/api/test_auto_allocated_topology.py @@ -79,6 +79,14 @@ class TestAutoAllocatedTopology(base.BaseAdminNetworkTest): body = client.list_networks(name='auto_allocated_network') self.networks.extend(body['networks']) + @decorators.idempotent_id('10e4ecef-4309-4bda-9c4d-192e1b5a5831') + def test_check_requirements_for_auto_allocate_net_topology(self): + body = self.client.validate_auto_allocated_topology_requirements() + topology = body['auto_allocated_topology'] + self.assertIn('dry-run', topology['id']) + self.assertIn('tenant_id', topology) + self.assertIn('project_id', topology) + @decorators.idempotent_id('64bc0b02-cee4-11e5-9f3c-080027605a2b') def test_get_allocated_net_topology_as_tenant(self): resources_before = self._count_topology_resources() diff --git a/neutron_tempest_plugin/services/network/json/network_client.py b/neutron_tempest_plugin/services/network/json/network_client.py index 1153a2a9..289ef61e 100644 --- a/neutron_tempest_plugin/services/network/json/network_client.py +++ b/neutron_tempest_plugin/services/network/json/network_client.py @@ -804,6 +804,14 @@ class NetworkClientJSON(service_client.RestClient): body = jsonutils.loads(body) return service_client.ResponseBody(resp, body) + def validate_auto_allocated_topology_requirements(self, tenant_id=None): + uri = '%s/auto-allocated-topology/%s?fields=dry-run' % ( + self.uri_prefix, tenant_id) + resp, body = self.get(uri) + self.expected_success(200, resp.status) + body = jsonutils.loads(body) + return service_client.ResponseBody(resp, body) + def get_auto_allocated_topology(self, tenant_id=None): uri = '%s/auto-allocated-topology/%s' % (self.uri_prefix, tenant_id) resp, body = self.get(uri)