From ac21815ecb977840e90cee807fac7992d060c643 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Tue, 1 May 2012 08:19:02 -0700 Subject: Allow blank adminPass on server create * Fixes bug 992648 Change-Id: Ib796904b3155300a178e37d129e398817c8747d6 --- nova/tests/api/openstack/compute/test_servers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py index 514d7cf84..e1a01b09f 100644 --- a/nova/tests/api/openstack/compute/test_servers.py +++ b/nova/tests/api/openstack/compute/test_servers.py @@ -2119,10 +2119,11 @@ class ServersControllerCreateTest(test.TestCase): self.assertTrue('adminPass' not in server) def test_create_instance_admin_pass_empty(self): + image_uuid = '76fa36fc-c930-4bf3-8c8a-ea2a2420deb6' body = { 'server': { 'name': 'server_test', - 'imageRef': 3, + 'imageRef': image_uuid, 'flavorRef': 3, 'adminPass': '', }, @@ -2133,8 +2134,8 @@ class ServersControllerCreateTest(test.TestCase): req.body = json.dumps(body) req.headers['content-type'] = "application/json" - self.assertRaises(webob.exc.HTTPBadRequest, - self.controller.create, req, body) + # The fact that the action doesn't raise is enough validation + self.controller.create(req, body) def test_create_instance_malformed_entity(self): req = fakes.HTTPRequest.blank('/v2/fake/servers') -- cgit