summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-09-18 01:27:13 +0000
committerGerrit Code Review <review@openstack.org>2012-09-18 01:27:13 +0000
commit5fc0dbb912e688c1844856d8d7764ebedf7b6b2d (patch)
treeed8c420f8c4bed38c1e055a5ccb29cdb90dc316b /nova/tests
parentd298294f79659c30c6d426e99444111c58d98c48 (diff)
parente6e5123cceb874a7ca6dcb16bc401f530439d07a (diff)
Merge "Allows waiting timers in libvirt to raise NotFound"
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_libvirt.py30
1 files changed, 3 insertions, 27 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index 060a8445a..19839c56e 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -2251,28 +2251,7 @@ class LibvirtConnTestCase(test.TestCase):
"uuid": "875a8070-d0b9-4949-8b31-104d125c9a64"}
conn.destroy(instance, [])
- def test_private_destroy(self):
- """Ensure Instance not found skips undefine"""
- mock = self.mox.CreateMock(libvirt.virDomain)
- mock.destroy()
- self.mox.ReplayAll()
-
- def fake_lookup_by_name(instance_name):
- return mock
-
- def fake_get_info(instance_name):
- return {'state': power_state.SHUTDOWN}
-
- conn = libvirt_driver.LibvirtDriver(False)
- self.stubs.Set(conn, '_lookup_by_name', fake_lookup_by_name)
- self.stubs.Set(conn, 'get_info', fake_get_info)
- instance = {"name": "instancename", "id": "instanceid",
- "uuid": "875a8070-d0b9-4949-8b31-104d125c9a64"}
- result = conn._destroy(instance)
- self.assertTrue(result)
-
def test_private_destroy_not_found(self):
- """Ensure Instance not found skips undefine"""
mock = self.mox.CreateMock(libvirt.virDomain)
mock.destroy()
self.mox.ReplayAll()
@@ -2288,8 +2267,8 @@ class LibvirtConnTestCase(test.TestCase):
self.stubs.Set(conn, 'get_info', fake_get_info)
instance = {"name": "instancename", "id": "instanceid",
"uuid": "875a8070-d0b9-4949-8b31-104d125c9a64"}
- result = conn._destroy(instance)
- self.assertFalse(result)
+ # NOTE(vish): verifies destory doesn't raise if the instance disappears
+ conn._destroy(instance)
def test_available_least_handles_missing(self):
"""Ensure destroy calls managedSaveRemove for saved instance"""
@@ -3714,9 +3693,6 @@ class LibvirtDriverTestCase(test.TestCase):
self.assertEquals(out, disk_info_text)
def test_wait_for_running(self):
- """Test for nova.virt.libvirt.libvirt_driver.LivirtConnection
- ._wait_for_running. """
-
def fake_get_info(instance):
if instance['name'] == "not_found":
raise exception.NotFound
@@ -3729,7 +3705,7 @@ class LibvirtDriverTestCase(test.TestCase):
fake_get_info)
""" instance not found case """
- self.assertRaises(utils.LoopingCallDone,
+ self.assertRaises(exception.NotFound,
self.libvirtconnection._wait_for_running,
{'name': 'not_found',
'uuid': 'not_found_uuid'})