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

Mike Latimer mlatimer at suse.com
Tue Apr 1 17:37:39 UTC 2014


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




More information about the libvir-list mailing list