From patchwork Wed Jul 11 18:44:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 10520285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A10AB6032A for ; Wed, 11 Jul 2018 18:44:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9244D28E42 for ; Wed, 11 Jul 2018 18:44:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 869142949A; Wed, 11 Jul 2018 18:44:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3A9DF28E42 for ; Wed, 11 Jul 2018 18:44:25 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BFA8B209605D8; Wed, 11 Jul 2018 11:44:24 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=vishal.l.verma@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E0A1203B99B6 for ; Wed, 11 Jul 2018 11:44:23 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2018 11:44:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,338,1526367600"; d="scan'208";a="56140508" Received: from vverma7-desk1.lm.intel.com (HELO vverma7-desk1.amr.corp.intel.com) ([10.232.112.133]) by orsmga008.jf.intel.com with ESMTP; 11 Jul 2018 11:44:21 -0700 Date: Wed, 11 Jul 2018 12:44:21 -0600 From: Vishal Verma To: Dan Williams Subject: Re: [ndctl PATCH] ndctl, test: Fix dax.sh return code Message-ID: <20180711184231.GA20078@vverma7-desk1.amr.corp.intel.com> References: <153073826178.9647.3462886609135347418.stgit@dwillia2-desk3.amr.corp.intel.com> <1530908758.7574.40.camel@intel.com> <1530909130.7574.41.camel@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-nvdimm@lists.01.org" Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP On 07/06, Dan Williams wrote: > On Fri, Jul 6, 2018 at 1:32 PM, Verma, Vishal L > wrote: > > [..] > > Yes, but that gets overriden by: > > https://github.com/pmem/ndctl/blob/master/test/dax.sh#L33 > > Hmm not sure. I instrumented dax-pmd.c and the shell script to dump > the rc value: > > test_dax_poison: rc: 0 > rc: 1 > FAIL dax.sh (exit status: 1) > > diff --git a/test/dax-poison.c b/test/dax-poison.c > index a25bf0b17d61..3cf2c108ca81 100644 > --- a/test/dax-poison.c > +++ b/test/dax-poison.c > @@ -145,7 +145,9 @@ clear_error: > x = *(volatile unsigned *) addr + align / 2; > rc = 0; > > + fprintf(stderr, "%s: rc: %d\n", __func__, rc); > out: > + fprintf(stderr, "%s: rc: %d\n", __func__, rc); > if (addr != MAP_FAILED) > munmap(addr, 2 * align); > free(buf); > diff --git a/test/dax.sh b/test/dax.sh > index 2a82281edb35..016fea5bb0bf 100755 > --- a/test/dax.sh > +++ b/test/dax.sh > @@ -90,4 +90,5 @@ json=$($NDCTL create-namespace -m raw -f -e $dev) > eval $(echo $json | sed -e "$json2var") > [ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1 > > -exit 0 > +echo "rc: $rc" > +exit $rc I went with the following since the original patch could potentially lose an rc=77 status. 8<---- From 5f6e14c827c068ad892b4451844b4ad2135f2696 Mon Sep 17 00:00:00 2001 From: Vishal Verma Date: Fri, 6 Jul 2018 15:55:43 -0600 Subject: [ndctl PATCH] ndctl, test: Fix dax.sh return code Commit 11b349b5236e "ndctl, test: Disable poison tests for now" inadvertently prevented the dax.sh test from ever succeeding. Make sure the test function actually overrides rc every time instead of only when there is an error so we don't propagate the initial rc=1 all the way to the end. Fixes: 11b349b5236e ("ndctl, test: Disable poison tests for now") Based-on-patch-by: Dan Williams Cc: Dan Williams Signed-off-by: Vishal Verma --- test/dax.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/dax.sh b/test/dax.sh index 30fe167..b63d563 100755 --- a/test/dax.sh +++ b/test/dax.sh @@ -29,6 +29,7 @@ err() { } run_test() { + rc=0 if ! ./dax-pmd $MNT/$FILE; then rc=$? if [ $rc -ne 77 -a $rc -ne 0 ]; then