summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorNachi Ueno <nati.ueno@gmail.com>2011-01-12 18:46:01 +0900
committerNachi Ueno <nati.ueno@gmail.com>2011-01-12 18:46:01 +0900
commit0a33f1ed87ffb2ad3ff6c41848e2bb254a62e3da (patch)
treebd42398ad08cecdcf72c54c7982d57a8867f6402 /nova/tests
parent04cd3241f442f1c6a9fd030ab47b4d15e79ec032 (diff)
parent76fdd667f2efe7e2dc710fe0254437d176efb45c (diff)
Merged with 549
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_cloud.py13
-rw-r--r--nova/tests/test_compute.py10
2 files changed, 23 insertions, 0 deletions
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index b8a15c7b2..8e43eec00 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -167,6 +167,19 @@ class CloudTestCase(test.TestCase):
greenthread.sleep(0.3)
rv = self.cloud.terminate_instances(self.context, [instance_id])
+ def test_ajax_console(self):
+ kwargs = {'image_id': image_id}
+ rv = yield self.cloud.run_instances(self.context, **kwargs)
+ instance_id = rv['instancesSet'][0]['instanceId']
+ output = yield self.cloud.get_console_output(context=self.context,
+ instance_id=[instance_id])
+ self.assertEquals(b64decode(output['output']),
+ 'http://fakeajaxconsole.com/?token=FAKETOKEN')
+ # TODO(soren): We need this until we can stop polling in the rpc code
+ # for unit tests.
+ greenthread.sleep(0.3)
+ rv = yield self.cloud.terminate_instances(self.context, [instance_id])
+
def test_key_generation(self):
result = self._create_key('test')
private_key = result['private_key']
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 1d407c5a3..52660ee74 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -169,6 +169,16 @@ class ComputeTestCase(test.TestCase):
self.assert_(console)
self.compute.terminate_instance(self.context, instance_id)
+ def test_ajax_console(self):
+ """Make sure we can get console output from instance"""
+ instance_id = self._create_instance()
+ self.compute.run_instance(self.context, instance_id)
+
+ console = self.compute.get_ajax_console(self.context,
+ instance_id)
+ self.assert_(console)
+ self.compute.terminate_instance(self.context, instance_id)
+
def test_run_instance_existing(self):
"""Ensure failure when running an instance that already exists"""
instance_id = self._create_instance()