[openstack-dev] [nova][libvirt] Non-readonly connection to libvirt in unit tests

Matt Riedemann mriedem at linux.vnet.ibm.com
Thu Aug 21 00:36:04 UTC 2014



On 8/11/2014 4:42 AM, Daniel P. Berrange wrote:
> On Mon, Aug 04, 2014 at 06:46:13PM -0400, Solly Ross wrote:
>> Hi,
>> I was wondering if there was a way to get a non-readonly connection
>> to libvirt when running the unit tests
>> on the CI.  If I call `LibvirtDriver._connect(LibvirtDriver.uri())`,
>> it works fine locally, but the upstream
>> CI barfs with "libvirtError: internal error Unable to locate libvirtd
>> daemon in /usr/sbin (to override, set $LIBVIRTD_PATH to the name of the
>> libvirtd binary)".
>> If I try to connect by calling libvirt.open(None), it also barfs, saying
>> I don't have permission to connect.  I could just set it to always use
>> fakelibvirt,
>> but it would be nice to be able to run some of the tests against a real
>> target.  The tests in question are part of https://review.openstack.org/#/c/111459/,
>> and involve manipulating directory-based libvirt storage pools.
>
> Nothing in the unit tests should rely on being able to connect to the
> libvirt daemon, as the unit tests should still be able to pass when the
> daemon is not running at all. We should be either using fakelibvirt or
> mocking any libvirt APIs that need to be tested
>
> Regards,
> Daniel
>

So this is busted then right because the new flags being used aren't 
defined in fakelibvirt:

https://github.com/openstack/nova/commit/26504d71ceaecf22f135d8321769db801290c405

-- 

Thanks,

Matt Riedemann




More information about the OpenStack-dev mailing list