nova unit tests fail test_get_domain_info_with_more_return

Bug #1301602 reported by Bhuvan Arumugam
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Andrew Laski

Bug Description

Regression caused by https://github.com/openstack/nova/commit/23158ad8b340ed5c53fe6ad0fe582f47467c9127

Traceback (most recent call last):
  File "nova/tests/virt/libvirt/test_libvirt.py", line 6447, in test_get_domain_info_with_more_return
    mock_domain = libvirt.virDomain('qemu:///system', None)
  File "nova/tests/virt/libvirt/fakelibvirt.py", line 213, in __init__
    self._def = self._parse_definition(xml)
  File "nova/tests/virt/libvirt/fakelibvirt.py", line 220, in _parse_definition
    tree = etree.fromstring(xml)
  File "lxml.etree.pyx", line 3032, in lxml.etree.fromstring (src/lxml/lxml.etree.c:68106)
  File "parser.pxi", line 1784, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:102444)
ValueError: can only parse strings

I think the domain should be mocked and shouldn't be created directly.

I'm facing this issue with py26 on OEL 6.3, if it matter.

Tags: libvirt
Revision history for this message
Andrew Laski (alaski) wrote :

This is failing on every tox run for me.

Changed in nova:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Andrew Laski (alaski)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/85452

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/85632
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=570a84e92c88b1c7d9fd48d107bc3fad75e32efe
Submitter: Jenkins
Branch: master

commit 570a84e92c88b1c7d9fd48d107bc3fad75e32efe
Author: Jay Pipes <email address hidden>
Date: Mon Apr 7 00:50:09 2014 -0400

    Correct test boundary for libvirt_driver.get_info

    The test_get_domain_info_with_more_return() unit test was causing
    failure on some systems where lxml was not capable of handling None for
    the xml to parse. However, our unit tests should not be testing libvirt;
    the unit tests in libvirt already do that. Our unit tests should simply
    test the code boundaries of the unit of code that they wish to stress,
    and not anything further.

    This patch changes the unit test in question to only test the code
    within the libvirt_driver.LibvirtDriver.get_info() method, and nothing
    more, and in doing so, we remove any calls at all to libvirt and mock
    out where the code passes the boundaries of the get_info() method.

    Change-Id: I022cc331a980c2a4d98f16d2d77b24839b528464
    Closes-bug: #1301602

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.