From 415453bfe817aaf2849dbd7b71c33fabde6136fb Mon Sep 17 00:00:00 2001 From: John Tran Date: Fri, 2 Nov 2012 20:52:18 +0000 Subject: [PATCH] nova fake libvirt library breaking tests fixes bug #1074488 Nova libvirt fake library was updated to include additional 'virtapi' arg required and our tests do not pass any args to it therefore breaking them. dansmith recommended to change fake.FakeDriver to Fake.FakeVirtAPI which will replicate the old functionality. Change-Id: Iedcd32cd038c6043d782565312adf5fcba8d9b7a --- tests/compute/test_libvirt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/compute/test_libvirt.py b/tests/compute/test_libvirt.py index f584e015..979c6233 100644 --- a/tests/compute/test_libvirt.py +++ b/tests/compute/test_libvirt.py @@ -86,6 +86,7 @@ class TestDiskIOPollster(TestLibvirtBase): @skip.skip_if(libvirt_missing, 'Test requires libvirt') def test_fetch_diskio(self): + flags.FLAGS.compute_driver = 'fake.FakeVirtAPI' list(self.pollster.get_counters(self.manager, self.instance)) #assert counters # FIXME(dhellmann): The CI environment doesn't produce @@ -94,7 +95,7 @@ class TestDiskIOPollster(TestLibvirtBase): @skip.skip_if(libvirt_missing, 'Test requires libvirt') def test_fetch_diskio_not_libvirt(self): - flags.FLAGS.compute_driver = 'fake.FakeDriver' + flags.FLAGS.compute_driver = 'fake.FakeVirtAPI' flags.FLAGS.connection_type = 'fake' counters = list(self.pollster.get_counters(self.manager, self.instance)) @@ -102,6 +103,7 @@ class TestDiskIOPollster(TestLibvirtBase): @skip.skip_if(libvirt_missing, 'Test requires libvirt') def test_fetch_diskio_with_libvirt_non_existent_instance(self): + flags.FLAGS.compute_driver = 'fake.FakeVirtAPI' instance = mock.MagicMock() instance.name = 'instance-00000999' instance.id = 999