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 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list