← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1551900] [NEW] test_virt_drivers.LibvirtConnTestCase fails if /etc/machine-id is empty

 

Public bug reported:

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

** Affects: nova
     Importance: Medium
     Assignee: Matt Riedemann (mriedem)
         Status: Confirmed


** Tags: libvirt testing

** Changed in: nova
   Importance: Undecided => Medium

** Changed in: nova
       Status: New => Confirmed

** Changed in: nova
     Assignee: (unassigned) => Matt Riedemann (mriedem)

-- 
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):
  Confirmed

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


Follow ups