"test_check_can_live_migrate_dest_fills_listen_addrs" failed due to incorrect mock

Bug #1634962 reported by Thawngzapum Lian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Mikhail Feoktistov

Bug Description

==============================
Failed 1 tests - output below:
==============================

nova.tests.unit.virt.libvirt.test_driver.LibvirtConnTestCase.test_check_can_live_migrate_dest_fills_listen_addrs
----------------------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
        return func(*args, **keywargs)
      File "nova/tests/unit/virt/libvirt/test_driver.py", line 6837, in test_check_can_live_migrate_dest_fills_listen_addrs
        self.context, instance_ref, compute_info, compute_info)
      File "nova/virt/libvirt/driver.py", line 5390, in check_can_live_migrate_destination
        self._compare_cpu(instance.vcpu_model, None, instance)
      File "nova/virt/libvirt/driver.py", line 5660, in _compare_cpu
        raise exception.InvalidCPUInfo(reason=m % {'ret': ret, 'u': u})
    nova.exception.InvalidCPUInfo: Unacceptable CPU info: CPU doesn't have compatibility.

    <MagicMock name='compareCPU()' id='274274000'>

    Refer to http://libvirt.org/html/libvirt-libvirt-host.html#virCPUCompareResult

Captured pythonlogging:
~~~~~~~~~~~~~~~~~~~~~~~
    2016-10-19 10:19:06,319 INFO [os_brick.initiator.connectors.disco] Init DISCO connector
    2016-10-19 10:19:06,320 WARNING [os_brick.initiator.connectors.remotefs] Connection details not present. RemoteFsClient may not initialize properly.
    2016-10-19 10:19:06,322 INFO [nova.virt.libvirt.driver] Connection event '1' reason 'None'
    2016-10-19 10:19:06,328 ERROR [nova.virt.libvirt.driver] CPU doesn't have compatibility.

    <MagicMock name='compareCPU()' id='274274000'>

    Refer to http://libvirt.org/html/libvirt-libvirt-host.html#virCPUCompareResult

======
Totals
======
Ran: 14517 tests in 1850.0000 sec.
 - Passed: 14458
 - Skipped: 58
 - Expected Fail: 0
 - Unexpected Success: 0
 - Failed: 1
Sum of execute time for each test: 3527.7612 sec.

************************************************************
It should be mocking as the following
@mock.patch.object(libvirt_driver.LibvirtDriver,
                   '_compare_cpu')
instead of
@mock.patch.object(fakelibvirt.Connection, 'compareCPU')

Revision history for this message
Stephen Finucane (stephenfinucane) wrote :

This should be fixed with this patch https://review.openstack.org/#/c/388643/2

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: nobody → Mikhail Feoktistov (mfeoktistov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/388643
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=758307c9e0ed17152aadb7aa5d3fb81f4bfe87e4
Submitter: Jenkins
Branch: master

commit 758307c9e0ed17152aadb7aa5d3fb81f4bfe87e4
Author: Mikhail Feoktistov <email address hidden>
Date: Wed Oct 19 07:42:51 2016 -0400

    fix testcase test_check_can_live_migrate_dest_fills_listen_addrs

    We should set return_value=1 for compareCPU hook.
    Otherwise we'll get an exception InvalidCPUInfo:
    CPU doesn't have compatibility

    Change-Id: Id9313eb46084e60cf0c7f5a77fe9a8a7dc86b8fb
    Closes-Bug: #1634962

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b1

This issue was fixed in the openstack/nova 15.0.0.0b1 development milestone.

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.