]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
merge trunk
authorSalvatore Orlando <salvatore.orlando@eu.citrix.com>
Wed, 17 Aug 2011 21:48:56 +0000 (22:48 +0100)
committerSalvatore Orlando <salvatore.orlando@eu.citrix.com>
Wed, 17 Aug 2011 21:48:56 +0000 (22:48 +0100)
pep8 fixes
adapting CLI to API v1.0
Fixing wsgi to avoid failure with extensions

12 files changed:
1  2 
etc/quantum.conf
quantum/api/__init__.py
quantum/api/networks.py
quantum/api/ports.py
quantum/cli.py
quantum/common/wsgi.py
quantum/db/api.py
quantum/db/models.py
quantum/plugins/SamplePlugin.py
tests/unit/test_api.py
tests/unit/test_clientlib.py
tests/unit/test_clientlib.py.THIS

index 336dd5b8f1b4d2eac6d1996ced48f219547a7a3e,e4d910b400c5b662de1790fb14af269f62dbfcf3..9fd2036554acb313ee27b6547e7387a123fc6ae9
@@@ -14,8 -17,14 +17,14 @@@ api_extensions_path = extension
  [composite:quantum]
  use = egg:Paste#urlmap
  /: quantumversions
 -/v0.1: quantumapi
 +/v1.0: quantumapi
  
+ [pipeline:quantumapi]
+ pipeline = extensions quantumapiapp
+ [filter:extensions]
+ paste.filter_factory = quantum.common.extensions:plugin_aware_extension_middleware_factory
  [app:quantumversions]
  paste.app_factory = quantum.api.versions:Versions.factory
  
Simple merge
index 3f733b8f9c9d792350d94ff5a4866a700041af1e,27709eb5941f641ce9d2923681628e9d55e15b81..db4d864d525b025f46ee98c3ab6dd713f80c9884
@@@ -37,10 -37,9 +37,9 @@@ class Controller(common.QuantumControll
              "attributes": {
                  "network": ["id", "name"],
                  "port": ["id", "state"],
 -            },
 -            "plurals": {"networks": "network"}
 -        },
 +                "attachment": ["id"]},
 +            "plurals": {"networks": "network",
-                         "ports": "port"}
-         },
++                        "ports": "port"}},
      }
  
      def __init__(self, plugin):
index f9a44ea53b83dc1ab232a4a687470a4ebf37f2a3,042ea673c3a6ac0aee6498e803dc4499db6aec4d..77e2b54556046f832e39434eb21c2318590a92cd
@@@ -36,10 -36,13 +36,9 @@@ class Controller(common.QuantumControll
      _serialization_metadata = {
          "application/xml": {
              "attributes": {
 -                "port": ["id", "state"], },
 -            "plurals": {"ports": "port"}
 -        },
 +                "port": ["id", "state"],
 +                "attachment": ["id"]},
-             "plurals": {"ports": "port"}
-         },
++            "plurals": {"ports": "port"}},
      }
  
      def __init__(self, plugin):
diff --cc quantum/cli.py
index a015565d872743addcd1ce6c9019c384cafbb92a,6b19f98fcff5de74ddb560c890d7b4577975bc62..0b962f5ef36d4cdcc71a2f5affb428b07c4475d7
@@@ -69,7 -69,7 +69,7 @@@ def api_create_net(client, *args)
      LOG.debug(res)
      nid = None
      try:
--        nid = res["networks"]["network"]["id"]
++        nid = res["network"]["id"]
      except Exception, e:
          print "Failed to create network"
          # TODO(bgh): grab error details from ws request result
@@@ -104,7 -104,7 +104,7 @@@ def detail_net(manager, *args)
  def api_detail_net(client, *args):
      tid, nid = args
      try:
-         res = client.list_network_details(nid)["networks"]["network"]
 -        res = client.show_network_details(nid)["networks"]["network"]
++        res = client.show_network_details(nid)["network"]
      except Exception, e:
          LOG.error("Failed to get network details: %s" % e)
          return
      print "Remote Interfaces on Virtual Network:%s\n" % nid
      for port in ports["ports"]:
          pid = port["id"]
-         res = client.list_port_attachments(nid, pid)
+         res = client.show_port_attachment(nid, pid)
          LOG.debug(res)
--        remote_iface = res["attachment"]
++        remote_iface = res["attachment"]["id"]
          print "\tRemote interface:%s" % remote_iface
  
  
@@@ -133,7 -133,7 +133,7 @@@ def rename_net(manager, *args)
  
  def api_rename_net(client, *args):
      tid, nid, name = args
--    data = {'network': {'net-name': '%s' % name}}
++    data = {'network': {'name': '%s' % name}}
      try:
          res = client.update_network(nid, data)
      except Exception, e:
@@@ -179,7 -179,7 +179,7 @@@ def api_create_port(client, *args)
      except Exception, e:
          LOG.error("Failed to create port: %s" % e)
          return
--    new_port = res["ports"]["port"]["id"]
++    new_port = res["port"]["id"]
      print "Created Virtual Port:%s " \
            "on Virtual Network:%s" % (new_port, nid)
  
@@@ -214,16 -214,16 +214,17 @@@ def detail_port(manager, *args)
  def api_detail_port(client, *args):
      tid, nid, pid = args
      try:
-         port = client.list_port_details(nid, pid)["ports"]["port"]
 -        port = client.show_port_details(nid, pid)["ports"]["port"]
++        port = client.show_port_details(nid, pid)["port"]
++        att = client.show_port_attachment(nid, pid)
      except Exception, e:
          LOG.error("Failed to get port details: %s" % e)
          return
  
--    id = port["id"]
--    attachment = port["attachment"]
++    id = port['id']
++    interface_id = att['id']
      LOG.debug(port)
      print "Virtual Port:%s on Virtual Network:%s " \
--          "contains remote interface:%s" % (pid, nid, attachment)
++          "contains remote interface:%s" % (pid, nid, interface_id)
  
  
  def plug_iface(manager, *args):
  def api_plug_iface(client, *args):
      tid, nid, pid, vid = args
      try:
--        data = {'port': {'attachment-id': '%s' % vid}}
++        data = {'attachment': {'id': '%s' % vid}}
          res = client.attach_resource(nid, pid, data)
      except Exception, e:
          LOG.error("Failed to plug iface \"%s\" to port \"%s\": %s" % (vid,
index 7f831aa1721d9edece40c8b044d8662fc21ee211,94df7913c63e20ab1feae6b7ed16aa896ad31bf1..11fdd68c1eaa0b51d64551084c5d536658321adb
@@@ -143,9 -136,9 +143,8 @@@ class Request(webob.Request)
      def get_content_type(self):
          allowed_types = ("application/xml", "application/json")
          if not "Content-Type" in self.headers:
--            msg = _("Missing Content-Type")
--            LOG.debug(msg)
--            raise webob.exc.HTTPBadRequest(msg)
++            LOG.debug(_("Missing Content-Type"))
++            return None
          type = self.content_type
          if type in allowed_types:
              return type
Simple merge
Simple merge
Simple merge
index e46032e287b7d795de80600f8f3d5a7a97d6fb41,aee8f73f3e79c4a1a443a0885aa200b2efa4fe41..9ea5002d29f0bcf3f48273bb4c09242fe5cc6194
@@@ -136,29 -118,6 +136,25 @@@ class APITest(unittest.TestCase)
                           network_data['network'])
          LOG.debug("_test_show_network - format:%s - END", format)
  
-                           'ports': [
-                                     {
-                                      'id': port_id,
-                                      'state': 'ACTIVE'
-                                     }
-                                    ]},
 +    def _test_show_network_detail(self, format):
 +        LOG.debug("_test_show_network_detail - format:%s - START", format)
 +        content_type = "application/%s" % format
 +        # Create a network and a port
 +        network_id = self._create_network(format)
 +        port_id = self._create_port(network_id, "ACTIVE", format)
 +        show_network_req = testlib.show_network_detail_request(
 +                                    self.tenant_id, network_id, format)
 +        show_network_res = show_network_req.get_response(self.api)
 +        self.assertEqual(show_network_res.status_int, 200)
 +        network_data = self._net_serializer.deserialize(
 +                           show_network_res.body, content_type)
 +        self.assertEqual({'id': network_id,
 +                          'name': self.network_name,
++                          'ports': [{'id': port_id,
++                                     'state': 'ACTIVE'}]},
 +                         network_data['network'])
 +        LOG.debug("_test_show_network_detail - format:%s - END", format)
 +
      def _test_show_network_not_found(self, format):
          LOG.debug("_test_show_network_not_found - format:%s - START", format)
          show_network_req = testlib.show_network_request(self.tenant_id,
Simple merge
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..eab58b2bd5369ce0e9222b4b4971a120d76583e0
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,625 @@@
++# vim: tabstop=4 shiftwidth=4 softtabstop=4
++
++# Copyright 2011 Cisco Systems
++# All Rights Reserved.
++#
++#    Licensed under the Apache License, Version 2.0 (the "License"); you may
++#    not use this file except in compliance with the License. You may obtain
++#    a copy of the License at
++#
++#         http://www.apache.org/licenses/LICENSE-2.0
++#
++#    Unless required by applicable law or agreed to in writing, software
++#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
++#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
++#    License for the specific language governing permissions and limitations
++#    under the License.
++#    @author: Tyler Smith, Cisco Systems
++
++import logging
++import unittest
++import re
++
++from quantum.common.wsgi import Serializer
++from quantum.client import Client
++
++LOG = logging.getLogger('quantum.tests.test_cliet')
++
++# Set a couple tenants to use for testing
++TENANT_1 = 'totore'
++TENANT_2 = 'totore2'
++
++
++class ServerStub():
++    """This class stubs a basic server for the API client to talk to"""
++
++    class Response(object):
++        """This class stubs a basic response to send the API client"""
++        def __init__(self, content=None, status=None):
++            self.content = content
++            self.status = status
++
++        def read(self):
++            return self.content
++
++        def status(self):
++            return self.status
++
++    # To test error codes, set the host to 10.0.0.1, and the port to the code
++    def __init__(self, host, port=9696, key_file="", cert_file=""):
++        self.host = host
++        self.port = port
++        self.key_file = key_file
++        self.cert_file = cert_file
++
++    def request(self, method, action, body, headers):
++        self.method = method
++        self.action = action
++        self.body = body
++
++    def status(self, status=None):
++        return status or 200
++
++    def getresponse(self):
++        res = self.Response(status=self.status())
++
++        # If the host is 10.0.0.1, return the port as an error code
++        if self.host == "10.0.0.1":
++            res.status = self.port
++            return res
++
++        # Extract important information from the action string to assure sanity
++        match = re.search('tenants/(.+?)/(.+)\.(json|xml)$', self.action)
++
++        tenant = match.group(1)
++        path = match.group(2)
++        format = match.group(3)
++
++        data = {'data': {'method': self.method, 'action': self.action,
++                         'body': self.body, 'tenant': tenant, 'path': path,
++                         'format': format, 'key_file': self.key_file,
++                         'cert_file': self.cert_file}}
++
++        # Serialize it to the proper format so the API client can handle it
++        if data['data']['format'] == 'json':
++            res.content = Serializer().serialize(data, "application/json")
++        else:
++            res.content = Serializer().serialize(data, "application/xml")
++        return res
++
++
++class ClientLibTest(unittest.TestCase):
++
++    def setUp(self):
++        """ Setups a test environment for the API client """
++        HOST = '127.0.0.1'
++        PORT = 9696
++        USE_SSL = False
++
++        self.client = Client(HOST, PORT, USE_SSL, TENANT_1, 'json', ServerStub)
++
++    def _assert_sanity(self, call, status, method, path, data=[], params={}):
++        """ Perform common assertions to test the sanity of client requests """
++
++        # Handle an error case first
++        if status != 200:
++            (self.client.host, self.client.port) = ("10.0.0.1", status)
++            self.assertRaises(Exception, call, *data, **params)
++            return
++
++        # Make the call, then get the data from the root node and assert it
++        data = call(*data, **params)['data']
++
++        self.assertEqual(data['method'], method)
++        self.assertEqual(data['format'], params['format'])
++        self.assertEqual(data['tenant'], params['tenant'])
++        self.assertEqual(data['path'], path)
++
++        return data
++
++    def _test_list_networks(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_list_networks - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.list_networks,
++                            status,
++                            "GET",
++                            "networks",
++                            data=[],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_list_networks - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_list_network_details(self, tenant=TENANT_1,
++                                   format='json', status=200):
++        LOG.debug("_test_list_network_details - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.list_network_details,
++                            status,
++                            "GET",
++                            "networks/001",
++                            data=["001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_list_network_details - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_create_network(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_create_network - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.create_network,
++                            status,
++                            "POST",
++                            "networks",
++                            data=[{'network': {'net-name': 'testNetwork'}}],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_create_network - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_update_network(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_update_network - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.update_network,
++                            status,
++                            "PUT",
++                            "networks/001",
++                            data=["001",
++                                  {'network': {'net-name': 'newName'}}],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_update_network - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_delete_network(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_delete_network - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.delete_network,
++                            status,
++                            "DELETE",
++                            "networks/001",
++                            data=["001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_delete_network - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_list_ports(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_list_ports - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.list_ports,
++                            status,
++                            "GET",
++                            "networks/001/ports",
++                            data=["001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_list_ports - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_list_port_details(self,
++                                tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_list_port_details - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.list_port_details,
++                            status,
++                            "GET",
++                            "networks/001/ports/001",
++                            data=["001", "001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_list_port_details - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_create_port(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_create_port - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.create_port,
++                            status,
++                            "POST",
++                            "networks/001/ports",
++                            data=["001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_create_port - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_delete_port(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_delete_port - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.delete_port,
++                            status,
++                            "DELETE",
++                            "networks/001/ports/001",
++                            data=["001", "001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_delete_port - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_set_port_state(self, tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_set_port_state - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.set_port_state,
++                            status,
++                            "PUT",
++                            "networks/001/ports/001",
++                            data=["001", "001",
++                                  {'port': {'state': 'ACTIVE'}}],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_set_port_state - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_list_port_attachments(self,
++                                   tenant=TENANT_1, format='json', status=200):
++        LOG.debug("_test_list_port_attachments - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.list_port_attachments,
++                            status,
++                            "GET",
++                            "networks/001/ports/001/attachment",
++                            data=["001", "001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_list_port_attachments - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_attach_resource(self, tenant=TENANT_1,
++                              format='json', status=200):
++        LOG.debug("_test_attach_resource - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.attach_resource,
++                            status,
++                            "PUT",
++                            "networks/001/ports/001/attachment",
++                            data=["001", "001",
++                                    {'resource': {'id': '1234'}}],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_attach_resource - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_detach_resource(self, tenant=TENANT_1,
++                              format='json', status=200):
++        LOG.debug("_test_detach_resource - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        self._assert_sanity(self.client.detach_resource,
++                            status,
++                            "DELETE",
++                            "networks/001/ports/001/attachment",
++                            data=["001", "001"],
++                            params={'tenant': tenant, 'format': format})
++
++        LOG.debug("_test_detach_resource - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def _test_ssl_certificates(self, tenant=TENANT_1,
++                               format='json', status=200):
++        LOG.debug("_test_ssl_certificates - tenant:%(tenant)s "\
++                  "- format:%(format)s - START" % locals())
++
++        # Set SSL, and our cert file
++        self.client.use_ssl = True
++        cert_file = "/fake.cert"
++        self.client.key_file = self.client.cert_file = cert_file
++
++        data = self._assert_sanity(self.client.list_networks,
++                            status,
++                            "GET",
++                            "networks",
++                            data=[],
++                            params={'tenant': tenant, 'format': format})
++
++        self.assertEquals(data["key_file"], cert_file)
++        self.assertEquals(data["cert_file"], cert_file)
++
++        LOG.debug("_test_ssl_certificates - tenant:%(tenant)s "\
++                  "- format:%(format)s - END" % locals())
++
++    def test_list_networks_json(self):
++        self._test_list_networks(format='json')
++
++    def test_list_networks_xml(self):
++        self._test_list_networks(format='xml')
++
++    def test_list_networks_alt_tenant(self):
++        self._test_list_networks(tenant=TENANT_2)
++
++    def test_list_networks_error_470(self):
++        self._test_list_networks(status=470)
++
++    def test_list_networks_error_401(self):
++        self._test_list_networks(status=401)
++
++    def test_list_network_details_json(self):
++        self._test_list_network_details(format='json')
++
++    def test_list_network_details_xml(self):
++        self._test_list_network_details(format='xml')
++
++    def test_list_network_details_alt_tenant(self):
++        self._test_list_network_details(tenant=TENANT_2)
++
++    def test_list_network_details_error_470(self):
++        self._test_list_network_details(status=470)
++
++    def test_list_network_details_error_401(self):
++        self._test_list_network_details(status=401)
++
++    def test_list_network_details_error_420(self):
++        self._test_list_network_details(status=420)
++
++    def test_create_network_json(self):
++        self._test_create_network(format='json')
++
++    def test_create_network_xml(self):
++        self._test_create_network(format='xml')
++
++    def test_create_network_alt_tenant(self):
++        self._test_create_network(tenant=TENANT_2)
++
++    def test_create_network_error_470(self):
++        self._test_create_network(status=470)
++
++    def test_create_network_error_401(self):
++        self._test_create_network(status=401)
++
++    def test_create_network_error_400(self):
++        self._test_create_network(status=400)
++
++    def test_create_network_error_422(self):
++        self._test_create_network(status=422)
++
++    def test_update_network_json(self):
++        self._test_update_network(format='json')
++
++    def test_update_network_xml(self):
++        self._test_update_network(format='xml')
++
++    def test_update_network_alt_tenant(self):
++        self._test_update_network(tenant=TENANT_2)
++
++    def test_update_network_error_470(self):
++        self._test_update_network(status=470)
++
++    def test_update_network_error_401(self):
++        self._test_update_network(status=401)
++
++    def test_update_network_error_400(self):
++        self._test_update_network(status=400)
++
++    def test_update_network_error_420(self):
++        self._test_update_network(status=420)
++
++    def test_update_network_error_422(self):
++        self._test_update_network(status=422)
++
++    def test_delete_network_json(self):
++        self._test_delete_network(format='json')
++
++    def test_delete_network_xml(self):
++        self._test_delete_network(format='xml')
++
++    def test_delete_network_alt_tenant(self):
++        self._test_delete_network(tenant=TENANT_2)
++
++    def test_delete_network_error_470(self):
++        self._test_delete_network(status=470)
++
++    def test_delete_network_error_401(self):
++        self._test_delete_network(status=401)
++
++    def test_delete_network_error_420(self):
++        self._test_delete_network(status=420)
++
++    def test_delete_network_error_421(self):
++        self._test_delete_network(status=421)
++
++    def test_list_ports_json(self):
++        self._test_list_ports(format='json')
++
++    def test_list_ports_xml(self):
++        self._test_list_ports(format='xml')
++
++    def test_list_ports_alt_tenant(self):
++        self._test_list_ports(tenant=TENANT_2)
++
++    def test_list_ports_error_470(self):
++        self._test_list_ports(status=470)
++
++    def test_list_ports_error_401(self):
++        self._test_list_ports(status=401)
++
++    def test_list_ports_error_420(self):
++        self._test_list_ports(status=420)
++
++    def test_list_port_details_json(self):
++        self._test_list_ports(format='json')
++
++    def test_list_port_details_xml(self):
++        self._test_list_ports(format='xml')
++
++    def test_list_port_details_alt_tenant(self):
++        self._test_list_ports(tenant=TENANT_2)
++
++    def test_list_port_details_error_470(self):
++        self._test_list_port_details(status=470)
++
++    def test_list_port_details_error_401(self):
++        self._test_list_ports(status=401)
++
++    def test_list_port_details_error_420(self):
++        self._test_list_ports(status=420)
++
++    def test_list_port_details_error_430(self):
++        self._test_list_ports(status=430)
++
++    def test_create_port_json(self):
++        self._test_create_port(format='json')
++
++    def test_create_port_xml(self):
++        self._test_create_port(format='xml')
++
++    def test_create_port_alt_tenant(self):
++        self._test_create_port(tenant=TENANT_2)
++
++    def test_create_port_error_470(self):
++        self._test_create_port(status=470)
++
++    def test_create_port_error_401(self):
++        self._test_create_port(status=401)
++
++    def test_create_port_error_400(self):
++        self._test_create_port(status=400)
++
++    def test_create_port_error_420(self):
++        self._test_create_port(status=420)
++
++    def test_create_port_error_430(self):
++        self._test_create_port(status=430)
++
++    def test_create_port_error_431(self):
++        self._test_create_port(status=431)
++
++    def test_delete_port_json(self):
++        self._test_delete_port(format='json')
++
++    def test_delete_port_xml(self):
++        self._test_delete_port(format='xml')
++
++    def test_delete_port_alt_tenant(self):
++        self._test_delete_port(tenant=TENANT_2)
++
++    def test_delete_port_error_470(self):
++        self._test_delete_port(status=470)
++
++    def test_delete_port_error_401(self):
++        self._test_delete_port(status=401)
++
++    def test_delete_port_error_420(self):
++        self._test_delete_port(status=420)
++
++    def test_delete_port_error_430(self):
++        self._test_delete_port(status=430)
++
++    def test_delete_port_error_432(self):
++        self._test_delete_port(status=432)
++
++    def test_set_port_state_json(self):
++        self._test_set_port_state(format='json')
++
++    def test_set_port_state_xml(self):
++        self._test_set_port_state(format='xml')
++
++    def test_set_port_state_alt_tenant(self):
++        self._test_set_port_state(tenant=TENANT_2)
++
++    def test_set_port_state_error_470(self):
++        self._test_set_port_state(status=470)
++
++    def test_set_port_state_error_401(self):
++        self._test_set_port_state(status=401)
++
++    def test_set_port_state_error_400(self):
++        self._test_set_port_state(status=400)
++
++    def test_set_port_state_error_420(self):
++        self._test_set_port_state(status=420)
++
++    def test_set_port_state_error_430(self):
++        self._test_set_port_state(status=430)
++
++    def test_set_port_state_error_431(self):
++        self._test_set_port_state(status=431)
++
++    def test_list_port_attachments_json(self):
++        self._test_list_port_attachments(format='json')
++
++    def test_list_port_attachments_xml(self):
++        self._test_list_port_attachments(format='xml')
++
++    def test_list_port_attachments_alt_tenant(self):
++        self._test_list_port_attachments(tenant=TENANT_2)
++
++    def test_list_port_attachments_error_470(self):
++        self._test_list_port_attachments(status=470)
++
++    def test_list_port_attachments_error_401(self):
++        self._test_list_port_attachments(status=401)
++
++    def test_list_port_attachments_error_400(self):
++        self._test_list_port_attachments(status=400)
++
++    def test_list_port_attachments_error_420(self):
++        self._test_list_port_attachments(status=420)
++
++    def test_list_port_attachments_error_430(self):
++        self._test_list_port_attachments(status=430)
++
++    def test_attach_resource_json(self):
++        self._test_attach_resource(format='json')
++
++    def test_attach_resource_xml(self):
++        self._test_attach_resource(format='xml')
++
++    def test_attach_resource_alt_tenant(self):
++        self._test_attach_resource(tenant=TENANT_2)
++
++    def test_attach_resource_error_470(self):
++        self._test_attach_resource(status=470)
++
++    def test_attach_resource_error_401(self):
++        self._test_attach_resource(status=401)
++
++    def test_attach_resource_error_400(self):
++        self._test_attach_resource(status=400)
++
++    def test_attach_resource_error_420(self):
++        self._test_attach_resource(status=420)
++
++    def test_attach_resource_error_430(self):
++        self._test_attach_resource(status=430)
++
++    def test_attach_resource_error_432(self):
++        self._test_attach_resource(status=432)
++
++    def test_attach_resource_error_440(self):
++        self._test_attach_resource(status=440)
++
++    def test_detach_resource_json(self):
++        self._test_detach_resource(format='json')
++
++    def test_detach_resource_xml(self):
++        self._test_detach_resource(format='xml')
++
++    def test_detach_resource_alt_tenant(self):
++        self._test_detach_resource(tenant=TENANT_2)
++
++    def test_detach_resource_error_470(self):
++        self._test_detach_resource(status=470)
++
++    def test_detach_resource_error_401(self):
++        self._test_detach_resource(status=401)
++
++    def test_detach_resource_error_420(self):
++        self._test_detach_resource(status=420)
++
++    def test_detach_resource_error_430(self):
++        self._test_detach_resource(status=430)
++
++    def test_ssl_certificates(self):
++        self._test_ssl_certificates()