From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x241.google.com (mail-oi0-x241.google.com [IPv6:2607:f8b0:4003:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0491D20336AD7 for ; Fri, 6 Jul 2018 13:53:00 -0700 (PDT) Received: by mail-oi0-x241.google.com with SMTP id d189-v6so25783627oib.6 for ; Fri, 06 Jul 2018 13:53:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1530909130.7574.41.camel@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> From: Dan Williams Date: Fri, 6 Jul 2018 13:52:59 -0700 Message-ID: Subject: Re: [ndctl PATCH] ndctl, test: Fix dax.sh return code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: "Verma, Vishal L" Cc: "linux-nvdimm@lists.01.org" List-ID: On Fri, Jul 6, 2018 at 1:32 PM, Verma, Vishal L wrote: > > On Fri, 2018-07-06 at 13:30 -0700, Dan Williams wrote: >> On Fri, Jul 6, 2018 at 1:26 PM, Verma, Vishal L >> wrote: >> > >> > On Wed, 2018-07-04 at 14:04 -0700, Dan Williams wrote: >> > > Commit 11b349b5236e "ndctl, test: Disable poison tests for now" >> > > inadvertently prevented the dax.sh test from ever succeeding. >> > > Revert >> > > the >> > > change to return $rc instead of 0. >> > > >> > > Fixes: 11b349b5236e ("ndctl, test: Disable poison tests for now") >> > > Signed-off-by: Dan Williams >> > > --- >> > > test/dax.sh | 2 +- >> > > 1 file changed, 1 insertion(+), 1 deletion(-) >> > > >> > > diff --git a/test/dax.sh b/test/dax.sh >> > > index 30fe16721935..2a82281edb35 100755 >> > > --- a/test/dax.sh >> > > +++ b/test/dax.sh >> > > @@ -90,4 +90,4 @@ json=$($NDCTL create-namespace -m raw -f -e >> > > $dev) >> > > eval $(echo $json | sed -e "$json2var") >> > > [ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1 >> > > >> > > -exit $rc >> > > +exit 0 >> > >> > I'm not sure I understand why this will cause it to always fail. rc >> > is >> > set in run_test, and that takes care of erroring out when the test >> > returns anything other than 0 or 77. In case of 0 or 77, it falls >> > through. So in the end here, we do want 'exit $rc' so we propagate >> > the >> > 77 correctly. Am I missing something? >> >> rc=1 >> >> https://github.com/pmem/ndctl/blob/master/test/dax.sh#L47 > > 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 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm