iotests: avoid broken pipe with certtoolpull-nbd-2019-02-25
commitf62b3c953fae63e627cfe86333efb6294bb48a14
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 20 Feb 2019 14:58:19 +0000 (20 14:58 +0000)
committerEric Blake <eblake@redhat.com>
Mon, 25 Feb 2019 14:20:17 +0000 (25 08:20 -0600)
treec8a390cdead4fc7cdade05b8e4f95cee4b1fa686
parent41f946ec1270b281ba0edca7b6c4f6125fe97f5a
iotests: avoid broken pipe with certtool

When we run "certtool 2>&1 | 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 lose 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 <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190220145819.30969-3-berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
tests/qemu-iotests/common.tls