[libvirt] [tck PATCH 0/3] a few minor TCK bugfixes

Laine Stump (3): reduce required libvirt version in rpm spec fix selinux/100-static-relabel-no test double timeout on nwfilter 060-concurrency test perl-Sys-Virt-TCK.spec.PL | 2 +- scripts/nwfilter/nwfilter_concurrent.sh | 2 +- scripts/selinux/100-static-relabel-no.t | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) -- 2.14.5

Some distros where we want to run libvirt-tck have stock libvirt versions lower than 4.4.0 (e.g. Fedora 28 has libvirt-4.1.0, and RHEL7 has libvirt-3.9.0). Reduce the version in the specfile Requires: so that we can get the tck installed without needing to upgrade to some newer unofficial libvirt build. Signed-off-by: Laine Stump <laine@laine.org> --- perl-Sys-Virt-TCK.spec.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-Sys-Virt-TCK.spec.PL b/perl-Sys-Virt-TCK.spec.PL index b91a7e7..6756f0d 100644 --- a/perl-Sys-Virt-TCK.spec.PL +++ b/perl-Sys-Virt-TCK.spec.PL @@ -34,7 +34,7 @@ License: GPLv2 Source: http://libvirt.org/sources/tck/%{appname}-v%{version}.tar.gz Url: http://libvirt.org/ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -Requires: libvirt >= 4.4.0 +Requires: libvirt >= 3.9.0 %if 0%{?fedora} || 0%{?rhel} > 7 BuildRequires: perl-interpreter BuildRequires: perl-generators -- 2.14.5

This test disables auto-relabeling so that it can test if setting a user-defined label in the config will work. The problem is that the disk image used to boot is then not labelled correctly, and qemu can't open it. To circumvent this failure (which is *not* of the functionality we're testing), this patch just temporarily sets SELinux to permissive mode during the test, then sets it back during cleanup. Signed-off-by: Laine Stump <laine@laine.org> --- scripts/selinux/100-static-relabel-no.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/selinux/100-static-relabel-no.t b/scripts/selinux/100-static-relabel-no.t index ab52534..733dbf3 100644 --- a/scripts/selinux/100-static-relabel-no.t +++ b/scripts/selinux/100-static-relabel-no.t @@ -32,10 +32,14 @@ use Test::More tests => 6; use Sys::Virt::TCK; use Sys::Virt::TCK::SELinux; +my $selinux_status = ""; my $tck = Sys::Virt::TCK->new(); my $conn = eval { $tck->setup(); }; BAIL_OUT "failed to setup test harness: $@" if $@; -END { $tck->cleanup if $tck; } +END { + system("setenforce", "1") if ($selinux_status eq "Enforcing"); + $tck->cleanup if $tck; +} my $info; eval { @@ -58,6 +62,13 @@ SKIP: { ->disk(src => $disk, dst => "vdb", type => "file") ->as_xml; + chomp($selinux_status = `getenforce`); + diag "selinux is $selinux_status"; + if ($selinux_status eq "Enforcing") { + diag "Temporarily setting SELinux to Permissive mode"; + system("setenforce", "0"); + } + diag "Creating a new transient domain"; my $dom; ok_domain(sub { $dom = $conn->create_domain($xml) }, "created transient domain object"); -- 2.14.5

The previous timeout of 5 minutes works out okay on 4 core 8 thread AMD hardware, but isn't enough on, for example, a 2 core virtual machine running on the same hardware - it takes about 4 minutes on the former, and 8.5 minutes on the latter. So let's double the timeout to 10 minutes and see if anybody is still complaining. Signed-off-by: Laine Stump <laine@laine.org> --- scripts/nwfilter/nwfilter_concurrent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nwfilter/nwfilter_concurrent.sh b/scripts/nwfilter/nwfilter_concurrent.sh index c42dd78..88ac876 100644 --- a/scripts/nwfilter/nwfilter_concurrent.sh +++ b/scripts/nwfilter/nwfilter_concurrent.sh @@ -244,7 +244,7 @@ runTest() # Test runs for a maximum of 5 minutes now=`date +%s` - test_end=$(($now + 5 * 60)) + test_end=$(($now + 10 * 60)) while :; do -- 2.14.5

On Thu, Oct 18, 2018 at 03:20:43PM -0400, Laine Stump wrote:
Laine Stump (3): reduce required libvirt version in rpm spec fix selinux/100-static-relabel-no test double timeout on nwfilter 060-concurrency test
perl-Sys-Virt-TCK.spec.PL | 2 +- scripts/nwfilter/nwfilter_concurrent.sh | 2 +- scripts/selinux/100-static-relabel-no.t | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Daniel P. Berrangé
-
Laine Stump