Re: [PATCH] libvirt-tck: Ignore SIGPIPE in 051-daemon-hook.t

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

 



Sorry for the slow response, I've been distracted with other projects.

On Monday, March 10, 2014 09:25:37 PM Osier Yang wrote:
> Hm, $tck->cleanup() doesn't close the connection, it just destroy and
> undefine the existing domains, networks, and pools.
> 
> <snip>
> sub reset {
>      my $self = shift;
>      my $conn = shift || $self->conn;
> 
>      $self->reset_domains($conn);
>      $self->reset_networks($conn);
>      $self->reset_storage_pools($conn);
> }
> 
> sub cleanup {
>      my $self = shift;
> 
>      foreach my $conn (@{$self->{conns}}) {
>          $self->reset($conn);
>      }
> 
>      delete $self->{conns};
> }
> </snip>
> 
> So it looks like we need a new helper to close the connection.

While that seems to be true, I just realized the cleanup is not actually 
completing. The SIGPIPE is coming from reset_domains, when $conn->list_domains 
is accessed. Any attempts to use $conn after stopping (and then starting) 
libvirtd results in the SIGPIPE.

In this particular test case (051-daemon-hook.t) the only purpose for $tck and 
$conn is to determine the uri to prevent the test from running against xen. 
After that check has been made, the SIGPIPE can be avoided with the following 
change:

diff --git a/scripts/hooks/051-daemon-hook.t b/scripts/hooks/051-daemon-hook.t
index 165cf4e..63e3dbb 100644
--- a/scripts/hooks/051-daemon-hook.t
+++ b/scripts/hooks/051-daemon-hook.t
@@ -46,6 +46,10 @@ SKIP: {
     skip 12, "NOT using QEMU/LXC driver" unless
         $uri eq "qemu:///system" or $uri eq "lxc:///";

+    # Cleanup $conn and $tck here, to avoid SIGPIPE during libvirtd 
stop/start
+    undef $conn;
+    $tck->cleanup();
+
     my $hook = Sys::Virt::TCK::Hooks->new(type => 'daemon',
                                           conf_dir => '/etc/libvirt/hooks',
                                           log_name => '/tmp/daemon.log');
-- 

I'm not completely sure why I have to undefine $conn prior to cleaning up $tck, 
but maybe this is where that new helper you mentioned would come into play. If 
so, can you give me a pointer on how this should look?

Thanks,
Mike

--
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]