diff options
| author | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-04-05 16:30:30 -0400 |
|---|---|---|
| committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2011-04-05 16:30:30 -0400 |
| commit | b59f7e2b9ed0f08ac033cd839a6996a1931ccec6 (patch) | |
| tree | eb1e0662320ed788e6d2ae13ce50ad4a335ca526 /nova/tests | |
| parent | 2468743697faf81851bef1cafba95337dbd57153 (diff) | |
refactor to handle invalid adminPass
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/openstack/test_servers.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index bd0bdf1b3..65e6fee51 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -553,6 +553,26 @@ class ServersTest(test.TestCase): server = json.loads(res.body)['server'] self.assertEqual(server['adminPass'], body['server']['adminPass']) + def test_create_instance_with_empty_admin_pass_v11(self): + self._setup_for_create_instance() + + imageRef = 'http://localhost/v1.1/images/2' + flavorRef = 'http://localhost/v1.1/flavors/3' + body = { + 'server': { + 'name': 'server_test', + 'imageRef': imageRef, + 'flavorRef': flavorRef, + 'adminPass': '', + }, + } + + req = webob.Request.blank('/v1.1/servers') + req.method = 'POST' + req.body = json.dumps(body) + req.headers['content-type'] = "application/json" + res = req.get_response(fakes.wsgi_app()) + self.assertEqual(res.status_int, 400) def test_update_no_body(self): req = webob.Request.blank('/v1.0/servers/1') |
