diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-06-29 09:49:49 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-06-29 09:49:49 -0700 |
| commit | 5686488517f702bd4ba714edeea89ea1993ac220 (patch) | |
| tree | da6ae903a728955ceebffd1b80dbe705cc1ffdf8 /nova/tests | |
| parent | 0bfa9aad9c1f74ca962351d90265e5fb56156841 (diff) | |
Allow a port name in the server ref for image create
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/api/openstack/test_images.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nova/tests/api/openstack/test_images.py b/nova/tests/api/openstack/test_images.py index 446d68e9e..6c36f96a7 100644 --- a/nova/tests/api/openstack/test_images.py +++ b/nova/tests/api/openstack/test_images.py @@ -1011,6 +1011,19 @@ class ImageControllerWithGlanceServiceTest(test.TestCase): result = json.loads(response.body) self.assertEqual(result['image']['serverRef'], serverRef) + def test_create_image_v1_1_actual_server_ref_port(self): + + serverRef = 'http://localhost:8774/v1.1/servers/1' + body = dict(image=dict(serverRef=serverRef, name='Backup 1')) + req = webob.Request.blank('/v1.1/images') + req.method = 'POST' + req.body = json.dumps(body) + req.headers["content-type"] = "application/json" + response = req.get_response(fakes.wsgi_app()) + self.assertEqual(200, response.status_int) + result = json.loads(response.body) + self.assertEqual(result['image']['serverRef'], serverRef) + def test_create_image_v1_1_server_ref_bad_hostname(self): serverRef = 'http://asdf/v1.1/servers/1' |
