From d272415fd6fe9cdbd66fdfdf9aedc8a43b87d9b5 Mon Sep 17 00:00:00 2001 From: Jian Wen Date: Mon, 24 Sep 2012 23:30:02 +0800 Subject: libvirt: Fix _cleanup_resize Undefine domain and unplug vifs in _cleanup_resize if the instance was migrated to another host. Fixes bug 1015731 Change-Id: If6eb1ada029d462777bbd6ea113c98c3b801cf5d --- nova/tests/test_libvirt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 10db13e17..55ee3f811 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -3892,11 +3892,21 @@ class LibvirtDriverTestCase(test.TestCase): def fake_shutil_rmtree(target): pass + def fake_undefine_domain(instance): + pass + + def fake_unplug_vifs(instance, network_info): + pass + def fake_unfilter_instance(instance, network_info): pass self.stubs.Set(os.path, 'exists', fake_os_path_exists) self.stubs.Set(shutil, 'rmtree', fake_shutil_rmtree) + self.stubs.Set(self.libvirtconnection, '_undefine_domain', + fake_undefine_domain) + self.stubs.Set(self.libvirtconnection, 'unplug_vifs', + fake_unplug_vifs) self.stubs.Set(self.libvirtconnection.firewall_driver, 'unfilter_instance', fake_unfilter_instance) -- cgit