Comment 5 for bug 1341729

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

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

commit ee57c65fa26d0be473be9d5e55748abd6693ad0d
Author: Daniel P. Berrange <email address hidden>
Date: Tue Jul 15 17:15:18 2014 +0100

    libvirt: fix recent test changes to work on libvirt < 0.9.13

    The newly used 'listAllDomains' method was only introduced in
    libvirt 0.9.13. Although the driver code was written to cope
    with older libvirt, the test suite code itself would fail
    when faced with such an old libvirt because it was trying to
    mock out methods which did not exist.

    The fix here recognises that since '_list_instance_domains_fast'
    and '_list_instance_domains_slow' both have explicit test cases,
    there is no point in mocking out the low level 'listAllDomains'
    method in all the other test cases. Instead we can mock out
    the much higher level '_list_instance_domains' which means we
    avoid any interaction with libvirt in these test cases. The
    opportunity is taken to convert the tests in question to use
    'mock' instead of 'mox' since it also simplifies the code.

    Finally in the test for '_list_instance_domains_fast' simply
    skip the test if libvirt is too old to have the required
    constants defined.

    Closes-bug: 1341729
    Change-Id: I554352ea14e6b3306176e7524502e005cebd8c16