[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 4/4] qemu-iotests: Test creating floppy drive

From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v3 4/4] qemu-iotests: Test creating floppy drives
Date: Wed, 19 Oct 2016 09:37:07 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 18.10.2016 um 21:53 hat Eric Blake geschrieben:
> On 10/18/2016 02:45 PM, John Snow wrote:
> > 
> > 
> > On 10/18/2016 06:22 AM, Kevin Wolf wrote:
> >> This tests the different supported methods to create floppy drives and
> >> how they interact.
> >>
> >> +function check_floppy_qtree()
> >> +{
> >> +    echo
> >> +    echo Testing: "$@" | _filter_testdir
> >> +
> >> +    # QEMU_OPTIONS contains -nodefaults, we don't want that here
> >> because the
> >> +    # defaults are part of what should be checked here
> >> +    echo "info qtree" |
> >> +    QEMU_OPTIONS="" do_run_qemu "$@" | _filter_win32 |
> >> +    grep -zo '[[:cntrl:]]\( *\)dev: isa-fdc.*\([[:cntrl:]]\1
> >> .*\)*[[:cntrl:]] *dev:'
> > 
> > This grep invocation doesn't appear to actually terminate with the '-z'
> > option here. Not sure why, I haven't looked into the bash framework
> > much, hopefully it's not too hard for you to reproduce and correct.

No, obviously I can't reproduce, otherwise I wouldn't have written the
test case like this. It passes just fine for me on RHEL 7.

Just to clarify, it's grep that doesn't terminate, or qemu? Also, what
do you mean by the "bash framework"?

> Is 'grep -z' even portable to BSD, or is it just a GNU extension?  Would
> it be better to run the output through tr to convert things to a saner
> subset of characters before then grepping a text file?

Is qemu-iotests even supposed to run on BSD? All our test cases specify
"_supported_os Linux". (And I don't think this means Linux kernel with
BSD userland :-))

Anyway, the tr thing you mean would be translating all newlines into
something else (which is hopefully otherwise unused), then grep, then
translate back?

What this line is supposed to do (if it wasn't obvious) is extracting
the full information for a single device from 'info qtree'. I don't
really mind how it's done, but multiline operation seems to be something
that isn't trivial with most tools... I think I've done multiline sed
before, so maybe that would be another option.


Attachment: pgpXcFH5FkHto.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]