diff --git a/.gitignore b/.gitignore index f2d954f..2352d65 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ /os-autoinst-f54bdeab5173b70032d1d3fcfe2e86395f6e47c8.tar.gz /os-autoinst-496edb5a0cf96c791a727f227c204722ae141bdf.tar.gz /os-autoinst-24ec8f98d9ce9d3223231c16ff21237f73391310.tar.gz +/os-autoinst-f21226c3b2c8987e5b5840dde04229e3298a07e0.tar.gz diff --git a/0001-Fix-return-value-of-_dbus_do_call.patch b/0001-Fix-return-value-of-_dbus_do_call.patch deleted file mode 100644 index fa4635e..0000000 --- a/0001-Fix-return-value-of-_dbus_do_call.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 442f79e8b018ef4fed91c1256d5f4796cc42a36e Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Wed, 14 Apr 2021 21:43:27 -0700 -Subject: [PATCH] Fix return value of _dbus_do_call - -This was relying on perl's default return behaviour before -(return the result of the final line of the function, if it's an -expression). But now that's wrong, as the last line is something -else. We need to be explicit about what we're returning (which -would generally be a good thing to do anyway). - -Related progress issue: https://progress.opensuse.org/issues/91163 - -Signed-off-by: Adam Williamson ---- - backend/qemu.pm | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/backend/qemu.pm b/backend/qemu.pm -index 735e349c..04bb05fb 100644 ---- a/backend/qemu.pm -+++ b/backend/qemu.pm -@@ -141,8 +141,9 @@ sub _dbus_do_call { - my $bus = Net::DBus->system(private => 1); - my $bus_service = $bus->get_service("org.opensuse.os_autoinst.switch"); - my $bus_object = $bus_service->get_object("/switch", "org.opensuse.os_autoinst.switch"); -- $bus_object->$fn(@args); -+ my @result = $bus_object->$fn(@args); - $bus->get_connection->disconnect; -+ return @result; - } - - sub _dbus_call { --- -2.31.1 - diff --git a/0001-Re-connect-to-dbus-for-each-call.patch b/0001-Re-connect-to-dbus-for-each-call.patch deleted file mode 100644 index 421be17..0000000 --- a/0001-Re-connect-to-dbus-for-each-call.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 8776da7055d572fc6223eb6ce9ad4c3a5b2f925b Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Tue, 13 Apr 2021 09:02:55 -0700 -Subject: [PATCH] Re-connect to dbus for each call - -By using the system bus and leaving our connection to it open -for the entire lifetime of the isotovideo process, we're setting -ourselves up to receive a lot of signals we don't deal with, and -just letting them accumulate. Since all we want to do is send a -signal and then go away, let's use a private socket, and -re-initialize the connection for each signal. The overhead of -doing this is not large, and we're sending small numbers of -signals per isotovideo process anyway (one signal per network on -startup, one signal at startup if a debug variable is set, and -one signal per network at end). - -Thanks to @dvdhrm and @berrange for their help with this. - -Related progress issue: https://progress.opensuse.org/issues/90872 ---- - backend/qemu.pm | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/backend/qemu.pm b/backend/qemu.pm -index 6c64f497..735e349c 100644 ---- a/backend/qemu.pm -+++ b/backend/qemu.pm -@@ -135,10 +135,14 @@ sub stop_qemu { - - sub _dbus_do_call { - my ($self, $fn, @args) = @_; -- $self->{dbus} ||= Net::DBus->system; -- $self->{dbus_service} ||= $self->{dbus}->get_service("org.opensuse.os_autoinst.switch"); -- $self->{dbus_object} ||= $self->{dbus_service}->get_object("/switch", "org.opensuse.os_autoinst.switch"); -- $self->{dbus_object}->$fn(@args); -+ # we intentionally do not persist the dbus connection to avoid -+ # queueing up signals we are not interested in handling: -+ # https://progress.opensuse.org/issues/90872 -+ my $bus = Net::DBus->system(private => 1); -+ my $bus_service = $bus->get_service("org.opensuse.os_autoinst.switch"); -+ my $bus_object = $bus_service->get_object("/switch", "org.opensuse.os_autoinst.switch"); -+ $bus_object->$fn(@args); -+ $bus->get_connection->disconnect; - } - - sub _dbus_call { --- -2.31.1 - diff --git a/0001-Update-qemu-argument-used-to-disable-floppy-drive-fo.patch b/0001-Update-qemu-argument-used-to-disable-floppy-drive-fo.patch deleted file mode 100644 index 771df17..0000000 --- a/0001-Update-qemu-argument-used-to-disable-floppy-drive-fo.patch +++ /dev/null @@ -1,34 +0,0 @@ -From b1ea2d3376d8d337bb84230eead0759a57905f8c Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Thu, 15 Apr 2021 16:43:24 -0700 -Subject: [PATCH] Update qemu argument used to disable floppy drive for qemu - 6.0 - -The way we were doing this before no longer works with qemu 6.0. -Markus Armbruster suggests using -nodefaults, but that's a bigger -gun and we'd have to check we aren't relying on the default -devices in any way before using it. This was his second choice -suggestion "If you'd prefer not to". It does seem to work (with -both older and newer qemu). See: - -https://bugs.launchpad.net/bugs/1923663 ---- - backend/qemu.pm | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/backend/qemu.pm b/backend/qemu.pm -index 04bb05fb..28a6f88a 100644 ---- a/backend/qemu.pm -+++ b/backend/qemu.pm -@@ -857,7 +857,7 @@ sub start_qemu { - { - # Remove floppy drive device on architectures - unless ($arch eq 'aarch64' || $arch eq 'arm' || $vars->{QEMU_NO_FDC_SET}) { -- sp('global', 'isa-fdc.driveA='); -+ sp('global', 'isa-fdc.fdtypeA=none'); - } - - sp('m', $vars->{QEMURAM}) if $vars->{QEMURAM}; --- -2.31.1 - diff --git a/0001-signalblocker-Also-block-SIGCHLD.patch b/0001-signalblocker-Also-block-SIGCHLD.patch deleted file mode 100644 index 025a473..0000000 --- a/0001-signalblocker-Also-block-SIGCHLD.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 61b1834c5366c78f0e4d3b21a142d7dd6d6322c1 Mon Sep 17 00:00:00 2001 -From: Fabian Vogt -Date: Tue, 13 Apr 2021 15:41:00 +0200 -Subject: [PATCH] signalblocker: Also block SIGCHLD - -The perl-unaware threads created by OpenCV also crash when they encounter a -SIGCHLD signal, which happens by using perl's "system" function for instance. ---- - signalblocker.pm | 22 +++++++++++----------- - t/28-signalblocker.t | 14 ++++++++++++-- - 2 files changed, 23 insertions(+), 13 deletions(-) - -diff --git a/signalblocker.pm b/signalblocker.pm -index 1ff3652c..dea56e12 100644 ---- a/signalblocker.pm -+++ b/signalblocker.pm -@@ -1,4 +1,4 @@ --# Copyright © 2020 SUSE LLC -+# Copyright © 2021 SUSE LLC - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by -@@ -19,23 +19,23 @@ use Mojo::Base -base; - use bmwqemu; - use POSIX ':signal_h'; - --# OpenCV forks a lot of threads and the TERM signal we may get from the --# parent process would be delivered to an undefined thread. But as those --# threads do not have a perl interpreter, the perl signal handler (we set --# later) would crash. So we need to block the TERM signal in the forked --# processes before we set the signal handler of our choice. -+# OpenCV forks a lot of threads and the signals we may get (TERM from the -+# parent, CHLD from children) would be delivered to an undefined thread. -+# But as those threads do not have a perl interpreter, the perl signal -+# handler would crash. We need to block those signals in those threads, so -+# that they get delivered only to those threads which can handle it. - - sub new { - my ($class, @args) = @_; - - # block signals -- bmwqemu::diag('Blocking SIGTERM'); -+ bmwqemu::diag('Blocking SIGCHLD and SIGCHLD'); - my %old_sig = %SIG; - $SIG{TERM} = 'IGNORE'; - $SIG{INT} = 'IGNORE'; - $SIG{HUP} = 'IGNORE'; -- my $sigset = POSIX::SigSet->new(SIGTERM); -- die "Could not block SIGTERM\n" unless defined sigprocmask(SIG_BLOCK, $sigset, undef); -+ my $sigset = POSIX::SigSet->new(SIGCHLD, SIGTERM); -+ die "Could not block SIGCHLD and SIGTERM\n" unless defined sigprocmask(SIG_BLOCK, $sigset, undef); - - # create the actual object holding the information to restore the previous state - my $self = $class->SUPER::new(@args); -@@ -48,8 +48,8 @@ sub DESTROY { - my ($self) = @_; - - # set back signal handling to default to be able to terminate properly -- bmwqemu::diag('Unblocking SIGTERM'); -- die "Could not unblock SIGTERM\n" unless defined sigprocmask(SIG_UNBLOCK, $self->{_sigset}, undef); -+ bmwqemu::diag('Unblocking SIGCHLD and SIGTERM'); -+ die "Could not unblock SIGCHLD and SIGTERM\n" unless defined sigprocmask(SIG_UNBLOCK, $self->{_sigset}, undef); - %SIG = %{$self->{_old_sig}}; - } - -diff --git a/t/28-signalblocker.t b/t/28-signalblocker.t -index 31ddb6f6..9e1a99a5 100755 ---- a/t/28-signalblocker.t -+++ b/t/28-signalblocker.t -@@ -1,6 +1,6 @@ - #!/usr/bin/perl - # --# Copyright (c) 2020 SUSE LLC -+# Copyright (c) 2021 SUSE LLC - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by -@@ -44,9 +44,13 @@ my $no_signal_blocker = $ENV{OS_AUTOINST_TEST_NO_SIGNAL_BLOCKER}; - sub thread_count { scalar split("\n", `ps huH p $$`) } - is(my $last_thread_count = thread_count, 1, 'initially one thread'); - --# count SIGTERMs we receive; this handler should work after creating/destroying the signal blocker -+# count SIGTERMs we receive; those handlers should work after creating/destroying the signal blocker -+# Note that without these handlers, there won't be any crash in Perl's signal handler as it's never -+# registered for those signals. - my $received_sigterm = 0; - $SIG{TERM} = sub { $received_sigterm += 1; note "received SIGTERM $received_sigterm"; }; -+my $received_sigchld = 0; -+$SIG{CHLD} = sub { $received_sigchld += 1; note "received SIGCHLD $received_sigchld"; }; - - # initialize OpenCV via signalblocker and create_threads - { -@@ -75,6 +79,12 @@ waitpid $fork, 0; - note 'waiting for at least one signal to be handled' and sleep .2 until $received_sigterm >= 1 || ($timeout -= .2) < 0; - note "handled $received_sigterm TERM signals"; - ok($received_sigterm > 0, "received SIGTERM $received_sigterm times; no crashes after at least 200 ms idling time"); -+ -+$received_sigchld = 0; -+# 0 here means WIFEXITED and WEXITSTATUS == 0 -+cmp_ok(system("true"), '==', 0, 'system returns exit status'); -+is($received_sigchld, 1, 'got SIGCHLD after system'); -+ - cmp_ok(thread_count, '<=', $last_thread_count, 'still no new threads after sending signals'); - - done_testing; --- -2.31.1 - diff --git a/os-autoinst.spec b/os-autoinst.spec index ade0786..4cb4ae7 100644 --- a/os-autoinst.spec +++ b/os-autoinst.spec @@ -31,34 +31,18 @@ %global github_owner os-autoinst %global github_name os-autoinst %global github_version 4.6 -%global github_commit 24ec8f98d9ce9d3223231c16ff21237f73391310 +%global github_commit f21226c3b2c8987e5b5840dde04229e3298a07e0 # if set, will be a post-release snapshot build, otherwise a 'normal' build -%global github_date 20210326 +%global github_date 20210519 %global shortcommit %(c=%{github_commit}; echo ${c:0:7}) Name: os-autoinst Version: %{github_version} -Release: 36%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} +Release: 37%{?github_date:.%{github_date}git%{shortcommit}}%{?dist} Summary: OS-level test automation License: GPLv2+ URL: https://os-autoinst.github.io/openQA/ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{github_name}-%{github_commit}.tar.gz -# https://github.com/os-autoinst/os-autoinst/pull/1640 -# Hopefully fix crashes on isotovideo exit: -# https://bugzilla.redhat.com/show_bug.cgi?id=1667163 -Patch0: 0001-signalblocker-Also-block-SIGCHLD.patch -# https://github.com/os-autoinst/os-autoinst/pull/1641 -# Try and fix dbus limit overflows: -# https://progress.opensuse.org/issues/90872 -Patch1: 0001-Re-connect-to-dbus-for-each-call.patch -# Fix a bug in Patch1 which broke things when OVS_DEBUG is set: -# https://github.com/os-autoinst/os-autoinst/pull/1644 -# https://progress.opensuse.org/issues/91163 -Patch2: 0001-Fix-return-value-of-_dbus_do_call.patch -# Update qemu arg used to disable floppy drive for qemu 6.0: -# https://github.com/os-autoinst/os-autoinst/pull/1646 -# https://bugs.launchpad.net/bugs/1923663 -Patch3: 0001-Update-qemu-argument-used-to-disable-floppy-drive-fo.patch # on SUSE this is conditional, for us it doesn't have to be but we # still use a macro just to keep build_requires similar for ease of @@ -91,7 +75,7 @@ Patch3: 0001-Update-qemu-argument-used-to-disable-floppy-drive-fo.patch %define test_version_only_requires perl(Mojo::IOLoop::ReadWriteProcess) >= 0.28 # The following line is generated from dependencies.yaml (upstream) # The following line is generated from dependencies.yaml (upstream) -%define test_requires %build_requires %test_base_requires %yamllint_requires perl(YAML::PP) +%define test_requires %build_requires %test_base_requires %yamllint_requires perl(Inline::Python) perl(YAML::PP) # diff from SUSE: dropped perl(Devel::Cover::Report::Codecov) as it's # not currently packaged for Fedora # The following line is generated from dependencies.yaml (upstream) @@ -176,6 +160,9 @@ rm -f t/07-commands.t # we don't really need to ship this in the package, usually the web UI # is much better for needle editing rm %{buildroot}%{_prefix}/lib/os-autoinst/crop.py* +# ...and this thing is just, uh, a little crazy? see: +# https://github.com/os-autoinst/os-autoinst/pull/1558 +rm %{buildroot}%{_prefix}/lib/os-autoinst/testapi.py* # we're going to %%license this rm %{buildroot}%{_pkgdocdir}/COPYING ls -lR %buildroot @@ -240,6 +227,9 @@ rm tools/lib/perlcritic/Perl/Critic/Policy/*.pm %files devel %changelog +* Thu May 20 2021 Adam Williamson - 4.6-37.20210519gitf21226c +- Update to latest git, resync spec, drop all patches (merged upstream) + * Thu Apr 15 2021 Adam Williamson - 4.6-36.20210326git24ec8f9 - Backport fix for a bug in the dbus change from -35 (POO #91163) - Update dbus change patch to final version so fix applies diff --git a/sources b/sources index 1b8a0fd..d3dee9c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (os-autoinst-24ec8f98d9ce9d3223231c16ff21237f73391310.tar.gz) = 3dcd6aff0e26733aa3bde84d525b63e79d5cc1749cfaa4d394abcbc68b4d50d1d44339c6dbfed311d4636827cadd12fd26ecdd55c6118a48e98ec35657029c06 +SHA512 (os-autoinst-f21226c3b2c8987e5b5840dde04229e3298a07e0.tar.gz) = 8ba2d66de1061ee7d268c161b37007c2f50b6b434874437f1d17000b311f9e8c2c9998052b4c3e8d2169f5819dbd6f7987e21bdef6dd7bdaf11847a18a935e39