yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #47201
[Bug 1551900] Re: test_virt_drivers.LibvirtConnTestCase fails if /etc/machine-id is empty
Reviewed: https://review.openstack.org/286776
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6c3991e881312d715d08f94158d72f8c37dfc6a4
Submitter: Jenkins
Branch: master
commit 6c3991e881312d715d08f94158d72f8c37dfc6a4
Author: Matt Riedemann <mriedem@xxxxxxxxxx>
Date: Tue Mar 1 13:59:36 2016 -0500
libvirt: set libvirt.sysinfo_serial='none' for virt driver tests
The default value for the sysinfo_serial option is 'auto' which
tries to read from the /etc/machine-id file if it exists and is
not empty.
Unit tests should not be dependent on trying to read from system
files outside the virtual environment, so for the generic virt
driver tests set the config option value to 'none' so we don't
do anything for the sysinfo_serial option.
Change-Id: Ib9ba0ec2c1690d93eadb63e699740e4ba988cce1
Closes-Bug: #1551900
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1551900
Title:
test_virt_drivers.LibvirtConnTestCase fails if /etc/machine-id is
empty
Status in OpenStack Compute (nova):
Fix Released
Status in OpenStack Compute (nova) kilo series:
In Progress
Status in OpenStack Compute (nova) liberty series:
In Progress
Bug description:
This is related to bug 1475353 but in this case unit tests fail if the
file exists but is empty. Either way we shouldn't be trying to read
from a file on the system in unit tests, so we should set the
CONF.libvirt.sysinfo_serial config option value to 'none' in the
tests.
Example failure (this is from Juno):
nova.tests.virt.test_virt_drivers.LibvirtConnTestCase.test_block_stats
----------------------------------------------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "nova/tests/virt/test_virt_drivers.py", line 54, in wrapped_func
return f(self, *args, **kwargs)
File "nova/tests/virt/test_virt_drivers.py", line 521, in test_block_stats
instance_ref, network_info = self._get_running_instance()
File "nova/tests/virt/test_virt_drivers.py", line 228, in _get_running_instance
[], 'herp', network_info=network_info)
File "nova/virt/libvirt/driver.py", line 2661, in spawn
write_to_disk=True)
File "nova/virt/libvirt/driver.py", line 4182, in _get_guest_xml
context)
File "nova/virt/libvirt/driver.py", line 3863, in _get_guest_config
guest.sysinfo = self._get_guest_config_sysinfo(instance)
File "nova/virt/libvirt/driver.py", line 3582, in _get_guest_config_sysinfo
sysinfo.system_serial = self._sysinfo_serial_func()
File "nova/virt/libvirt/driver.py", line 3571, in _get_host_sysinfo_serial_auto
return self._get_host_sysinfo_serial_os()
File "nova/virt/libvirt/driver.py", line 3567, in _get_host_sysinfo_serial_os
return str(uuid.UUID(f.read().split()[0]))
IndexError: list index out of range
Traceback (most recent call last):
_StringException: Empty attachments:
stderr
stdout
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1551900/+subscriptions
References