diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-13 21:55:10 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-13 21:55:10 +0000 |
| commit | e08eeea94f0bc27d5bff5ae428e36fb32aaef58c (patch) | |
| tree | de134fc8adc34a11189be4cc6500e5cdae24a258 /nova/tests | |
| parent | f9e53c4031150173691f5474b3e495ee4f918fda (diff) | |
| parent | 9c1f5d49d7d2783054d1e01361298cddafeeec78 (diff) | |
Merge "have all quota errors return an http 413"
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/openstack/compute/test_servers.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py index 83b0e345c..8d810c4a0 100644 --- a/nova/tests/api/openstack/compute/test_servers.py +++ b/nova/tests/api/openstack/compute/test_servers.py @@ -1605,6 +1605,32 @@ class ServersControllerCreateTest(test.TestCase): self.assertEqual(FLAGS.password_length, len(server['adminPass'])) self.assertEqual(FAKE_UUID, server['id']) + def test_create_instance_too_much_metadata(self): + self.flags(quota_metadata_items=1) + image_uuid = '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6' + image_href = 'http://localhost/v2/images/%s' % image_uuid + flavor_ref = 'http://localhost/123/flavors/3' + body = { + 'server': { + 'name': 'server_test', + 'imageRef': image_href, + 'flavorRef': flavor_ref, + 'metadata': { + 'hello': 'world', + 'open': 'stack', + 'vote': 'fiddletown', + }, + }, + } + + req = fakes.HTTPRequest.blank('/v2/fake/servers') + req.method = 'POST' + req.body = json.dumps(body) + req.headers["content-type"] = "application/json" + + self.assertRaises(webob.exc.HTTPRequestEntityTooLarge, + self.controller.create, req, body) + def test_create_instance_invalid_key_name(self): image_href = 'http://localhost/v2/images/2' flavor_ref = 'http://localhost/flavors/3' |
