← Back to team overview

openstack team mailing list archive

Re: [OpenStack][Nova] Issues with "run_tests.sh", no tests are run when "import libvirt is present"

 

Run:

  sudo pip install tox

And you will get the tox command.

Does ./run_tests.sh -N nova.tests.test_libvirt work fine when you
_don't_ have libvirt? It needs to skip the test if you don't have
libvirt installed, and it needs to run it and pass if you do.

Jenkins is going to run "tox -v -epy27" and then eventually also "tox -v
-efull" - so make sure both of those work and you'll be set.

Monty

On 07/02/2012 10:30 AM, Leander Bessa Beernaert wrote:
> Running with " ./run_tests.sh -N nova.tests.test_libvirt" works just
> fine, however i don't know if this is enough to get it past jenkins :/
> 
> On Mon, Jul 2, 2012 at 3:26 PM, Daniel P. Berrange <berrange@xxxxxxxxxx
> <mailto:berrange@xxxxxxxxxx>> wrote:
> 
>     On Mon, Jul 02, 2012 at 01:43:31PM +0100, Leander Bessa Beernaert wrote:
>     > So, if no system packages can be imported, how do you test the
>     "connection"
>     > class for the libvirt driver?
>     >
>     > How does that particular test case wrap around the fact that it
>     requires
>     > the libvirt module? The only thing i could find are these lines of
>     code in
>     > the driver's __init__ method. Do these somehow detect if this is a
>     unit
>     > test environment and import the fakelibvirt driver instead? I'm no
>     expert
>     > in python so i'm not sure what's happening there :s
>     >
>     > > global libvirt
>     > > if libvirt is None:
>     > >     libvirt = __import__('libvirt')
> 
>     If you have installed all the neccessary python packages on your
>     local host, then it is entirely possible to run the Nova test
>     suites without using virtualenv. You just need to pass the '-N'
>     arg to the run_tests.sh script, eg on my Fedora 17 host, I can
>     run
> 
>        ./run_tests.sh -N nova.tests.test_libvirt
> 
>     Regards,
>     Daniel
>     --
>     |: http://berrange.com      -o-  
>      http://www.flickr.com/photos/dberrange/ :|
>     |: http://libvirt.org              -o-            
>     http://virt-manager.org :|
>     |: http://autobuild.org       -o-        
>     http://search.cpan.org/~danberr/ :|
>     |: http://entangle-photo.org       -o-      
>     http://live.gnome.org/gtk-vnc :|
> 
> 



Follow ups

References