[tck PATCH v2 10/13] scripts: don't abort the entire test harness when libvirtd isn't running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is reasonable to run TCK against a manually started libvirtd, so we
should not abort the entire test suite. Just mark the hook scripts as
skipped.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 scripts/hooks/051-daemon-hook.t |  2 +-
 scripts/hooks/052-domain-hook.t | 14 +++++++++-----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/scripts/hooks/051-daemon-hook.t b/scripts/hooks/051-daemon-hook.t
index aa7668b..82cedee 100644
--- a/scripts/hooks/051-daemon-hook.t
+++ b/scripts/hooks/051-daemon-hook.t
@@ -51,7 +51,7 @@ SKIP: {
                                           log_name => '/tmp/daemon.log');
 
     $hook->libvirtd_status();
-    BAIL_OUT "libvirtd is not running, Exit..."
+    skip "libvirtd is not running, Exit...", 12
         if ($hook->{libvirtd_status} eq 'stopped');
 
     eval { $hook->prepare(); };
diff --git a/scripts/hooks/052-domain-hook.t b/scripts/hooks/052-domain-hook.t
index 07e4b23..c3a0b3f 100644
--- a/scripts/hooks/052-domain-hook.t
+++ b/scripts/hooks/052-domain-hook.t
@@ -49,17 +49,21 @@ SKIP: {
     skip "NOT using QEMU/LXC driver", 12 unless
         $uri eq "qemu:///system" or $uri eq "lxc:///";
 
+    my $hook_type = $uri eq "qemu:///system" ? 'qemu' : 'lxc';
+
+    my $hook = Sys::Virt::TCK::Hooks->new(type => $hook_type,
+                                          conf_dir => '/etc/libvirt/hooks',
+                                          expect_result => 0);
+    $hook->libvirtd_status();
+    skip "libvirtd is not running, Exit...", 12
+        if ($hook->{libvirtd_status} eq 'stopped');
+
     my $xml = $tck->generic_domain(name => "tck")->as_xml;
 
     diag "Creating a new persistent domain";
     my $dom;
     ok_domain(sub { $dom = $conn->define_domain($xml) }, "created persistent domain object");
 
-    my $hook_type = $uri eq "qemu:///system" ? 'qemu' : 'lxc';
-
-    my $hook = Sys::Virt::TCK::Hooks->new(type => $hook_type,
-                                          conf_dir => '/etc/libvirt/hooks',
-                                          expect_result => 0);
     eval { $hook->prepare(); };
     BAIL_OUT "failed to setup hooks testing ENV: $@" if $@;
 
-- 
2.17.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux