Esempio n. 1
0
    def _test_delete_network_with_unattached_port(self, fmt):
        LOG.debug("_test_delete_network_with_unattached_port " "- fmt:%s - START", fmt)
        port_state = "ACTIVE"
        network_id = self._create_network(fmt)
        LOG.debug("Deleting network %s of tenant %s" % (network_id, self.tenant_id))
        self._create_port(network_id, port_state, fmt)

        LOG.debug("Deleting network %s of tenant %s" % (network_id, self.tenant_id))
        delete_network_req = testlib.network_delete_request(self.tenant_id, network_id, fmt)
        delete_network_res = delete_network_req.get_response(self.api)
        self.assertEqual(delete_network_res.status_int, 204)
        LOG.debug("_test_delete_network_with_unattached_port - fmt:%s - END", fmt)
Esempio n. 2
0
 def _test_delete_network(self, fmt):
     LOG.debug("_test_delete_network - fmt:%s - START", fmt)
     content_type = "application/%s" % fmt
     network_id = self._create_network(fmt)
     LOG.debug("Deleting network %s of tenant %s" % (network_id, self.tenant_id))
     delete_network_req = testlib.network_delete_request(self.tenant_id, network_id, fmt)
     delete_network_res = delete_network_req.get_response(self.api)
     self.assertEqual(delete_network_res.status_int, 204)
     list_network_req = testlib.network_list_request(self.tenant_id, fmt)
     list_network_res = list_network_req.get_response(self.api)
     network_list_data = self._net_deserializers[content_type].deserialize(list_network_res.body)["body"]
     network_count = len(network_list_data["networks"])
     self.assertEqual(network_count, 0)
     LOG.debug("_test_delete_network - fmt:%s - END", fmt)
Esempio n. 3
0
    def _test_delete_network_in_use(self, fmt):
        LOG.debug("_test_delete_network_in_use - fmt:%s - START", fmt)
        port_state = "ACTIVE"
        attachment_id = "test_attachment"
        network_id = self._create_network(fmt)
        LOG.debug("Deleting network %s of tenant %s" % (network_id, self.tenant_id))
        port_id = self._create_port(network_id, port_state, fmt)
        # plug an attachment into the port
        LOG.debug("Putting attachment into port %s", port_id)
        attachment_req = testlib.put_attachment_request(self.tenant_id, network_id, port_id, attachment_id)
        attachment_res = attachment_req.get_response(self.api)
        self.assertEquals(attachment_res.status_int, 204)

        LOG.debug("Deleting network %s of tenant %s" % (network_id, self.tenant_id))
        delete_network_req = testlib.network_delete_request(self.tenant_id, network_id, fmt)
        delete_network_res = delete_network_req.get_response(self.api)
        self.assertEqual(delete_network_res.status_int, self._network_in_use_code)
        LOG.debug("_test_delete_network_in_use - fmt:%s - END", fmt)