summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-03-22 16:53:43 +0100
committerSoren Hansen <soren@linux2go.dk>2011-03-22 16:53:43 +0100
commit7ae8f5563c42d7c5dc67047dd9c42e982281d80b (patch)
tree35a72e2a1e4364b1539119f2bd3f3caa252a7063 /nova/tests
parent3c7de6db490a8482f6d1fb5fefc750050cb1e269 (diff)
Apparantly a more common problem than first thought.
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_compute.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/nova/tests/test_compute.py b/nova/tests/test_compute.py
index 3651f4cef..0209dd9ca 100644
--- a/nova/tests/test_compute.py
+++ b/nova/tests/test_compute.py
@@ -44,6 +44,14 @@ flags.DECLARE('stub_network', 'nova.compute.manager')
flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
+class FakeTime(object):
+ def __init__(self):
+ self.counter = 0
+
+ def sleep(self, t):
+ self.counter += t
+
+
class ComputeTestCase(test.TestCase):
"""Test case for compute"""
def setUp(self):
@@ -342,7 +350,7 @@ class ComputeTestCase(test.TestCase):
self.mox.ReplayAll()
self.assertRaises(exception.NotFound,
self.compute.pre_live_migration,
- c, instance_ref['id'])
+ c, instance_ref['id'], time=FakeTime())
def test_pre_live_migration_instance_has_volume(self):
"""Confirm setup_compute_volume is called when volume is mounted."""
@@ -395,7 +403,7 @@ class ComputeTestCase(test.TestCase):
self.compute.driver = drivermock
self.mox.ReplayAll()
- ret = self.compute.pre_live_migration(c, i_ref['id'])
+ ret = self.compute.pre_live_migration(c, i_ref['id'], time=FakeTime())
self.assertEqual(ret, None)
def test_pre_live_migration_setup_compute_node_fail(self):
@@ -428,7 +436,7 @@ class ComputeTestCase(test.TestCase):
self.mox.ReplayAll()
self.assertRaises(exception.ProcessExecutionError,
self.compute.pre_live_migration,
- c, i_ref['id'])
+ c, i_ref['id'], time=FakeTime())
def test_live_migration_works_correctly_with_volume(self):
"""Confirm check_for_export to confirm volume health check."""