[{"id":1761907,"web_url":"http://patchwork.ozlabs.org/comment/1761907/","msgid":"<dc1cf740-09d8-edfd-c953-e559395363cd@redhat.com>","list_archive_url":null,"date":"2017-09-01T18:35:12","subject":"Re: [Qemu-devel] [PATCH v3 3/3] docker: Add test-block","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 09/01/2017 10:22 AM, Fam Zheng wrote:\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>  tests/docker/test-block | 22 ++++++++++++++++++++++\n>  1 file changed, 22 insertions(+)\n>  create mode 100755 tests/docker/test-block\n> \n> diff --git a/tests/docker/test-block b/tests/docker/test-block\n> new file mode 100755\n> index 0000000000..efc77b4b91\n> --- /dev/null\n> +++ b/tests/docker/test-block\n> @@ -0,0 +1,22 @@\n> +#!/bin/bash -e\n\n'set -e' is awful; it exists for backwards-compatibility with shell\nscripts that pre-date functions, but is NOT intuitive and generally does\nNOT do what you want when shell functions are added to the mix.  You're\nbetter off doing manual error checking than relying on 'set -e' to check\nfor errors on your behalf.\n\n> +#\n> +# Run block test cases\n> +#\n> +# Copyright (c) 2017 Red Hat Inc.\n> +#\n> +# Authors:\n> +#  Fam Zheng <famz@redhat.com>\n> +#\n> +# This work is licensed under the terms of the GNU GPL, version 2\n> +# or (at your option) any later version. See the COPYING file in\n> +# the top-level directory.\n> +\n> +. common.rc\n\nAre we sure that '.' is early enough on $PATH that this will pick up the\nright common.rc? Safer is '. ./common.rc'.\n\n> +\n> +cd \"$BUILD_DIR\"\n> +\n> +build_qemu --target-list=x86_64-softmmu\n> +cd tests/qemu-iotests\n> +for t in raw qcow2 nbd luks; do\n> +    ./check -g quick -$t\n> +done\n\nThat said, this script (and common.rc) is small enough to verify that\nyou probably aren't going to trip over those non-intuitive 'set -e'\nbehaviors, so the real reason to avoid it is if we want to be able to\ncopy-and-paste into other scripts that aren't using 'set -e' (on the\npremise that avoiding implicit global state, like 'set -e', and being\nexplicit instead, is a good thing).","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkScB0Cwhz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 04:35:49 +1000 (AEST)","from localhost ([::1]:54515 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dnqnB-0002Bm-D8\n\tfor incoming@patchwork.ozlabs.org; Fri, 01 Sep 2017 14:35:45 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:44794)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dnqmm-00028r-KD\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 14:35:25 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dnqmj-0007Rh-Gt\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 14:35:20 -0400","from mx1.redhat.com ([209.132.183.28]:48304)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>) id 1dnqmj-0007RB-86\n\tfor qemu-devel@nongnu.org; Fri, 01 Sep 2017 14:35:17 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id EC8A7C04B93A;\n\tFri,  1 Sep 2017 18:35:15 +0000 (UTC)","from [10.10.121.149] (ovpn-121-149.rdu2.redhat.com [10.10.121.149])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 0C7A1600CD;\n\tFri,  1 Sep 2017 18:35:12 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com EC8A7C04B93A","To":"Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org","References":"<20170901152200.5953-1-famz@redhat.com>\n\t<20170901152200.5953-4-famz@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<dc1cf740-09d8-edfd-c953-e559395363cd@redhat.com>","Date":"Fri, 1 Sep 2017 13:35:12 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170901152200.5953-4-famz@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"EiNgTbJdAHftqc9XEQ1mVfh823UCKsFn3\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tFri, 01 Sep 2017 18:35:16 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v3 3/3] docker: Add test-block","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"=?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n\t=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tkchamart@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1762918,"web_url":"http://patchwork.ozlabs.org/comment/1762918/","msgid":"<20170905023031.GD22515@lemon.lan>","list_archive_url":null,"date":"2017-09-05T02:30:31","subject":"Re: [Qemu-devel] [PATCH v3 3/3] docker: Add test-block","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/01 13:35, Eric Blake wrote:\n> On 09/01/2017 10:22 AM, Fam Zheng wrote:\n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >  tests/docker/test-block | 22 ++++++++++++++++++++++\n> >  1 file changed, 22 insertions(+)\n> >  create mode 100755 tests/docker/test-block\n> > \n> > diff --git a/tests/docker/test-block b/tests/docker/test-block\n> > new file mode 100755\n> > index 0000000000..efc77b4b91\n> > --- /dev/null\n> > +++ b/tests/docker/test-block\n> > @@ -0,0 +1,22 @@\n> > +#!/bin/bash -e\n> \n> 'set -e' is awful; it exists for backwards-compatibility with shell\n> scripts that pre-date functions, but is NOT intuitive and generally does\n> NOT do what you want when shell functions are added to the mix.  You're\n> better off doing manual error checking than relying on 'set -e' to check\n> for errors on your behalf.\n> \n> > +#\n> > +# Run block test cases\n> > +#\n> > +# Copyright (c) 2017 Red Hat Inc.\n> > +#\n> > +# Authors:\n> > +#  Fam Zheng <famz@redhat.com>\n> > +#\n> > +# This work is licensed under the terms of the GNU GPL, version 2\n> > +# or (at your option) any later version. See the COPYING file in\n> > +# the top-level directory.\n> > +\n> > +. common.rc\n> \n> Are we sure that '.' is early enough on $PATH that this will pick up the\n> right common.rc? Safer is '. ./common.rc'.\n> \n> > +\n> > +cd \"$BUILD_DIR\"\n> > +\n> > +build_qemu --target-list=x86_64-softmmu\n> > +cd tests/qemu-iotests\n> > +for t in raw qcow2 nbd luks; do\n> > +    ./check -g quick -$t\n> > +done\n> \n> That said, this script (and common.rc) is small enough to verify that\n> you probably aren't going to trip over those non-intuitive 'set -e'\n> behaviors, so the real reason to avoid it is if we want to be able to\n> copy-and-paste into other scripts that aren't using 'set -e' (on the\n> premise that avoiding implicit global state, like 'set -e', and being\n> explicit instead, is a good thing).\n\nOK, I will revise this patch and drop set -e.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmW172F6Xz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 12:31:05 +1000 (AEST)","from localhost ([::1]:56475 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dp3dm-0006Eg-TD\n\tfor incoming@patchwork.ozlabs.org; Mon, 04 Sep 2017 22:31:02 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42972)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dp3dQ-0006ER-M6\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 22:30:45 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dp3dL-00042V-H8\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 22:30:40 -0400","from mx1.redhat.com ([209.132.183.28]:42634)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dp3dL-00041w-4l\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 22:30:35 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id ECFD7A04E7;\n\tTue,  5 Sep 2017 02:30:33 +0000 (UTC)","from localhost (ovpn-12-97.pek2.redhat.com [10.72.12.97])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 350977E670;\n\tTue,  5 Sep 2017 02:30:32 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com ECFD7A04E7","Date":"Tue, 5 Sep 2017 10:30:31 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Eric Blake <eblake@redhat.com>","Message-ID":"<20170905023031.GD22515@lemon.lan>","References":"<20170901152200.5953-1-famz@redhat.com>\n\t<20170901152200.5953-4-famz@redhat.com>\n\t<dc1cf740-09d8-edfd-c953-e559395363cd@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<dc1cf740-09d8-edfd-c953-e559395363cd@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tTue, 05 Sep 2017 02:30:34 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v3 3/3] docker: Add test-block","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kchamart@redhat.com, Alex =?iso-8859-1?q?Benn=E9e?=\n\t<alex.bennee@linaro.org>, \tqemu-devel@nongnu.org, Philippe\n\t=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]