[libvirt] [PATCH tck] 300-vsitype.t: Skip after $tck is defined

With $tck added to the skip conditional, the entire codeblock has to be after $tck is defined. Also, $tck->cleanup should be added to the skip conditions. --- scripts/nwfilter/300-vsitype.t | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/nwfilter/300-vsitype.t b/scripts/nwfilter/300-vsitype.t index 1de67d1..430618f 100644 --- a/scripts/nwfilter/300-vsitype.t +++ b/scripts/nwfilter/300-vsitype.t @@ -28,14 +28,6 @@ use warnings; use Test::More; -if ( ! -e '/usr/sbin/lldptool' ) { - eval "use Test::More skip_all => \"lldptool is not available\";"; -} elsif (!$tck->get_host_network_device()) { - eval "use Test::More skip_all => \"no host net device configured\";"; -} else { - eval "use Test::More tests => 4"; -} - use Sys::Virt::TCK; use Sys::Virt::TCK::NetworkHelpers; use Test::Exception; @@ -49,6 +41,16 @@ END { $tck->cleanup if $tck; } +if ( ! -e '/usr/sbin/lldptool' ) { + $tck->cleanup if $tck; + eval "use Test::More skip_all => \"lldptool is not available\";"; +} elsif (!$tck->get_host_network_device()) { + $tck->cleanup if $tck; + eval "use Test::More skip_all => \"no host net device configured\";"; +} else { + eval "use Test::More tests => 4"; +} + # create first domain and start it my $xml = $tck->generic_domain(name => "tck", fullos => 1, netmode => "vepa")->as_xml(); -- 1.8.4.5

On Tue, Apr 01, 2014 at 11:37:39AM -0600, Mike Latimer wrote:
With $tck added to the skip conditional, the entire codeblock has to be after $tck is defined. Also, $tck->cleanup should be added to the skip conditions.
--- scripts/nwfilter/300-vsitype.t | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
ACK 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 :|
participants (2)
-
Daniel P. Berrange
-
Mike Latimer