[libvirt] [PATCH] libvirt-tck: Skip Test when no security model is in use

Daniel P. Berrange berrange at redhat.com
Mon Nov 7 10:00:25 UTC 2011


On Sun, Nov 06, 2011 at 04:30:02PM +0100, Guido Günther wrote:
> Hi,
> if I'm reading this test correctly it's supposed to fail without a
> security model at work.
> 
> The file images are always readable/writeable to the libvirt user and
> group without one.
> 
> Cheers,
>  -- Guido
> 
> ---
>  scripts/qemu/205-qcow2-double-backing-file.t |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/qemu/205-qcow2-double-backing-file.t b/scripts/qemu/205-qcow2-double-backing-file.t
> index 7ae278d..d3a5e33 100644
> --- a/scripts/qemu/205-qcow2-double-backing-file.t
> +++ b/scripts/qemu/205-qcow2-double-backing-file.t
> @@ -52,17 +52,22 @@ my $conn = eval { $tck->setup(); };
>  BAIL_OUT "failed to setup test harness: $@" if $@;
>  END { $tck->cleanup if $tck; }
>  
> +my $info;
> +eval {
> +    $info = $conn->get_node_security_model();
> +};
> +
>  SKIP: {
>      skip "Only relevant to QEMU driver", 26 unless $conn->get_type() eq "QEMU";
>      skip "Only relevant when run as root", 26 unless $< == 0;
>      skip "Only relevant for system driver", 26 unless
>  	$conn->get_uri() =~ m/system/;
> -
> +    skip "Only relevant when using a security model", 26 unless
> +	$info && $info->{model};
>  
>      my $xml = $tck->generic_pool("dir")
>  	->mode("0755")->as_xml;
>  
> -
>      diag "Defining transient storage pool $xml";
>      my $pool;
>      ok_pool(sub { $pool = $conn->define_storage_pool($xml) }, "define transient storage pool");

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list