Received: from eggs.gnu.org ([2001:4830:134:3::10]:57907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwlR6-0007CS-Jl for qemu-devel@nongnu.org; Wed, 19 Oct 2016 03:37:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwlR5-0000VI-Op for qemu-devel@nongnu.org; Wed, 19 Oct 2016 03:37:16 -0400 Date: Wed, 19 Oct 2016 09:37:07 +0200 From: Kevin Wolf Message-ID: <20161019073707.GC5336@noname.redhat.com> References: <1476786145-19162-1-git-send-email-kwolf@redhat.com> <1476786145-19162-5-git-send-email-kwolf@redhat.com> <64e87e2e-951c-4b5f-248c-bcfb495f2cca@redhat.com> <0f942da9-d245-a590-dd6b-968a644e805b@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GRPZ8SYKNexpdSJ7" Content-Disposition: inline In-Reply-To: <0f942da9-d245-a590-dd6b-968a644e805b@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 4/4] qemu-iotests: Test creating floppy drives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: John Snow , qemu-block@nongnu.org, mreitz@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com --GRPZ8SYKNexpdSJ7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 18.10.2016 um 21:53 hat Eric Blake geschrieben: > On 10/18/2016 02:45 PM, John Snow wrote: > >=20 > >=20 > > On 10/18/2016 06:22 AM, Kevin Wolf wrote: > >> This tests the different supported methods to create floppy drives and > >> how they interact. > >> >=20 > >> +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=3D"" do_run_qemu "$@" | _filter_win32 | > >> + grep -zo '[[:cntrl:]]\( *\)dev: isa-fdc.*\([[:cntrl:]]\1 > >> .*\)*[[:cntrl:]] *dev:' > >=20 > > 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. Kevin --GRPZ8SYKNexpdSJ7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJYByKjAAoJEH8JsnLIjy/Wqj0P/1/YIQ9+BVDn1zVrLl48Dx0P uFnlpyj1CBFqC4439fKQJSwQWseNlv9612+k0ycNojsFFB9D21pbx4auiRre+i9K nLbzMK4g9hsBT2E8CVgx7UhXFDv5ehIQBopMB7TzbpJc4B7K458iWoZkMqL13QzB veWShbjr9yxdalTz0GJBF8jt4DoD7f6WO/1n5XB+Ble+0XyW6TB3tJewd762SuhA OKs8IklHAMgu6pqllqcRLqGrzyfHF5rFZjJpzkaHETLEveTT46NKbyWqoBGQ3AYM TXpnmWUytw4enwRvwQv5iJJ691AzH4RMymrKzJ3jLHPT/mUSYm1ma1J1ERM5Ve4N yBEoS6eYjF35TcWcRPrEjx6L9xRiGV8SA7hu5EZ2IX/jvfbFhsbwAlXMj+xYkySB xEuwJe1OUfBOsyUlowv2Z/kfEnGLg9kvT3ZMuQCZvYRgnugWJw6FQ90H2e/aTQdb INwfJJ+gr3Km+r5St1dzSJ0EgweeBfhFMfZnPmSTY+iwx3+2kNSSv+bL1B1ErUZF 4LOwx2aPJaok4fAFMAmCijT4Mmqp8Jh9mJSNbRhNi/8i7hdppzp1jcR9Gvwu8EeT 1HbtuF0K6TANHPwcVp4A6EmGzXKbuyYZx5BXfWMyNDgVYyOBoe7EnnaYkjHyVuh9 oCVIIZ5wNA+iST19IS3N =y/gG -----END PGP SIGNATURE----- --GRPZ8SYKNexpdSJ7--