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
This commit is contained in:
Clark Boylan 2013-02-07 21:39:31 -08:00 committed by Alessio Ababilov
parent 96c874cac5
commit dbbbbf4ecb
2 changed files with 8 additions and 0 deletions

View File

@ -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))

View File

@ -2,6 +2,7 @@
envlist = py26,py27,pep8
[testenv]
sitepackages = True
setenv = VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en