From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGXmT-0004P7-GE for qemu-devel@nongnu.org; Thu, 20 Feb 2014 12:51:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGXmM-0001fu-Pb for qemu-devel@nongnu.org; Thu, 20 Feb 2014 12:51:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGXmM-0001fT-Hb for qemu-devel@nongnu.org; Thu, 20 Feb 2014 12:51:22 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1KHpL2w014051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 20 Feb 2014 12:51:21 -0500 Message-ID: <53064098.3010804@redhat.com> Date: Thu, 20 Feb 2014 10:51:20 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392908243-8835-1-git-send-email-kwolf@redhat.com> <1392908243-8835-7-git-send-email-kwolf@redhat.com> In-Reply-To: <1392908243-8835-7-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cGISLRb7mRHLXf3W19sCr4l4Jlx6KVeuL" Subject: Re: [Qemu-devel] [PATCH v2 6/6] qemu-iotests: Check qemu-img command line parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: famz@redhat.com, armbru@redhat.com, stefanha@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cGISLRb7mRHLXf3W19sCr4l4Jlx6KVeuL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/20/2014 07:57 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/082 | 187 +++++++++++++++++++ > tests/qemu-iotests/082.out | 436 +++++++++++++++++++++++++++++++++++++= ++++++++ > tests/qemu-iotests/group | 1 + > 3 files changed, 624 insertions(+) > create mode 100755 tests/qemu-iotests/082 > create mode 100644 tests/qemu-iotests/082.out >=20 > + > +seq=3D`basename $0` [rambling side note - I ought to submit a patch that updates all this copy-and-pasted boilerplate to use $() instead of ``] > +echo =3D=3D=3D create: Options specified more than once =3D=3D=3D > + > +# Last -f should win > +run_qemu_img create -f foo -f $IMGFMT $TEST_IMG $size > +run_qemu_img info $TEST_IMG > + > +# Multiple -o should be merged > +run_qemu_img create -f $IMGFMT -o cluster_size=3D4k -o lazy_refcounts=3D= on $TEST_IMG $size > +run_qemu_img info $TEST_IMG If we later fix my corner case of trailing ',', don't forget to also add a test for the new behavior :) > + > +# Adding the help option to the same -o option > +run_qemu_img create -f $IMGFMT -o cluster_size=3D4k,help $TEST_IMG $si= ze > +run_qemu_img create -f $IMGFMT -o cluster_size=3D4k,\? $TEST_IMG $size= You should probably also test -o help,cluster_size=3D4k. > + > +# Adding the help option to a separate -o option > +run_qemu_img create -f $IMGFMT -o cluster_size=3D4k -o help $TEST_IMG = $size > +run_qemu_img create -f $IMGFMT -o cluster_size=3D4k -o \? $TEST_IMG $s= ize > + > +# Looks like a help option, but is part of the backing file name > +run_qemu_img create -f $IMGFMT -o backing_file=3D$TEST_IMG,,help $TEST= _IMG $size > +run_qemu_img create -f $IMGFMT -o backing_file=3D$TEST_IMG,,\? $TEST_I= MG $size Or, per my corner case: -o backing_file=3D$TESET_IMG, -o help is currently perversely part of the file name. Even with my suggestions for further tests and improvements, this is strictly better than what we previously had, so: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cGISLRb7mRHLXf3W19sCr4l4Jlx6KVeuL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTBkCYAAoJEKeha0olJ0Nqx1sIAKKbfHAi6rwhPyQYCw/NBgO+ V1mmV2ncxf6gTxOHgLCEFFK5fc2iTK98QmB9EPpRioWjugK1bya0R24tDXtw1qN6 SgfYQAoKsqkjRnKutRNPxTrWikJYSFzXP31/5Q6DFGM7vJfcJaWGHztwBLOXF+vt TsFbM3JPJp3mMrOWyo+ksXEvEg+NJfCeEh6OWm8r9d11+bFA/qDZw9gY5mvAdnap rk/jqBQ1/6SGyZqxwvvneFrwqc/N/sq0FSfE8p+4q4NxibcEKc6i1IjSnjLfkiNw Z2oJEgnQ8Jqkjps/A8Xo+uDY1BGTADPQy99Qu4oi9J/6mHFDayjbhgpsr/9l17M= =sRzD -----END PGP SIGNATURE----- --cGISLRb7mRHLXf3W19sCr4l4Jlx6KVeuL--