[Openstack] [OpenStack][Nova] Help with libvirt unit-test - get_diagnostics command

Leander Bessa Beernaert leanderbb at gmail.com
Fri Jul 6 10:59:51 UTC 2012


Hello,

I've been working on implementing the "diagnostics" command for libvirt -
https://review.openstack.org/#/c/8839/ . Now i need to create the unit test
for this new operation. I've been looking at the code to try and figure out
an easy way to replicate this, but i'm a bit lost.

What i need to do is simulate a connection to libvirt, create a fake
instance with a predefined characteristics, retrieve the virtdomain and
then verify the results from the get_diagnostics command. I'm more at loss
as to how exactly do i setup a fake connection a create a fake instance? I
thought about creating a dummy implementation as i've seen being used
around the tests, however that doesn't give me any access to real method.
Do note that I'm relatively new to python world, so there's a lot of things
i can't grasp yes :s.


Regards,
Leander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20120706/603ce4cc/attachment.html>


More information about the Openstack mailing list