From dc54013c130bdc8afc6bb931198d3d0bccb23ad2 Mon Sep 17 00:00:00 2001 From: "Mauro S. M. Rodrigues" Date: Tue, 1 Jan 2013 20:49:46 -0500 Subject: Add unit test for too long metadata for server rebuild action This fixes bug: 1088686 Partially implements blueprint nova-v2-api-audit Change-Id: Ibf2b468cb95e0b1be9f47c0ff01ae55ce56d421d --- nova/tests/api/openstack/compute/test_server_actions.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'nova') diff --git a/nova/tests/api/openstack/compute/test_server_actions.py b/nova/tests/api/openstack/compute/test_server_actions.py index a0330d2cc..423750470 100644 --- a/nova/tests/api/openstack/compute/test_server_actions.py +++ b/nova/tests/api/openstack/compute/test_server_actions.py @@ -335,6 +335,21 @@ class ServerActionsControllerTest(test.TestCase): self.controller._action_rebuild, req, FAKE_UUID, body) + def test_rebuild_with_too_large_metadata(self): + body = { + "rebuild": { + "imageRef": self._image_href, + "metadata": { + 256 * "k": "value" + } + } + } + + req = fakes.HTTPRequest.blank(self.url) + self.assertRaises(webob.exc.HTTPRequestEntityTooLarge, + self.controller._action_rebuild, req, + FAKE_UUID, body) + def test_rebuild_bad_entity(self): body = { "rebuild": { -- cgit