Backport fix for a test regex with recent qemu

f38
Adam Williamson 5 years ago
parent a04b9603e4
commit aa7a215f7e

@ -0,0 +1,32 @@
From c2a1e23ce3347359a868d287379710e603cff523 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tina=20M=C3=BCller?= <tina.mueller@suse.com>
Date: Tue, 18 Aug 2020 12:19:45 +0200
Subject: [PATCH] t: Fix regex for warning (multiline)
Apparently on some platforms/versions of qemu the error message is
multiline, so the regex needs an /s modifier.
'init_blockdev_images: 'create -f qcow2 raid/hd0 420G' failed after 2 tries: runcmd 'qemu-img create -f qcow2 raid/hd0 420G' failed with exit code 1: 'Formatting 'raid/hd0', fmt=qcow2 cluster_size=65536 compression_type=zlib size=450971566080 lazy_refcounts=off refcount_bits=16
qemu-img: raid/hd0: Could not create file: No such file or directory' at /home/abuild/rpmbuild/BUILD/os-autoinst-4.6.1597406683.45b10929/osutils.pm line 121.
Issue: https://progress.opensuse.org/issues/70120
---
t/18-qemu.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/18-qemu.t b/t/18-qemu.t
index dbaab45b..bee6dda4 100755
--- a/t/18-qemu.t
+++ b/t/18-qemu.t
@@ -153,7 +153,7 @@ $proc->deserialise_state(path($path)->slurp());
is_deeply(\@gcmdl, \@cmdl, 'Multipath Command line after serialisation and deserialisation');
$ENV{QEMU_IMG_CREATE_TRIES} = 2;
-my $expected = qr/failed after 2 tries.*No such.*directory/;
+my $expected = qr/failed after 2 tries.*No such.*directory/s;
my @warnings = warnings {
like exception { $proc->init_blockdev_images() }, $expected, 'init_blockdev_images can report error';
};
--
2.28.0

@ -38,11 +38,15 @@
Name: os-autoinst
Version: %{github_version}
Release: 25%{?github_date:.%{github_date}git%{shortcommit}}%{?dist}
Release: 26%{?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
# Fix a test regex to be multiline
# https://github.com/os-autoinst/os-autoinst/commit/c2a1e23ce3347359a868d287379710e603cff523
# https://bugzilla.redhat.com/show_bug.cgi?id=1873028
Patch0: 0001-t-Fix-regex-for-warning-multiline.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
@ -221,6 +225,9 @@ rm tools/lib/perlcritic/Perl/Critic/Policy/*.pm
%files devel
%changelog
* Thu Aug 27 2020 Adam Williamson <awilliam@redhat.com> - 4.6-26.20200804gitb781299
- Backport fix for a test regex with recent qemu
* Wed Aug 05 2020 Adam Williamson <awilliam@redhat.com> - 4.6-25.20200804gitb781299
- Fix OS_AUTOINST_DATA_DIR definition so @INC comes out right

Loading…
Cancel
Save