summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-06-01 05:36:41 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-06-01 05:36:41 -0700
commitdb68508e1468e9d2d3469f2ea6a9ec577d1190bc (patch)
treea7bd6ae86e54ed86d7bb1f973b5f6d4c2aa1ca91 /nova
parentbeb6bf93d0bab5b50c6f0af90758e21cc68187ab (diff)
downloadnova-db68508e1468e9d2d3469f2ea6a9ec577d1190bc.tar.gz
nova-db68508e1468e9d2d3469f2ea6a9ec577d1190bc.tar.xz
nova-db68508e1468e9d2d3469f2ea6a9ec577d1190bc.zip
added /zones/boot reservation id tests
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/api/openstack/test_servers.py20
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 9d12097c8..3d5f92dea 100644
--- a/nova/tests/api/openstack/test_servers.py
+++ b/nova/tests/api/openstack/test_servers.py
@@ -538,6 +538,26 @@ class ServersTest(test.TestCase):
self.assertNotEqual(reservation_id, None)
self.assertTrue(len(reservation_id) > 1)
+ def test_create_instance_via_zones_with_resid(self):
+ """User supplied ReservationID"""
+ self._setup_for_create_instance()
+ FLAGS.allow_admin_api = True
+
+ body = dict(server=dict(
+ name='server_test', imageId=3, flavorId=2,
+ metadata={'hello': 'world', 'open': 'stack'},
+ personality={}, reservation_id='myresid'))
+ req = webob.Request.blank('/v1.0/zones/boot')
+ req.method = 'POST'
+ req.body = json.dumps(body)
+ req.headers["content-type"] = "application/json"
+
+ res = req.get_response(fakes.wsgi_app())
+
+ reservation_id = json.loads(res.body)['reservation_id']
+ self.assertEqual(res.status_int, 200)
+ self.assertEqual(reservation_id, "myresid")
+
def test_create_instance_no_key_pair(self):
fakes.stub_out_key_pair_funcs(self.stubs, have_key_pair=False)
self._test_create_instance_helper()