[Libguestfs] [PATCH nbdkit] tests/test-exportname.sh: Fix test.

Eric Blake eblake at redhat.com
Mon Oct 5 19:58:55 UTC 2020


On 10/5/20 2:52 PM, Richard W.M. Jones wrote:
> When “nbdkit ... --run 'nbdinfo ...' > out” is expected to fail, we
> cannot be sure of the content of the "out" file.  In particular
> nbdinfo produces its output incrementally, so in JSON mode there's
> usually a stray "{" in the output, and in non-JSON mode it usually
> prints the "protocol: " line.
> 
> Thus it's not correct to test for the output file being non-empty.
> 
> Remove these lines which caused the test to fail.  However I replaced
> them with "cat" for diagnostic purposes.
> 
> Fixes: commit 7623b2cc45078cca88fdd2d96c70c7f82a0db49d
> ---
>  tests/test-exportname.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Looks good to me. Maybe we should try harder in nbdinfo to produce no
output on stdout except on success, but we'll need this workaround for
released versions regardless of whether we make that effort in libnbd.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20201005/724b0a74/attachment.sig>


More information about the Libguestfs mailing list