[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] iotests: avoid broken pipe with certtool
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] iotests: avoid broken pipe with certtool |
Date: |
Tue, 19 Feb 2019 16:21:14 +0000 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Tue, Feb 19, 2019 at 05:19:46PM +0100, Thomas Huth wrote:
> On 19/02/2019 17.13, Daniel P. Berrangé wrote:
> > When we run "certtool | head -1" the latter command is likely to
> > complete and exit before certtool has written everything it wants to
> > stderr. In at least the RHEL-7 gnutls 3.3.29 this causes certtool to
> > quit with broken pipe before it has finished writing the desired
> > output file to disk. This causes non-deterministic failures of the
> > iotest 233 because the certs are sometimes zero length files.
> > If certtool fails the "head -1" means we also loose any useful error
> > message it would have printed.
> >
> > Thus this patch gets rid of the pipe and post-processes the output in a
> > more flexible & reliable manner.
> >
> > Reported-by: Thomas Huth <address@hidden>
> > Signed-off-by: Daniel P. Berrangé <address@hidden>
> > ---
> > tests/qemu-iotests/common.tls | 48 +++++++++++++++++++++++------------
> > 1 file changed, 32 insertions(+), 16 deletions(-)
> >
> > diff --git a/tests/qemu-iotests/common.tls b/tests/qemu-iotests/common.tls
> > index eae81789bb..6cf11ed383 100644
> > --- a/tests/qemu-iotests/common.tls
> > +++ b/tests/qemu-iotests/common.tls
> > @@ -29,6 +29,17 @@ tls_x509_cleanup()
> > }
> >
> >
> > +tls_certtool()
> > +{
> > + certtool "$@" 1>certtool.log 2>&1
> > + if test "$?" = 0; then
> > + head -1 certtool.log
> > + else
> > + cat certtool.log
> > + fi
> > + rm -f certtool.log
> > +}
>
> I assume this is running in a unique directory so that there can not be
> a clash with a test running in parallel? Otherwise I'd recommend an
> mktemp file name here...
Hmm, could be a problem. Whatever happened to the plan to make every
iotests run in a private directory ? Did that ever get done ?
>
> Anyway, this fixes the issue for me, too, thus:
>
> Tested-by: Thomas Huth <address@hidden>
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 :|