summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Boylan <clark.boylan@gmail.com>2013-02-07 21:39:31 -0800
committerAlessio Ababilov <aababilo@yahoo-inc.com>2013-03-19 12:11:10 +0200
commitdbbbbf4ecb2c7b03ebb30fa11e077d35b2186cbb (patch)
tree846b603d0564c4a9df2281255090a42adef18bf7
parent96c874cac5f9bd20f322d01404eaf378b8333eb5 (diff)
downloadnova-dbbbbf4ecb2c7b03ebb30fa11e077d35b2186cbb.tar.gz
nova-dbbbbf4ecb2c7b03ebb30fa11e077d35b2186cbb.tar.xz
nova-dbbbbf4ecb2c7b03ebb30fa11e077d35b2186cbb.zip
Enable tox use of site-packages for libvirt.
Enable the use of site-packages in tox which will allow the use of the system install of libvirt while testing. Hardcode the libvirt host UUID for tests that check this UUID when system libvirt is being used. Without this hardcoding eight tests would fail when using the system libvirt install. Partially fixes bug #1113181 Change-Id: I59c5fbd45639962c0963298203c39759b6ca2d11
-rw-r--r--nova/tests/test_libvirt.py7
-rw-r--r--tox.ini1
2 files changed, 8 insertions, 0 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index fa691c2e1..e56a50ffb 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -291,6 +291,13 @@ class LibvirtConnTestCase(test.TestCase):
self.useFixture(fixtures.MonkeyPatch(
'nova.virt.libvirt.driver.libvirt_utils',
fake_libvirt_utils))
+ # Force libvirt to return a host UUID that matches the serial in
+ # nova.tests.fakelibvirt. This is necessary because the host UUID
+ # returned by libvirt becomes the serial whose value is checked for in
+ # test_xml_and_uri_* below.
+ self.useFixture(fixtures.MonkeyPatch(
+ 'nova.virt.libvirt.driver.LibvirtDriver.get_host_uuid',
+ lambda _: 'cef19ce0-0ca2-11df-855d-b19fbce37686'))
self.useFixture(fixtures.MonkeyPatch(
'nova.virt.libvirt.imagebackend.libvirt_utils',
fake_libvirt_utils))
diff --git a/tox.ini b/tox.ini
index 4849eff4e..ca135209b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -2,6 +2,7 @@
envlist = py26,py27,pep8
[testenv]
+sitepackages = True
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en