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

Laine Stump laine at laine.org
Sat Jun 2 01:28:14 UTC 2018


On 05/21/2018 12:46 PM, Daniel P. Berrangé wrote:
> 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 at redhat.com>

Reviewed-by: Laine Stump <laine at laine.org>

(I guess, although it's a bit troublesome that the tests might be
skipped in some case when the libvirtd process started by systemd had
died for some other reason. I suppose some other test would end up
failing in that case anyway though, so I'm worried about nothing.)

> ---
>  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 $@;
>  





More information about the libvir-list mailing list