From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX65r-0003Or-9s for qemu-devel@nongnu.org; Thu, 25 Sep 2014 06:16:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XX65l-0003es-5i for qemu-devel@nongnu.org; Thu, 25 Sep 2014 06:16:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XX65k-0003e3-OL for qemu-devel@nongnu.org; Thu, 25 Sep 2014 06:16:04 -0400 Date: Thu, 25 Sep 2014 11:15:53 +0100 From: Stefan Hajnoczi Message-ID: <20140925101553.GA19882@stefanha-thinkpad.redhat.com> References: <1411439186-20582-1-git-send-email-famz@redhat.com> <20140924090500.GE21137@stefanha-thinkpad.redhat.com> <20140925014624.GC1990@fam-t430.nay.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20140925014624.GC1990@fam-t430.nay.redhat.com> Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Fail test if explict test case number is unknown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz , qemu-devel@nongnu.org, Wenchao Xia --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 25, 2014 at 09:46:24AM +0800, Fam Zheng wrote: > On Wed, 09/24 10:05, Stefan Hajnoczi wrote: > > On Tue, Sep 23, 2014 at 10:26:26AM +0800, Fam Zheng wrote: > > > diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common > > > index 70df659..2403a20 100644 > > > --- a/tests/qemu-iotests/common > > > +++ b/tests/qemu-iotests/common > > > @@ -382,10 +382,16 @@ BEGIN { for (t=3D'$start'; t<=3D'$end'; = t++) printf "%03d\n",t }' \ > > > echo $id >>$tmp.list > > > else > > > # oops > > > - echo "$id - unknown test, ignored" > > > + if [ "$start" =3D=3D "$end" -a "$id" =3D=3D "$en= d" ] > > > + then > > > + echo "$id - unknown test" > > > + exit 1 > > > + else > > > + echo "$id - unknown test, ignored" > > > + fi > > > fi > > > fi > > > - done > > > + done || exit 1 > >=20 > > What is the purpose of this line? >=20 > The exit inside the loop is in a subshell so won't cause the whole script= to > exit. Thanks for explaining. I see it now, was expecting ( ) but the subshell comes from awk ... | while ... done. Reviewed-by: Stefan Hajnoczi --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUI+tZAAoJEJykq7OBq3PIOEgH/08oxEcM8fw5b/Pl0Q0FTk+Q 7l7GVOgDjU3L4jG/rQvY+P87OrUp25/EDHl+WXSX2f6/wTAeheiksfYxDcdH1S+C BpnssqfQysXaXTIzb2E4Yog5/q09vxMJpF74lYWfYo0PB+eyVpoNc6fcqLhcqr7b zEit1B/lKeauHaFMF2JGtbSnHJTJL13ZYb6nhyLcKP1G1FZ7NaPR6pBLwDL9aSAD p2RZ332I5KX3Dz76zfgsf98UqXBCA+vfXB59JsWisPGsXIqzGfY/o+/nqpGFlYk2 7vcCW7mgvy9ymnY7cI1KfstJETJ12uiJc6umjps++MFdpLaIubfdbLRtIOFA3zQ= =Qxvu -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--