[python3] Webob request body should be bytes
Enable more tests to work by making sure we use encodeutils.safe_encode and jsonutils.dump_as_bytes as needed. Change-Id: I05de0cd58ee1734df0967bb58082a7e017741c0b
This commit is contained in:
parent
2cc2e708bc
commit
4d7a594a1c
@ -30,6 +30,7 @@ if hasattr(boto.connection, 'HTTPResponse'):
|
||||
else:
|
||||
from six.moves import http_client as httplib
|
||||
import fixtures
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import versionutils
|
||||
import webob
|
||||
|
||||
@ -68,7 +69,7 @@ class FakeHttplibConnection(object):
|
||||
def request(self, method, path, data, headers):
|
||||
req = webob.Request.blank(path)
|
||||
req.method = method
|
||||
req.body = data
|
||||
req.body = encodeutils.safe_encode(data)
|
||||
req.headers = headers
|
||||
req.headers['Accept'] = 'text/html'
|
||||
req.host = self.host
|
||||
|
@ -28,7 +28,7 @@ def webob_factory(url):
|
||||
req.content_type = "application/json"
|
||||
req.method = method
|
||||
if body:
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
return req
|
||||
return web_request
|
||||
|
||||
|
@ -417,7 +417,7 @@ class ActionExtensionTest(ExtensionTestCase):
|
||||
request = webob.Request.blank(url)
|
||||
request.method = 'POST'
|
||||
request.content_type = 'application/json'
|
||||
request.body = jsonutils.dumps(body)
|
||||
request.body = jsonutils.dump_as_bytes(body)
|
||||
response = request.get_response(app)
|
||||
return response
|
||||
|
||||
@ -573,7 +573,7 @@ class ControllerExtensionTest(ExtensionTestCase):
|
||||
request = webob.Request.blank("/fake/tweedles/foo/action")
|
||||
request.method = 'POST'
|
||||
request.headers['Content-Type'] = 'application/json'
|
||||
request.body = jsonutils.dumps(dict(fooAction=True))
|
||||
request.body = jsonutils.dump_as_bytes(dict(fooAction=True))
|
||||
response = request.get_response(app)
|
||||
self.assertEqual(200, response.status_int)
|
||||
self.assertEqual(extension_body, response.body)
|
||||
@ -596,7 +596,7 @@ class ControllerExtensionTest(ExtensionTestCase):
|
||||
request = webob.Request.blank("/fake/tweedles/foo/action")
|
||||
request.method = 'POST'
|
||||
request.headers['Content-Type'] = 'application/json'
|
||||
request.body = jsonutils.dumps(dict(fooAction=True))
|
||||
request.body = jsonutils.dump_as_bytes(dict(fooAction=True))
|
||||
response = request.get_response(app)
|
||||
self.assertEqual(200, response.status_int)
|
||||
self.assertEqual(extension_body, response.body)
|
||||
|
@ -1349,7 +1349,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req = fakes.HTTPRequest.blank('/fake/servers/%s' % FAKE_UUID)
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/%s' % content_type
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
return req
|
||||
|
||||
def test_update_server_all_attributes(self):
|
||||
@ -1449,7 +1449,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req = fakes.HTTPRequest.blank('/fake/servers/%s' % FAKE_UUID)
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res_dict = self.controller.update(req, FAKE_UUID, body)
|
||||
|
||||
self.assertEqual(FAKE_UUID, res_dict['server']['id'])
|
||||
@ -1643,14 +1643,14 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
self.body['rebuild']['accessIPv4'] = '0.0.0.0'
|
||||
self.body['rebuild']['accessIPv6'] = 'fead::1234'
|
||||
self.body['rebuild']['metadata'][''] = 'world'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, self.body)
|
||||
|
||||
def test_rebuild_instance_name_with_leading_trailing_spaces(self):
|
||||
self.body['rebuild']['name'] = ' abc def '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
def fake_rebuild(*args, **kwargs):
|
||||
# NOTE(alex_xu): V2 API rebuild didn't strip the leading/trailing
|
||||
@ -1663,7 +1663,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
def test_rebuild_instance_name_with_spaces_in_middle(self):
|
||||
self.body['rebuild']['name'] = 'abc def'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.controller._action_rebuild(self.req, FAKE_UUID, self.body)
|
||||
|
||||
def test_rebuild_instance_with_metadata_key_too_long(self):
|
||||
@ -1671,7 +1671,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
self.body['rebuild']['accessIPv6'] = 'fead::1234'
|
||||
self.body['rebuild']['metadata'][('a' * 260)] = 'world'
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPRequestEntityTooLarge,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, self.body)
|
||||
@ -1681,7 +1681,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
self.body['rebuild']['accessIPv6'] = 'fead::1234'
|
||||
self.body['rebuild']['metadata']['key1'] = ('a' * 260)
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPRequestEntityTooLarge,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, self.body)
|
||||
@ -1696,7 +1696,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, self.body)
|
||||
@ -1710,7 +1710,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
min_ram="128", min_disk="100000")
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild, self.req,
|
||||
FAKE_UUID, self.body)
|
||||
@ -1725,7 +1725,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
status='active', size=size)
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild, self.req, FAKE_UUID, self.body)
|
||||
|
||||
@ -1737,7 +1737,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild, self.req, FAKE_UUID, self.body)
|
||||
|
||||
@ -1754,14 +1754,14 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
) as (
|
||||
show_mock, rebuild_mock
|
||||
):
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
|
||||
def test_rebuild_instance_with_null_image_ref(self):
|
||||
self.body['rebuild']['imageRef'] = None
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild, self.req, FAKE_UUID,
|
||||
self.body)
|
||||
@ -1989,7 +1989,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
|
||||
self.body['server']['imageRef'] = image_uuid
|
||||
self.body['server']['flavorRef'] = flavor
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
server = self.controller.create(self.req, self.body).obj['server']
|
||||
self._check_admin_pass_len(server)
|
||||
self.assertEqual(FAKE_UUID, server['id'])
|
||||
@ -2016,7 +2016,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_server_bad_image_href(self):
|
||||
image_href = 1
|
||||
self.body['server']['imageRef'] = image_href,
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create,
|
||||
self.req, self.body)
|
||||
@ -2025,7 +2025,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.ext_mgr.extensions = {'os-networks': 'fake'}
|
||||
self.body['server']['networks'] = {
|
||||
'uuid': '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create,
|
||||
self.req,
|
||||
@ -2041,7 +2041,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
{'status': 'active'})
|
||||
|
||||
self.body['server']['flavorRef'] = 2
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
with testtools.ExpectedException(
|
||||
webob.exc.HTTPBadRequest,
|
||||
'Image 76fa36fc-c930-4bf3-8c8a-ea2a2420deb6 is not active.'):
|
||||
@ -2061,7 +2061,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
{'size': orig_size})
|
||||
|
||||
self.body['server']['flavorRef'] = 2
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
with testtools.ExpectedException(
|
||||
webob.exc.HTTPBadRequest,
|
||||
"Flavor's disk is too small for requested image."):
|
||||
@ -2072,7 +2072,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
reservation_id
|
||||
"""
|
||||
self.ext_mgr.extensions = {'os-multiple-create': 'fake'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
self.assertEqual(FAKE_UUID, res["server"]["id"])
|
||||
self._check_admin_pass_len(res["server"])
|
||||
@ -2083,7 +2083,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
"""
|
||||
self.ext_mgr.extensions = {'os-multiple-create': 'fake'}
|
||||
self.flags(enable_instance_password=False)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
self.assertEqual(FAKE_UUID, res["server"]["id"])
|
||||
self._check_admin_pass_missing(res["server"])
|
||||
@ -2094,7 +2094,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
"""
|
||||
self.ext_mgr.extensions = {'os-multiple-create': 'fake'}
|
||||
self.body['server']['return_reservation_id'] = True
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body)
|
||||
reservation_id = res.obj.get('reservation_id')
|
||||
self.assertNotEqual(reservation_id, "")
|
||||
@ -2128,7 +2128,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_image_ref_is_bookmark(self):
|
||||
image_href = 'http://localhost/fake/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
server = res['server']
|
||||
self.assertEqual(FAKE_UUID, server['id'])
|
||||
@ -2137,7 +2137,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_uuid = 'this_is_not_a_valid_uuid'
|
||||
image_href = 'http://localhost/fake/images/%s' % image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create,
|
||||
self.req, self.body)
|
||||
|
||||
@ -2150,7 +2150,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
if no_image:
|
||||
self.body['server'].pop('imageRef', None)
|
||||
self.body['server'].update(params)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertIn('server',
|
||||
self.controller.create(self.req, self.body).obj)
|
||||
|
||||
@ -2263,24 +2263,24 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
|
||||
def test_create_instance_name_all_blank_spaces(self):
|
||||
self.body['server']['name'] = ' ' * 64
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_name_with_spaces_in_middle(self):
|
||||
self.body['server']['name'] = 'abc def'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.controller.create(self.req, self.body)
|
||||
|
||||
def test_create_instance_name_too_long(self):
|
||||
self.body['server']['name'] = 'X' * 256
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create,
|
||||
self.req, self.body)
|
||||
|
||||
def test_create_instance_name_with_leading_trailing_spaces(self):
|
||||
self.body['server']['name'] = ' abc def '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
server = self._test_create_instance()
|
||||
self.assertEqual(
|
||||
self.body['server']['name'].strip(),
|
||||
@ -2288,13 +2288,13 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
|
||||
def test_create_instance_az_with_leading_trailing_spaces(self):
|
||||
self.body['server']['availability_zone'] = ' zone1 '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
with mock.patch.object(availability_zones, 'get_availability_zones',
|
||||
return_value=[' zone1 ']):
|
||||
self._test_create_instance()
|
||||
|
||||
def test_create_instance(self):
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2303,7 +2303,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
|
||||
def test_create_instance_pass_disabled(self):
|
||||
self.flags(enable_instance_password=False)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2316,14 +2316,14 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
exception.ImageNUMATopologyIncomplete)
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_too_much_metadata(self):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata']['vote'] = 'fiddletown'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
@ -2331,42 +2331,42 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata'] = {('a' * 260): '12345'}
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPRequestEntityTooLarge,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_metadata_value_too_long(self):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata'] = {'key1': ('a' * 260)}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPRequestEntityTooLarge,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_metadata_key_blank(self):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata'] = {'': 'abcd'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_metadata_not_dict(self):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata'] = 'string'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_metadata_key_not_string(self):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata'] = {1: 'test'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_metadata_value_not_string(self):
|
||||
self.flags(quota_metadata_items=1)
|
||||
self.body['server']['metadata'] = {'test': ['a', 'list']}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
@ -2381,7 +2381,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
user_id=1))
|
||||
def test_create_instance_invalid_key_name(self, mock_create):
|
||||
self.body['server']['key_name'] = 'nonexistentkey'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
@ -2390,13 +2390,13 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
user_id=1))
|
||||
def test_create_instance_empty_key_name(self, mock_create):
|
||||
self.body['server']['key_name'] = ''
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_valid_key_name(self):
|
||||
self.body['server']['key_name'] = 'key'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
|
||||
self.assertEqual(FAKE_UUID, res["server"]["id"])
|
||||
@ -2405,35 +2405,35 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_invalid_flavor_href(self):
|
||||
flavor_ref = 'http://localhost/v2/flavors/asdf'
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_invalid_flavor_id_int(self):
|
||||
flavor_ref = -1
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_invalid_flavor_id_empty(self):
|
||||
flavor_ref = ""
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_bad_flavor_href(self):
|
||||
flavor_ref = 'http://localhost/v2/flavors/17'
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_with_config_drive(self):
|
||||
self.ext_mgr.extensions = {'os-config-drive': 'fake'}
|
||||
self.body['server']['config_drive'] = "true"
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
server = res['server']
|
||||
self.assertEqual(FAKE_UUID, server['id'])
|
||||
@ -2441,14 +2441,14 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_with_bad_config_drive(self):
|
||||
self.ext_mgr.extensions = {'os-config-drive': 'fake'}
|
||||
self.body['server']['config_drive'] = 'adcd'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_without_config_drive(self):
|
||||
self.ext_mgr.extensions = {'os-config-drive': 'fake'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
server = res['server']
|
||||
self.assertEqual(FAKE_UUID, server['id'])
|
||||
@ -2468,13 +2468,13 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_bad_href(self):
|
||||
image_href = 'asdf'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
def test_create_instance_local_href(self):
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2483,7 +2483,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_admin_pass(self):
|
||||
self.body['server']['flavorRef'] = 3,
|
||||
self.body['server']['adminPass'] = 'testpass'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2493,7 +2493,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.flags(enable_instance_password=False)
|
||||
self.body['server']['flavorRef'] = 3,
|
||||
self.body['server']['adminPass'] = 'testpass'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2503,7 +2503,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_admin_pass_empty(self):
|
||||
self.body['server']['flavorRef'] = 3,
|
||||
self.body['server']['adminPass'] = ''
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
# The fact that the action doesn't raise is enough validation
|
||||
self.controller.create(self.req, self.body)
|
||||
@ -2837,7 +2837,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
"contents": "b25zLiINCg0KLVJpY2hhcmQgQ$$%QQmFjaA==",
|
||||
},
|
||||
]
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, self.body)
|
||||
|
||||
@ -2845,7 +2845,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
selfhref = 'http://localhost/v2/fake/servers/%s' % FAKE_UUID
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
robj = self.controller.create(self.req, self.body)
|
||||
self.assertEqual(selfhref, robj['Location'])
|
||||
|
||||
@ -2853,7 +2853,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
expected_msg):
|
||||
fakes.stub_out_instance_quota(self.stubs, allowed, quota, resource)
|
||||
self.body['server']['flavorRef'] = 3
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
try:
|
||||
self.controller.create(self.req, self.body).obj['server']
|
||||
self.fail('expected quota to be exceeded')
|
||||
@ -2902,7 +2902,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.ext_mgr.extensions = {'OS-SCH-HNT': 'fake',
|
||||
'os-server-group-quotas': 'fake'}
|
||||
self.body['server']['scheduler_hints'] = {'group': fake_group.uuid}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
expected_msg = "Quota exceeded, too many servers in group"
|
||||
|
||||
@ -2926,7 +2926,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.ext_mgr.extensions = {'OS-SCH-HNT': 'fake',
|
||||
'os-server-group-quotas': 'fake'}
|
||||
self.body['server']['scheduler_hints'] = {'group': test_group.uuid}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
server = self.controller.create(self.req, self.body).obj['server']
|
||||
|
||||
test_group = objects.InstanceGroup.get_by_uuid(ctxt, test_group.uuid)
|
||||
@ -3000,7 +3000,7 @@ class ServersControllerCreateTestWithMock(test.TestCase):
|
||||
if no_image:
|
||||
self.body['server'].pop('imageRef', None)
|
||||
self.body['server'].update(params)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.controller.create(self.req, self.body).obj['server']
|
||||
|
||||
@mock.patch.object(compute_api.API, 'create')
|
||||
|
@ -39,7 +39,7 @@ class APITest(test.NoDBTestCase):
|
||||
def test_malformed_json(self):
|
||||
req = webob.Request.blank('/')
|
||||
req.method = 'POST'
|
||||
req.body = '{'
|
||||
req.body = b'{'
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
res = req.get_response(self.wsgi_app)
|
||||
@ -48,7 +48,7 @@ class APITest(test.NoDBTestCase):
|
||||
def test_malformed_xml(self):
|
||||
req = webob.Request.blank('/')
|
||||
req.method = 'POST'
|
||||
req.body = '<hi im not xml>'
|
||||
req.body = b'<hi im not xml>'
|
||||
req.headers["content-type"] = "application/xml"
|
||||
|
||||
res = req.get_response(self.wsgi_app)
|
||||
|
@ -88,7 +88,7 @@ class BlockDeviceMappingTestV21(test.TestCase):
|
||||
req.method = 'POST'
|
||||
req.headers['content-type'] = 'application/json'
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
|
||||
if override_controller:
|
||||
override_controller.create(req, body=body).obj['server']
|
||||
|
@ -88,7 +88,7 @@ class BlockDeviceMappingTestV21(test.TestCase):
|
||||
req.method = 'POST'
|
||||
req.headers['content-type'] = 'application/json'
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
|
||||
if override_controller:
|
||||
override_controller.create(req, body=body).obj['server']
|
||||
|
@ -152,7 +152,7 @@ class ServersControllerCreateTestV21(test.TestCase):
|
||||
body = dict(server=server)
|
||||
req = fakes.HTTPRequest.blank(self.base_url + 'servers')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
if override_controller is not None:
|
||||
server = override_controller.create(req, body=body).obj['server']
|
||||
@ -193,7 +193,7 @@ class ServersControllerCreateTestV21(test.TestCase):
|
||||
|
||||
req = fakes.HTTPRequest.blank(self.base_url + 'servers')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
return req, body
|
||||
|
@ -134,7 +134,7 @@ class CreateserverextTest(test.TestCase):
|
||||
req = webob.Request.blank('/v2/fake/os-create-server-ext')
|
||||
req.headers['Content-Type'] = 'application/json'
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body_dict)
|
||||
req.body = jsonutils.dump_as_bytes(body_dict)
|
||||
return req
|
||||
|
||||
def _create_instance_with_networks_json(self, networks):
|
||||
|
@ -222,7 +222,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
API_DISK_CONFIG: 'AUTO'
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'AUTO')
|
||||
@ -238,7 +238,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
API_DISK_CONFIG: 'MANUAL'
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'MANUAL')
|
||||
@ -256,7 +256,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
'flavorRef': '1',
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'MANUAL')
|
||||
@ -270,7 +270,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
'flavorRef': '1',
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'AUTO')
|
||||
@ -285,7 +285,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
'flavorRef': '1',
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'MANUAL')
|
||||
@ -301,7 +301,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
API_DISK_CONFIG: 'AUTO'
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(res.status_int, 400)
|
||||
|
||||
@ -316,7 +316,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
API_DISK_CONFIG: 'MANUAL'
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'MANUAL')
|
||||
@ -327,7 +327,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'server': {API_DISK_CONFIG: disk_config}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, disk_config)
|
||||
@ -345,7 +345,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'server': {API_DISK_CONFIG: 'server_test'}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(res.status_int, 400)
|
||||
expected_msg = self._get_expected_msg_for_invalid_disk_config()
|
||||
@ -363,7 +363,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
'imageRef': 'cedef40a-ed67-4d10-800e-17455edce175',
|
||||
API_DISK_CONFIG: disk_config
|
||||
}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, disk_config)
|
||||
@ -393,7 +393,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
|
||||
self.stubs.Set(compute_api.API, 'create', create)
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'AUTO')
|
||||
@ -414,7 +414,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
|
||||
self.stubs.Set(compute_api.API, 'rebuild', rebuild)
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
server_dict = jsonutils.loads(res.body)['server']
|
||||
self.assertDiskConfig(server_dict, 'AUTO')
|
||||
@ -435,7 +435,7 @@ class DiskConfigTestCaseV21(test.TestCase):
|
||||
|
||||
self.stubs.Set(compute_api.API, 'resize', resize)
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.get_response(self.app)
|
||||
|
||||
|
||||
|
@ -120,7 +120,7 @@ class ExtendedVolumesTestV21(test.TestCase):
|
||||
req.headers = {os_wsgi.API_VERSION_REQUEST_HEADER:
|
||||
self.wsgi_api_version}
|
||||
if body:
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.method = 'POST'
|
||||
req.content_type = self.content_type
|
||||
res = req.get_response(self.app)
|
||||
|
@ -184,7 +184,7 @@ class FlavorManageTestV21(test.NoDBTestCase):
|
||||
req = req if req else self._get_http_request(url=self.base_url)
|
||||
req.headers['Content-Type'] = 'application/json'
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(200, res.status_code)
|
||||
return jsonutils.loads(res.body)
|
||||
@ -407,7 +407,7 @@ class PrivateFlavorManageTestV21(test.TestCase):
|
||||
req = self._get_http_request(self.base_url)
|
||||
req.headers['Content-Type'] = 'application/json'
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(self.expected)
|
||||
req.body = jsonutils.dump_as_bytes(self.expected)
|
||||
res = req.get_response(self.app)
|
||||
return jsonutils.loads(res.body)
|
||||
|
||||
|
@ -82,7 +82,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata')
|
||||
req.method = 'POST'
|
||||
body = {"metadata": {"key7": "value7"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
res = self.controller.create(req, '123', body=body)
|
||||
get_mocked.assert_called_once_with(mock.ANY, '123')
|
||||
@ -107,7 +107,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/100/metadata')
|
||||
req.method = 'POST'
|
||||
body = {"metadata": {"key7": "value7"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound,
|
||||
@ -122,7 +122,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": {"key9": "value9"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
res = self.controller.update_all(req, '123', body=body)
|
||||
get_mocked.assert_called_once_with(mock.ANY, '123')
|
||||
@ -144,7 +144,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/100/metadata')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": {"key9": "value9"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound,
|
||||
@ -158,7 +158,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "zz"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
res = self.controller.update(req, '123', 'key1', body=body)
|
||||
expected = copy.deepcopy(get_image_123())
|
||||
@ -179,7 +179,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/100/metadata/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "zz"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound,
|
||||
@ -195,7 +195,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"key1": "zz"}
|
||||
req.body = ''
|
||||
req.body = b''
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.invalid_request,
|
||||
@ -214,7 +214,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"foo": "bar"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
@ -231,7 +231,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata/bad')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
@ -279,7 +279,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
body = {"metadata": {"foo": "bar"}}
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
@ -295,7 +295,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata/blah')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"blah": "blah", "blah1": "blah1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.invalid_request,
|
||||
@ -309,7 +309,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/images/123/metadata/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
@ -326,7 +326,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
% image_id)
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
@ -343,7 +343,7 @@ class ImageMetaDataTestV21(test.NoDBTestCase):
|
||||
% image_id)
|
||||
req.method = 'POST'
|
||||
body = {"metadata": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
|
@ -319,7 +319,7 @@ class KeypairsTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.base_url + '/servers')
|
||||
req.method = 'POST'
|
||||
req.headers["content-type"] = "application/json"
|
||||
req.body = jsonutils.dumps({'server': {'name': 'test',
|
||||
req.body = jsonutils.dump_as_bytes({'server': {'name': 'test',
|
||||
'flavorRef': 1,
|
||||
'keypair_name': ' abc ',
|
||||
'imageRef': FAKE_UUID}})
|
||||
@ -337,7 +337,7 @@ class KeypairsTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.base_url + '/servers')
|
||||
req.method = 'POST'
|
||||
req.headers["content-type"] = "application/json"
|
||||
req.body = jsonutils.dumps({'server': {'name': 'test',
|
||||
req.body = jsonutils.dump_as_bytes({'server': {'name': 'test',
|
||||
'flavorRef': 1,
|
||||
'keypair_name': ' abc ',
|
||||
'imageRef': FAKE_UUID}})
|
||||
@ -462,7 +462,7 @@ class KeypairsTestV2(KeypairsTestV21):
|
||||
req = fakes.HTTPRequest.blank(self.base_url + '/servers')
|
||||
req.method = 'POST'
|
||||
req.headers["content-type"] = "application/json"
|
||||
req.body = jsonutils.dumps({'server': {'name': 'test',
|
||||
req.body = jsonutils.dump_as_bytes({'server': {'name': 'test',
|
||||
'flavorRef': 1,
|
||||
'keypair_name': ' abc ',
|
||||
'imageRef': FAKE_UUID}})
|
||||
|
@ -22,6 +22,7 @@ from six.moves import StringIO
|
||||
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import encodeutils
|
||||
import six
|
||||
from six.moves import range
|
||||
import webob
|
||||
@ -677,7 +678,7 @@ class WsgiLimiterTest(BaseLimitTestSuite):
|
||||
request = webob.Request.blank("/")
|
||||
|
||||
request.method = "POST"
|
||||
request.body = self._request_data(verb, url)
|
||||
request.body = encodeutils.safe_encode(self._request_data(verb, url))
|
||||
response = request.get_response(self.app)
|
||||
|
||||
if "X-Wait-Seconds" in response.headers:
|
||||
@ -754,7 +755,7 @@ class FakeHttplibConnection(object):
|
||||
req.method = method
|
||||
req.headers = headers
|
||||
req.host = self.host
|
||||
req.body = body
|
||||
req.body = encodeutils.safe_encode(body)
|
||||
|
||||
resp = str(req.get_response(self.app))
|
||||
resp = "HTTP/1.0 %s" % resp
|
||||
|
@ -182,7 +182,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
req.method = 'POST'
|
||||
req.headers = {self.header_name: '2.2'}
|
||||
req.environ['CONTENT_TYPE'] = "application/json"
|
||||
req.body = jsonutils.dumps({'dummy': {'val': 'foo'}})
|
||||
req.body = jsonutils.dump_as_bytes({'dummy': {'val': 'foo'}})
|
||||
|
||||
res = req.get_response(app)
|
||||
self.assertEqual(200, res.status_int)
|
||||
@ -202,7 +202,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
req.method = 'POST'
|
||||
req.headers = {self.header_name: '2.2'}
|
||||
req.environ['CONTENT_TYPE'] = "application/json"
|
||||
req.body = jsonutils.dumps({'dummy': {'invalid_param': 'foo'}})
|
||||
req.body = jsonutils.dump_as_bytes({'dummy': {'invalid_param': 'foo'}})
|
||||
|
||||
res = req.get_response(app)
|
||||
self.assertEqual(400, res.status_int)
|
||||
@ -221,7 +221,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/microversions3/1')
|
||||
req.method = 'PUT'
|
||||
req.headers = {self.header_name: '2.2'}
|
||||
req.body = jsonutils.dumps({'dummy': {'inv_val': 'foo'}})
|
||||
req.body = jsonutils.dump_as_bytes({'dummy': {'inv_val': 'foo'}})
|
||||
req.environ['CONTENT_TYPE'] = "application/json"
|
||||
|
||||
res = req.get_response(app)
|
||||
@ -242,7 +242,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
req.headers = {self.header_name: '2.10'}
|
||||
req.environ['CONTENT_TYPE'] = "application/json"
|
||||
req.method = 'PUT'
|
||||
req.body = jsonutils.dumps({'dummy': {'val2': 'foo'}})
|
||||
req.body = jsonutils.dump_as_bytes({'dummy': {'val2': 'foo'}})
|
||||
|
||||
res = req.get_response(app)
|
||||
self.assertEqual(200, res.status_int)
|
||||
@ -311,7 +311,7 @@ class MicroversionsTest(test.NoDBTestCase):
|
||||
if req_header:
|
||||
req.headers = {self.header_name: req_header}
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({'foo': None})
|
||||
req.body = jsonutils.dump_as_bytes({'foo': None})
|
||||
|
||||
res = self._test_microversions(app, req, ret_code,
|
||||
ret_header=ret_header)
|
||||
|
@ -20,6 +20,7 @@ from neutronclient.common import exceptions as n_exc
|
||||
from neutronclient.neutron import v2_0 as neutronv20
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import encodeutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.legacy_v2.contrib import security_groups
|
||||
@ -504,7 +505,7 @@ class TestNeutronSecurityGroupsOutputTest(TestNeutronSecurityGroupsTestCase):
|
||||
req = webob.Request.blank(url)
|
||||
if body:
|
||||
req.method = 'POST'
|
||||
req.body = self._encode_body(body)
|
||||
req.body = encodeutils.safe_encode(self._encode_body(body))
|
||||
req.content_type = self.content_type
|
||||
req.headers['Accept'] = self.content_type
|
||||
res = req.get_response(fakes.wsgi_app(init_only=('servers',)))
|
||||
|
@ -69,7 +69,7 @@ class SchedulerHintsTestCaseV21(test.TestCase):
|
||||
'flavorRef': '1',
|
||||
}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(202, res.status_int)
|
||||
|
||||
@ -93,7 +93,7 @@ class SchedulerHintsTestCaseV21(test.TestCase):
|
||||
'os:scheduler_hints': {'group': 'foo'},
|
||||
}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(202, res.status_int)
|
||||
|
||||
@ -109,7 +109,7 @@ class SchedulerHintsTestCaseV21(test.TestCase):
|
||||
},
|
||||
'os:scheduler_hints': param,
|
||||
}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(400, res.status_int)
|
||||
|
||||
@ -198,7 +198,7 @@ class ServersControllerCreateTestV21(test.TestCase):
|
||||
body.update(params)
|
||||
req = self._get_request()
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
server = self.no_scheduler_hints_controller.create(
|
||||
req, body=body).obj['server']
|
||||
|
@ -17,6 +17,7 @@ import mock
|
||||
from mox3 import mox
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import encodeutils
|
||||
import webob
|
||||
|
||||
from nova.api.openstack.compute.legacy_v2.contrib import security_groups as \
|
||||
@ -1335,7 +1336,7 @@ class SecurityGroupsOutputTestV21(test.TestCase):
|
||||
req = webob.Request.blank(url)
|
||||
if body:
|
||||
req.method = 'POST'
|
||||
req.body = self._encode_body(body)
|
||||
req.body = encodeutils.safe_encode(self._encode_body(body))
|
||||
req.content_type = self.content_type
|
||||
req.headers['Accept'] = self.content_type
|
||||
res = req.get_response(self.app)
|
||||
|
@ -221,7 +221,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req.method = 'POST'
|
||||
req.content_type = "application/json"
|
||||
body = {"metadata": {"key9": "value9"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res_dict = self.controller.create(req, self.uuid, body=body)
|
||||
|
||||
body['metadata'].update({
|
||||
@ -247,7 +247,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": {"": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -259,7 +259,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": None}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -271,7 +271,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": {("a" * 260): "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
@ -284,7 +284,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.url + '/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -296,7 +296,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.url + '/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": ['asdf']}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -308,7 +308,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request()
|
||||
req.method = 'POST'
|
||||
body = {"metadata": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound,
|
||||
@ -325,7 +325,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
'key29': 'newkey',
|
||||
}
|
||||
}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
response = self.controller.update_all(req, self.uuid, body=expected)
|
||||
self.assertEqual(expected, response)
|
||||
|
||||
@ -340,7 +340,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
'key99': 'value99',
|
||||
},
|
||||
}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
res_dict = self.controller.update_all(req, self.uuid, body=expected)
|
||||
|
||||
self.assertEqual(expected, res_dict)
|
||||
@ -351,7 +351,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
expected = {'metadata': {}}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
res_dict = self.controller.update_all(req, self.uuid, body=expected)
|
||||
|
||||
self.assertEqual(expected, res_dict)
|
||||
@ -373,7 +373,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.url + '/bad')
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": None}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -387,7 +387,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
expected = {'meta': {}}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
self.controller.update_all, req, self.uuid,
|
||||
@ -400,7 +400,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
expected = {'metadata': ['asdf']}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
self.controller.update_all, req, self.uuid,
|
||||
@ -412,7 +412,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
body = {'metadata': {'key10': 'value10'}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound,
|
||||
self.controller.update_all, req, '100', body=body)
|
||||
@ -423,7 +423,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request()
|
||||
req.method = 'PUT'
|
||||
body = {"metadata": None}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex, self.controller.update_all,
|
||||
@ -434,7 +434,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
res_dict = self.controller.update(req, self.uuid, 'key1', body=body)
|
||||
expected = {"meta": {'key1': 'value1'}}
|
||||
@ -446,7 +446,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPNotFound,
|
||||
@ -470,7 +470,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.url)
|
||||
req.method = 'PUT'
|
||||
expected = {'meta': {}}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -483,7 +483,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.url)
|
||||
req.method = 'PUT'
|
||||
expected = {'metadata': ['asdf']}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -496,7 +496,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -509,7 +509,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {("a" * 260): "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
@ -522,7 +522,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": ("a" * 260)}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
@ -535,7 +535,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/key1')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "value1", "key2": "value2"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -548,7 +548,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/bad')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": {"key1": "value1"}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
@ -561,7 +561,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = self._get_request('/bad')
|
||||
req.method = 'PUT'
|
||||
body = {"meta": None}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -574,7 +574,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
req = fakes.HTTPRequest.blank(self.url)
|
||||
req.method = 'PUT'
|
||||
expected = {'metadata': {}}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(self.validation_ex,
|
||||
@ -589,7 +589,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
data['metadata']['key%i' % num] = "blah"
|
||||
req = self._get_request()
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
@ -604,19 +604,19 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
|
||||
# test for long key
|
||||
data = {"metadata": {"a" * 260: "value1"}}
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
self.controller.create, req, self.uuid, body=data)
|
||||
|
||||
# test for long value
|
||||
data = {"metadata": {"key": "v" * 260}}
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
self.controller.create, req, self.uuid, body=data)
|
||||
|
||||
# test for empty key.
|
||||
data = {"metadata": {"": "value1"}}
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
self.assertRaises(self.validation_ex,
|
||||
self.controller.create, req, self.uuid, body=data)
|
||||
|
||||
@ -628,7 +628,7 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
data['metadata']['key%i' % num] = "blah"
|
||||
req = self._get_request()
|
||||
req.method = 'PUT'
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
self.assertRaises(webob.exc.HTTPForbidden, self.controller.update_all,
|
||||
@ -644,26 +644,26 @@ class ServerMetaDataTestV21(test.TestCase):
|
||||
data['metadata']['key%i' % num] = "blah"
|
||||
req = self._get_request()
|
||||
req.method = 'PUT'
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
req.headers["content-type"] = "application/json"
|
||||
|
||||
# test for long key
|
||||
data = {"metadata": {"a" * 260: "value1"}}
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
self.controller.update_all, req, self.uuid,
|
||||
body=data)
|
||||
|
||||
# test for long value
|
||||
data = {"metadata": {"key": "v" * 260}}
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
self.assertRaises(self.validation_ex_large,
|
||||
self.controller.update_all, req, self.uuid,
|
||||
body=data)
|
||||
|
||||
# test for empty key.
|
||||
data = {"metadata": {"": "value1"}}
|
||||
req.body = jsonutils.dumps(data)
|
||||
req.body = jsonutils.dump_as_bytes(data)
|
||||
self.assertRaises(self.validation_ex,
|
||||
self.controller.update_all, req, self.uuid,
|
||||
body=data)
|
||||
@ -724,7 +724,7 @@ class BadStateServerMetaDataTestV21(test.TestCase):
|
||||
'key29': 'newkey',
|
||||
}
|
||||
}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
self.assertRaises(webob.exc.HTTPConflict, self.controller.update_all,
|
||||
req, self.uuid, body=expected)
|
||||
|
||||
@ -757,7 +757,7 @@ class BadStateServerMetaDataTestV21(test.TestCase):
|
||||
'keydummy': 'newkey',
|
||||
}
|
||||
}
|
||||
req.body = jsonutils.dumps(expected)
|
||||
req.body = jsonutils.dump_as_bytes(expected)
|
||||
self.assertRaises(webob.exc.HTTPConflict, self.controller.update_all,
|
||||
req, self.uuid, body=expected)
|
||||
|
||||
|
@ -1530,12 +1530,12 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
def test_rebuild_instance_name_with_spaces_in_the_middle(self):
|
||||
self.body['rebuild']['name'] = 'abc def'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.controller._action_rebuild(self.req, FAKE_UUID, body=self.body)
|
||||
|
||||
def test_rebuild_instance_name_with_leading_trailing_spaces(self):
|
||||
self.body['rebuild']['name'] = ' abc def '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1543,7 +1543,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
def test_rebuild_instance_name_with_leading_trailing_spaces_compat_mode(
|
||||
self):
|
||||
self.body['rebuild']['name'] = ' abc def '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.req.set_legacy_v2()
|
||||
|
||||
def fake_rebuild(*args, **kwargs):
|
||||
@ -1556,7 +1556,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
def test_rebuild_instance_with_blank_metadata_key(self):
|
||||
self.body['rebuild']['metadata'][''] = 'world'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1564,7 +1564,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
def test_rebuild_instance_with_metadata_key_too_long(self):
|
||||
self.body['rebuild']['metadata'][('a' * 260)] = 'world'
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1572,7 +1572,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
def test_rebuild_instance_with_metadata_value_too_long(self):
|
||||
self.body['rebuild']['metadata']['key1'] = ('a' * 260)
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller._action_rebuild, self.req,
|
||||
FAKE_UUID, body=self.body)
|
||||
@ -1580,7 +1580,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
def test_rebuild_instance_with_metadata_value_not_string(self):
|
||||
self.body['rebuild']['metadata']['key1'] = 1
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller._action_rebuild, self.req,
|
||||
FAKE_UUID, body=self.body)
|
||||
@ -1595,7 +1595,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1609,7 +1609,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
min_ram="128", min_disk="100000")
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild, self.req,
|
||||
FAKE_UUID, body=self.body)
|
||||
@ -1624,7 +1624,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
status='active', size=size)
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1636,7 +1636,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
self.body['rebuild']['name'] = ' '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1649,7 +1649,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
|
||||
self.stubs.Set(fake._FakeImageService, 'show', fake_get_image)
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1667,7 +1667,7 @@ class ServersControllerRebuildInstanceTest(ControllerTest):
|
||||
) as (
|
||||
show_mock, rebuild_mock
|
||||
):
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
self.controller._action_rebuild,
|
||||
self.req, FAKE_UUID, body=self.body)
|
||||
@ -1816,7 +1816,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req = fakes.HTTPRequestV21.blank('/fake/servers/%s' % FAKE_UUID)
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
return req
|
||||
|
||||
def test_update_server_all_attributes(self):
|
||||
@ -1850,7 +1850,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'server': {'name': ' ' * 64}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
self.assertRaises(exception.ValidationError, self.controller.update,
|
||||
req, FAKE_UUID, body=body)
|
||||
|
||||
@ -1861,7 +1861,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'server': {'name': 'abc def'}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
self.controller.update(req, FAKE_UUID, body=body)
|
||||
|
||||
def test_update_server_name_with_leading_trailing_spaces(self):
|
||||
@ -1871,7 +1871,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'server': {'name': ' abc def '}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.update, req, FAKE_UUID, body=body)
|
||||
|
||||
@ -1882,7 +1882,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'server': {'name': ' abc def '}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.set_legacy_v2()
|
||||
self.controller.update(req, FAKE_UUID, body=body)
|
||||
|
||||
@ -1893,7 +1893,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req = fakes.HTTPRequest.blank('/fake/servers/%s' % FAKE_UUID)
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
self.assertRaises(exception.ValidationError, self.controller.update,
|
||||
req, FAKE_UUID, body=body)
|
||||
|
||||
@ -1904,7 +1904,7 @@ class ServersControllerUpdateTest(ControllerTest):
|
||||
req = fakes.HTTPRequest.blank('/fake/servers/%s' % FAKE_UUID)
|
||||
req.method = 'PUT'
|
||||
req.content_type = "application/json"
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
self.assertRaises(exception.ValidationError, self.controller.update,
|
||||
req, FAKE_UUID, body=body)
|
||||
|
||||
@ -2162,7 +2162,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_uuid = 'c905cedb-7281-47e4-8a62-f26bc5fc4c77'
|
||||
self.body['server']['imageRef'] = image_uuid
|
||||
self.body['server']['flavorRef'] = flavor
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
server = self.controller.create(self.req, body=self.body).obj['server']
|
||||
self._check_admin_password_len(server)
|
||||
self.assertEqual(FAKE_UUID, server['id'])
|
||||
@ -2189,7 +2189,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 1
|
||||
self.body['server']['min_count'] = 1
|
||||
self.body['server']['imageRef'] = image_href,
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create,
|
||||
self.req, body=self.body)
|
||||
@ -2209,7 +2209,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
# }
|
||||
# req = fakes.HTTPRequest.blank('/fake/servers')
|
||||
# req.method = 'POST'
|
||||
# req.body = jsonutils.dumps(body)
|
||||
# req.body = jsonutils.dump_as_bytes(body)
|
||||
# req.headers["content-type"] = "application/json"
|
||||
# self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
# self.controller.create,
|
||||
@ -2225,7 +2225,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
{'status': 'active'})
|
||||
|
||||
self.body['server']['flavorRef'] = 2
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
with testtools.ExpectedException(
|
||||
webob.exc.HTTPBadRequest,
|
||||
'Image 76fa36fc-c930-4bf3-8c8a-ea2a2420deb6 is not active.'):
|
||||
@ -2246,7 +2246,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
{'size': orig_size})
|
||||
|
||||
self.body['server']['flavorRef'] = 2
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
with testtools.ExpectedException(
|
||||
webob.exc.HTTPBadRequest,
|
||||
@ -2256,7 +2256,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_image_ref_is_bookmark(self):
|
||||
image_href = 'http://localhost/fake/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2268,7 +2268,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
flavor_ref = 'http://localhost/fake/flavors/3'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest, self.controller.create,
|
||||
self.req, body=self.body)
|
||||
|
||||
@ -2281,7 +2281,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
if no_image:
|
||||
self.body['server'].pop('imageRef', None)
|
||||
self.body['server'].update(params)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.req.headers["content-type"] = "application/json"
|
||||
self.controller.create(self.req, body=self.body).obj['server']
|
||||
|
||||
@ -2434,7 +2434,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.flags(enable_instance_password=False)
|
||||
image_href = 'http://localhost/v2/fake/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2446,7 +2446,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['name'] = 'X' * 256
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError, self.controller.create,
|
||||
self.req, body=self.body)
|
||||
|
||||
@ -2455,7 +2455,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['name'] = 'abc def'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.controller.create(self.req, body=self.body)
|
||||
|
||||
def test_create_instance_name_with_leading_trailing_spaces(self):
|
||||
@ -2463,7 +2463,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['name'] = ' abc def '
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2473,7 +2473,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['name'] = ' abc def '
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.req.set_legacy_v2()
|
||||
self.controller.create(self.req, body=self.body)
|
||||
|
||||
@ -2496,7 +2496,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
|
||||
req = fakes.HTTPRequest.blank('/fake/servers')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, req, body=body)
|
||||
@ -2506,7 +2506,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['availability_zone'] = ' zone1 '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2517,7 +2517,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.body['server']['name'] = ' abc def '
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['availability_zones'] = ' zone1 '
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.req.set_legacy_v2()
|
||||
with mock.patch.object(availability_zones, 'get_availability_zones',
|
||||
return_value=[' zone1 ']):
|
||||
@ -2527,7 +2527,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
# proper local hrefs must start with 'http://localhost/v2/'
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2559,7 +2559,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
|
||||
req = fakes.HTTPRequestV21.blank('/fake/servers')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
self.assertRaises(webob.exc.HTTPInternalServerError,
|
||||
self.controller.create, req, body=body)
|
||||
@ -2569,7 +2569,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
# proper local hrefs must start with 'http://localhost/v2/'
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2587,7 +2587,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
'memtotal': 0})
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2606,7 +2606,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata']['vote'] = 'fiddletown'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2616,7 +2616,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata'] = {('a' * 260): '12345'}
|
||||
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2625,7 +2625,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata'] = {'key1': ('a' * 260)}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2634,7 +2634,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata'] = {'': 'abcd'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2643,7 +2643,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata'] = 'string'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2652,7 +2652,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata'] = {1: 'test'}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2661,7 +2661,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/%s' % self.image_uuid
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['metadata'] = {'test': ['a', 'list']}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2674,13 +2674,13 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
image_href = 'http://localhost/v2/images/2'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['key_name'] = 'nonexistentkey'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
def test_create_instance_valid_key_name(self):
|
||||
self.body['server']['key_name'] = 'key'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
self.assertEqual(FAKE_UUID, res["server"]["id"])
|
||||
@ -2691,7 +2691,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
flavor_ref = 'http://localhost/v2/flavors/asdf'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2700,14 +2700,14 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
flavor_ref = -1
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
def test_create_instance_invalid_flavor_id_empty(self):
|
||||
flavor_ref = ""
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(exception.ValidationError,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -2716,20 +2716,20 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
flavor_ref = 'http://localhost/v2/flavors/17'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.body['server']['flavorRef'] = flavor_ref
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
def test_create_instance_bad_href(self):
|
||||
image_href = 'asdf'
|
||||
self.body['server']['imageRef'] = image_href
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
def test_create_instance_local_href(self):
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2738,7 +2738,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_admin_password(self):
|
||||
self.body['server']['flavorRef'] = 3
|
||||
self.body['server']['adminPass'] = 'testpass'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
server = res['server']
|
||||
@ -2749,7 +2749,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.flags(enable_instance_password=False)
|
||||
self.body['server']['flavorRef'] = 3
|
||||
self.body['server']['adminPass'] = 'testpass'
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
res = self.controller.create(self.req, body=self.body).obj
|
||||
|
||||
self.assertIn('server', res)
|
||||
@ -2758,14 +2758,14 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_admin_password_empty(self):
|
||||
self.body['server']['flavorRef'] = 3
|
||||
self.body['server']['adminPass'] = ''
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
|
||||
# The fact that the action doesn't raise is enough validation
|
||||
self.controller.create(self.req, body=self.body)
|
||||
|
||||
def test_create_location(self):
|
||||
selfhref = 'http://localhost/v2/fake/servers/%s' % FAKE_UUID
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
robj = self.controller.create(self.req, body=self.body)
|
||||
|
||||
self.assertEqual(robj['Location'], selfhref)
|
||||
@ -2774,7 +2774,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
expected_msg):
|
||||
fakes.stub_out_instance_quota(self.stubs, allowed, quota, resource)
|
||||
self.body['server']['flavorRef'] = 3
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
try:
|
||||
self.controller.create(self.req, body=self.body).obj['server']
|
||||
self.fail('expected quota to be exceeded')
|
||||
@ -2821,7 +2821,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.stubs.Set(fakes.QUOTAS, 'limit_check', fake_limit_check)
|
||||
self.stubs.Set(db, 'instance_destroy', fake_instance_destroy)
|
||||
self.body['os:scheduler_hints'] = {'group': fake_group.uuid}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
expected_msg = "Quota exceeded, too many servers in group"
|
||||
|
||||
try:
|
||||
@ -2842,7 +2842,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
|
||||
self.stubs.Set(db, 'instance_destroy', fake_instance_destroy)
|
||||
self.body['os:scheduler_hints'] = {'group': test_group.uuid}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
server = self.controller.create(self.req, body=self.body).obj['server']
|
||||
|
||||
test_group = objects.InstanceGroup.get_by_uuid(ctxt, test_group.uuid)
|
||||
@ -2865,7 +2865,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
def test_create_instance_public_network_non_admin(self, mock_create):
|
||||
public_network_uuid = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'
|
||||
params = {'networks': [{'uuid': public_network_uuid}]}
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
mock_create.side_effect = exception.ExternalNetworkAttachForbidden(
|
||||
network_uuid=public_network_uuid)
|
||||
self.assertRaises(webob.exc.HTTPForbidden,
|
||||
@ -3009,7 +3009,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
"contents": "b25zLiINCg0KLVJpY2hhcmQgQ$$%QQmFjaA==",
|
||||
},
|
||||
]
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create, self.req, body=self.body)
|
||||
|
||||
@ -3064,7 +3064,7 @@ class ServersControllerCreateTestWithMock(test.TestCase):
|
||||
if no_image:
|
||||
self.body['server'].pop('imageRef', None)
|
||||
self.body['server'].update(params)
|
||||
self.req.body = jsonutils.dumps(self.body)
|
||||
self.req.body = jsonutils.dump_as_bytes(self.body)
|
||||
self.req.headers["content-type"] = "application/json"
|
||||
self.controller.create(self.req, body=self.body).obj['server']
|
||||
|
||||
@ -3631,7 +3631,7 @@ class ServersAllExtensionsTestCase(test.TestCase):
|
||||
req.content_type = 'application/json'
|
||||
body = {'foo': {'a': 'b'}}
|
||||
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
res = req.get_response(self.app)
|
||||
self.assertEqual(400, res.status_int)
|
||||
|
||||
@ -3642,7 +3642,7 @@ class ServersAllExtensionsTestCase(test.TestCase):
|
||||
req.method = 'PUT'
|
||||
req.content_type = 'application/json'
|
||||
body = {'foo': {'a': 'b'}}
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
with mock.patch('nova.objects.Instance.save') as mock_save:
|
||||
res = req.get_response(self.app)
|
||||
self.assertFalse(mock_save.called)
|
||||
|
@ -147,7 +147,7 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
body = dict(server=server)
|
||||
req = fakes.HTTPRequestV21.blank('/servers')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers["content-type"] = "application/json"
|
||||
if override_controller:
|
||||
server = override_controller.create(req, body=body).obj['server']
|
||||
|
@ -175,7 +175,7 @@ class BootFromVolumeTest(test.TestCase):
|
||||
))
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/os-volumes_boot')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers['content-type'] = 'application/json'
|
||||
res = req.get_response(fakes.wsgi_app(
|
||||
init_only=('os-volumes_boot', 'servers')))
|
||||
@ -203,7 +203,7 @@ class BootFromVolumeTest(test.TestCase):
|
||||
))
|
||||
req = fakes.HTTPRequest.blank('/v2/fake/os-volumes_boot')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers['content-type'] = 'application/json'
|
||||
res = req.get_response(fakes.wsgi_app(
|
||||
init_only=('os-volumes_boot', 'servers')))
|
||||
@ -251,7 +251,7 @@ class VolumeApiTestV21(test.NoDBTestCase):
|
||||
body = {"volume": vol}
|
||||
req = fakes.HTTPRequest.blank(self.url_prefix + '/os-volumes')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps(body)
|
||||
req.body = jsonutils.dump_as_bytes(body)
|
||||
req.headers['content-type'] = 'application/json'
|
||||
resp = req.get_response(self.app)
|
||||
|
||||
@ -383,7 +383,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank(
|
||||
'/v2/servers/id/os-volume_attachments/uuid')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -396,7 +396,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank(
|
||||
'/v2/servers/id/os-volume_attachments/uuid')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -412,7 +412,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank(
|
||||
'/v2/servers/id/os-volume_attachments/uuid')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -428,7 +428,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank(
|
||||
'/v2/servers/id/os-volume_attachments/uuid')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -514,7 +514,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
'device': '/dev/fake'}}
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
result = self.attachments.create(req, FAKE_UUID, body=body)
|
||||
@ -528,7 +528,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
'device': None}}
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
result = self.attachments.create(req, FAKE_UUID, body=body)
|
||||
@ -548,7 +548,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
'device': '/dev/fake'}}
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -569,7 +569,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -589,7 +589,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -603,7 +603,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
|
||||
@ -621,7 +621,7 @@ class VolumeAttachTestsV21(test.NoDBTestCase):
|
||||
req = fakes.HTTPRequest.blank(
|
||||
'/v2/servers/id/os-volume_attachments/uuid')
|
||||
req.method = 'PUT'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
return attachments.update(req, FAKE_UUID, uuid, body=body)
|
||||
@ -695,7 +695,7 @@ class VolumeAttachTestsV2(VolumeAttachTestsV21):
|
||||
'extra': 'extra_arg'}}
|
||||
req = fakes.HTTPRequest.blank('/v2/servers/id/os-volume_attachments')
|
||||
req.method = 'POST'
|
||||
req.body = jsonutils.dumps({})
|
||||
req.body = jsonutils.dump_as_bytes({})
|
||||
req.headers['content-type'] = 'application/json'
|
||||
req.environ['nova.context'] = self.context
|
||||
result = self.attachments.create(req, FAKE_UUID, body=body)
|
||||
|
125
tests-py3.txt
125
tests-py3.txt
@ -10,29 +10,12 @@ nova.tests.unit.api.ec2.test_middleware.KeystoneAuthTestCase
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.ActionExtensionTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.ControllerExtensionTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.ExtensionControllerIdFormatTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.ExtensionControllerTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.ExtensionManagerTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.RequestExtensionTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_extensions.ResourceExtensionTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_servers.ServersControllerCreateTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_servers.ServersControllerCreateTestWithMock
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_servers.ServersControllerRebuildInstanceTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_servers.ServersControllerTest
|
||||
nova.tests.unit.api.openstack.compute.legacy_v2.test_servers.ServersControllerUpdateTest
|
||||
nova.tests.unit.api.openstack.compute.test_access_ips.AccessIPsExtAPIValidationTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_access_ips.AccessIPsExtAPIValidationTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_api.APITest
|
||||
nova.tests.unit.api.openstack.compute.test_api.APITestV21
|
||||
nova.tests.unit.api.openstack.compute.test_availability_zone.ServersControllerCreateTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_availability_zone.ServersControllerCreateTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_block_device_mapping.BlockDeviceMappingTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_block_device_mapping.BlockDeviceMappingTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_block_device_mapping_v1.BlockDeviceMappingTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_block_device_mapping_v1.BlockDeviceMappingTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_config_drive.ConfigDriveTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_config_drive.ConfigDriveTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_config_drive.ServersControllerCreateTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_config_drive.ServersControllerCreateTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_console_output.ConsoleOutputExtensionTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_console_output.ConsoleOutputExtensionTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_createserverext.CreateserverextTest
|
||||
@ -47,60 +30,22 @@ nova.tests.unit.api.openstack.compute.test_extended_ips_mac.ExtendedIpsMacTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_extended_server_attributes.ExtendedServerAttributesTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_extended_server_attributes.ExtendedServerAttributesTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_extended_server_attributes.ExtendedServerAttributesTestV23
|
||||
nova.tests.unit.api.openstack.compute.test_extended_status.ExtendedStatusTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_extended_status.ExtendedStatusTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_extended_virtual_interfaces_net.ExtendedServerVIFNetTest
|
||||
nova.tests.unit.api.openstack.compute.test_extended_volumes.ExtendedVolumesTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_extended_volumes.ExtendedVolumesTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_extended_volumes.ExtendedVolumesTestV23
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_disabled.FlavorDisabledTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_disabled.FlavorDisabledTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_manage.FlavorManageTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_manage.FlavorManageTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_manage.PrivateFlavorManageTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_manage.PrivateFlavorManageTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_rxtx.FlavorRxtxTestV20
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_rxtx.FlavorRxtxTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_swap.FlavorSwapTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_flavor_swap.FlavorSwapTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_flavorextradata.FlavorExtraDataTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_flavorextradata.FlavorExtraDataTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_flavors_extra_specs.FlavorsExtraSpecsTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ip_dns.FloatingIPDNSDomainPolicyEnforcementV21
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ip_dns.FloatingIPDNSEntryPolicyEnforcementV21
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ip_dns.FloatingIpDNSTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ip_dns.FloatingIpDNSTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ips.FloatingIpTestNeutronV2
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ips.FloatingIpTestNeutronV21
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ips.FloatingIpTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_floating_ips.FloatingIpTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_hide_server_addresses.HideServerAddressesTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_hide_server_addresses.HideServerAddressesTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_image_metadata.ImageMetaDataTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_image_metadata.ImageMetaDataTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_image_size.ImageSizeTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_image_size.ImageSizeTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_keypairs.KeypairsTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_keypairs.KeypairsTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_keypairs.KeypairsTestV210
|
||||
nova.tests.unit.api.openstack.compute.test_keypairs.KeypairsTestV22
|
||||
nova.tests.unit.api.openstack.compute.test_limits.LimitMiddlewareTest
|
||||
nova.tests.unit.api.openstack.compute.test_limits.LimitsControllerTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_limits.LimitsControllerTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_limits.WsgiLimiterProxyTest
|
||||
nova.tests.unit.api.openstack.compute.test_limits.WsgiLimiterTest
|
||||
nova.tests.unit.api.openstack.compute.test_microversions.MicroversionsTest
|
||||
nova.tests.unit.api.openstack.compute.test_multiple_create.MultiCreateExtensionTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_multiple_create.MultiCreateExtensionTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_networks.NetworkCreateExceptionsTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_neutron_security_groups.TestNeutronSecurityGroupRulesV2
|
||||
nova.tests.unit.api.openstack.compute.test_neutron_security_groups.TestNeutronSecurityGroupRulesV21
|
||||
nova.tests.unit.api.openstack.compute.test_neutron_security_groups.TestNeutronSecurityGroupsOutputTest
|
||||
nova.tests.unit.api.openstack.compute.test_plugin_framework.PluginTest
|
||||
nova.tests.unit.api.openstack.compute.test_scheduler_hints.SchedulerHintsTestCaseV2
|
||||
nova.tests.unit.api.openstack.compute.test_scheduler_hints.SchedulerHintsTestCaseV21
|
||||
nova.tests.unit.api.openstack.compute.test_scheduler_hints.ServersControllerCreateTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_scheduler_hints.ServersControllerCreateTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_security_group_default_rules.TestSecurityGroupDefaultRulesNeutronV21
|
||||
nova.tests.unit.api.openstack.compute.test_security_group_default_rules.TestSecurityGroupDefaultRulesV21
|
||||
nova.tests.unit.api.openstack.compute.test_security_groups.SecurityGroupsOutputTestV2
|
||||
@ -109,74 +54,44 @@ nova.tests.unit.api.openstack.compute.test_security_groups.TestSecurityGroupRule
|
||||
nova.tests.unit.api.openstack.compute.test_security_groups.TestSecurityGroupRulesV21
|
||||
nova.tests.unit.api.openstack.compute.test_server_actions.ServerActionsControllerTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_server_actions.ServerActionsControllerTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_server_diagnostics.ServerDiagnosticsTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_server_diagnostics.ServerDiagnosticsTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_server_metadata.BadStateServerMetaDataTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_server_metadata.BadStateServerMetaDataTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_server_metadata.ServerMetaDataTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_server_metadata.ServerMetaDataTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_server_usage.ServerUsageTestV20
|
||||
nova.tests.unit.api.openstack.compute.test_server_usage.ServerUsageTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.Base64ValidationTest
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersAllExtensionsTestCase
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerCreateTest
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerCreateTestWithMock
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerRebuildInstanceTest
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerTest
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerTestV29
|
||||
nova.tests.unit.api.openstack.compute.test_serversV21.ServersControllerUpdateTest
|
||||
nova.tests.unit.api.openstack.compute.test_simple_tenant_usage.SimpleTenantUsageTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_simple_tenant_usage.SimpleTenantUsageTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_urlmap.UrlmapTest
|
||||
nova.tests.unit.api.openstack.compute.test_user_data.ServersControllerCreateTest
|
||||
nova.tests.unit.api.openstack.compute.test_versions.VersionBehindSslTestCase
|
||||
nova.tests.unit.api.openstack.compute.test_versions.VersionsTestV20
|
||||
nova.tests.unit.api.openstack.compute.test_versions.VersionsTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_versions.VersionsTestV21WithV2CompatibleWrapper
|
||||
nova.tests.unit.api.openstack.compute.test_volumes.BootFromVolumeTest
|
||||
nova.tests.unit.api.openstack.compute.test_volumes.VolumeApiTestV2
|
||||
nova.tests.unit.api.openstack.compute.test_volumes.VolumeApiTestV21
|
||||
nova.tests.unit.api.openstack.compute.test_volumes.VolumeAttachTestsV2
|
||||
nova.tests.unit.api.openstack.compute.test_volumes.VolumeAttachTestsV21
|
||||
nova.tests.unit.api.test_compute_req_id.RequestIdTest
|
||||
nova.tests.unit.api.test_validator.ValidatorTestCase
|
||||
nova.tests.unit.api.test_wsgi.Test
|
||||
nova.tests.unit.cells.test_cells_messaging.CellsBroadcastMethodsTestCase
|
||||
nova.tests.unit.cells.test_cells_messaging.CellsMessageClassesTestCase
|
||||
nova.tests.unit.cells.test_cells_messaging.CellsTargetedMethodsTestCase
|
||||
nova.tests.unit.cells.test_cells_scheduler.CellsSchedulerTestCase
|
||||
nova.tests.unit.cells.test_cells_state_manager.TestCellsGetCapacity
|
||||
nova.tests.unit.cells.test_cells_state_manager.TestCellsStateManager
|
||||
nova.tests.unit.cells.test_cells_state_manager.TestCellsStateManagerNToOne
|
||||
nova.tests.unit.cmd.test_baseproxy.BaseProxyTestCase
|
||||
nova.tests.unit.compute.test_compute.ComputeAPITestCase
|
||||
nova.tests.unit.compute.test_compute.ComputeInjectedFilesTestCase
|
||||
nova.tests.unit.compute.test_compute.ComputeTestCase.test_finish_resize_with_volumes
|
||||
nova.tests.unit.compute.test_compute.ComputeVolumeTestCase
|
||||
nova.tests.unit.compute.test_compute_api.ComputeAPIAPICellUnitTestCase
|
||||
nova.tests.unit.compute.test_compute_api.ComputeAPIComputeCellUnitTestCase
|
||||
nova.tests.unit.compute.test_compute_api.ComputeAPIUnitTestCase
|
||||
nova.tests.unit.compute.test_compute_api.SecurityGroupAPITest
|
||||
nova.tests.unit.compute.test_compute_cells.CellsComputeAPITestCase
|
||||
nova.tests.unit.compute.test_compute_cells.CellsComputePolicyTestCase
|
||||
nova.tests.unit.compute.test_compute_mgr.ComputeManagerBuildInstanceTestCase
|
||||
nova.tests.unit.compute.test_compute_mgr.ComputeManagerMigrationTestCase
|
||||
nova.tests.unit.compute.test_compute_mgr.ComputeManagerUnitTestCase
|
||||
nova.tests.unit.compute.test_compute_utils.UsageInfoTestCase
|
||||
nova.tests.unit.compute.test_compute_xen.ComputeXenTestCase
|
||||
nova.tests.unit.compute.test_host_api.ComputeHostAPICellsTestCase
|
||||
nova.tests.unit.compute.test_resources.BaseTestCase
|
||||
nova.tests.unit.compute.test_shelve.ShelveComputeManagerTestCase
|
||||
nova.tests.unit.compute.test_tracker.TestInitComputeNode
|
||||
nova.tests.unit.compute.test_tracker.TestInstanceClaim
|
||||
nova.tests.unit.compute.test_tracker.TestMoveClaim
|
||||
nova.tests.unit.compute.test_tracker.TestUpdateAvailableResources
|
||||
nova.tests.unit.compute.test_tracker.TestUpdateComputeNode
|
||||
nova.tests.unit.conductor.test_conductor.ConductorLocalComputeTaskAPITestCase
|
||||
nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase
|
||||
nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase
|
||||
nova.tests.unit.conductor.test_conductor.ConductorTaskTestCase
|
||||
nova.tests.unit.conductor.test_conductor.ConductorTestCase
|
||||
nova.tests.unit.console.test_websocketproxy.NovaProxyRequestHandlerBaseTestCase
|
||||
nova.tests.unit.consoleauth.test_consoleauth.ControlauthMemcacheEncodingTestCase
|
||||
nova.tests.unit.db.test_migrations.TestNovaMigrationsMySQL
|
||||
@ -189,19 +104,10 @@ nova.tests.unit.keymgr.test_conf_key_mgr.ConfKeyManagerTestCase
|
||||
nova.tests.unit.keymgr.test_key.SymmetricKeyTestCase
|
||||
nova.tests.unit.keymgr.test_mock_key_mgr.MockKeyManagerTestCase
|
||||
nova.tests.unit.keymgr.test_single_key_mgr.SingleKeyManagerTestCase
|
||||
nova.tests.unit.network.test_api.ApiTestCase
|
||||
nova.tests.unit.network.test_linux_net.LinuxNetworkTestCase.test_get_dhcp_leases_for_nw00
|
||||
nova.tests.unit.network.test_linux_net.LinuxNetworkTestCase.test_get_dhcp_leases_for_nw01
|
||||
nova.tests.unit.network.test_manager.AllocateTestCase
|
||||
nova.tests.unit.network.test_manager.CommonNetworkTestCase
|
||||
nova.tests.unit.network.test_manager.FlatDHCPNetworkTestCase
|
||||
nova.tests.unit.network.test_manager.FlatNetworkTestCase
|
||||
nova.tests.unit.network.test_manager.FloatingIPTestCase
|
||||
nova.tests.unit.network.test_manager.LdapDNSTestCase
|
||||
nova.tests.unit.network.test_manager.VlanNetworkTestCase
|
||||
nova.tests.unit.network.test_neutronv2.TestNeutronv2.test_deallocate_for_instance_2
|
||||
nova.tests.unit.network.test_neutronv2.TestNeutronv2.test_deallocate_for_instance_2_with_requested
|
||||
nova.tests.unit.network.test_neutronv2.TestNeutronv2WithMock
|
||||
nova.tests.unit.pci.test_manager.PciDevTrackerTestCase
|
||||
nova.tests.unit.pci.test_stats.PciDeviceStatsTestCase
|
||||
nova.tests.unit.pci.test_stats.PciDeviceStatsWithTagsTestCase
|
||||
@ -212,9 +118,7 @@ nova.tests.unit.test_block_device.TestBlockDeviceDict
|
||||
nova.tests.unit.test_cinder.CinderTestCase
|
||||
nova.tests.unit.test_cinder.CinderV2TestCase
|
||||
nova.tests.unit.test_configdrive2.ConfigDriveTestCase
|
||||
nova.tests.unit.test_fixtures.TestOSAPIFixture
|
||||
nova.tests.unit.test_hacking.HackingTestCase
|
||||
nova.tests.unit.test_iptables_network.IptablesManagerTestCase
|
||||
nova.tests.unit.test_ipv6.IPv6AccountIdentiferTestCase
|
||||
nova.tests.unit.test_matchers.TestDictMatches
|
||||
nova.tests.unit.test_matchers.TestXMLMatches
|
||||
@ -285,54 +189,25 @@ nova.tests.unit.virt.libvirt.test_imagecache.ImageCacheManagerTestCase
|
||||
nova.tests.unit.virt.libvirt.test_imagecache.VerifyChecksumTestCase
|
||||
nova.tests.unit.virt.libvirt.test_utils.LibvirtUtilsTestCase
|
||||
nova.tests.unit.virt.libvirt.test_vif.LibvirtVifTestCase
|
||||
nova.tests.unit.virt.test_block_device.TestDriverBlockDevice
|
||||
nova.tests.unit.virt.test_hardware.CPUPinningCellTestCase
|
||||
nova.tests.unit.virt.test_hardware.CPUPinningTestCase
|
||||
nova.tests.unit.virt.test_virt_drivers.AbstractDriverTestCase
|
||||
nova.tests.unit.virt.test_virt_drivers.FakeConnectionTestCase
|
||||
nova.tests.unit.virt.test_virt_drivers.LibvirtConnTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_configdrive.ConfigDriveTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_driver_api.VMwareAPIVMTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_driver_api.VMwareSessionTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_ds_util.DsUtilTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_imagecache.ImageCacheManagerTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_images.VMwareImagesTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_network_util.GetNetworkWithTheNameTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_read_write_util.ReadWriteUtilTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_vim_util.VMwareVIMUtilTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_vm_util.VMwareVMUtilTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_vmops.VMwareVMOpsTestCase
|
||||
nova.tests.unit.virt.vmwareapi.test_volumeops.VMwareVolumeOpsTestCase
|
||||
nova.tests.unit.virt.xenapi.client.test_session.ApplySessionHelpersTestCase
|
||||
nova.tests.unit.virt.xenapi.client.test_session.CallPluginTestCase
|
||||
nova.tests.unit.virt.xenapi.client.test_session.SessionTestCase
|
||||
nova.tests.unit.virt.xenapi.image.test_utils.RawTGZTestCase
|
||||
nova.tests.unit.virt.xenapi.image.test_vdi_through_dev.TestTarGzProducer
|
||||
nova.tests.unit.virt.xenapi.image.test_vdi_through_dev.TestUploadToGlanceAsRawTgz
|
||||
nova.tests.unit.virt.xenapi.test_agent.FileInjectionTestCase
|
||||
nova.tests.unit.virt.xenapi.test_driver.XenAPIDriverTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.CreateCachedImageTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.CreateVmRecordTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.CreateVmTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.GenerateDiskTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.ResizeFunctionTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.ScanSrTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.UnplugVbdTestCase
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.VMInfoTests
|
||||
nova.tests.unit.virt.xenapi.test_vm_utils.VMUtilsSRPath
|
||||
nova.tests.unit.virt.xenapi.test_vmops.GetConsoleOutputTestCase
|
||||
nova.tests.unit.virt.xenapi.test_volume_utils.ParseVolumeInfoTestCase
|
||||
nova.tests.unit.virt.xenapi.test_volume_utils.SROps
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.HypervisorPoolTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIAggregateTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIAutoDiskConfigTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIBWCountersTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIDiffieHellmanTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIDom0IptablesFirewallTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIHostTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPILiveMigrateTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIMigrateInstance
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPISRSelectionTestCase
|
||||
nova.tests.unit.virt.xenapi.test_xenapi.XenAPIVMTestCase
|
||||
nova.tests.unit.volume.encryptors.test_cryptsetup.CryptsetupEncryptorTestCase
|
||||
nova.tests.unit.volume.encryptors.test_luks.LuksEncryptorTestCase
|
||||
|
Loading…
Reference in New Issue
Block a user