From patchwork Fri Jul 6 20:52:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10512527 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 18EE1603D7 for ; Fri, 6 Jul 2018 20:53:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05A28287BD for ; Fri, 6 Jul 2018 20:53:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA5F1287CE; Fri, 6 Jul 2018 20:53:05 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID 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 8D36C287BD for ; Fri, 6 Jul 2018 20:53:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 635CD203B99AE; Fri, 6 Jul 2018 13:53:02 -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=2607:f8b0:4003:c06::241; helo=mail-oi0-x241.google.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=G5iIiWCsdOonrD2j6UTUHNcrIbRKfpSqOf0g3YVjBNk=; b=abVKUnLNFGK43Uz3sLDuRsu3g8eSU0NnVmNVPVpvM5zXPvGOQuI55NUhCJqLu8eSMs xxbiJeB6BJMp/Z+Xe4uAMzmFYodAUvHNpI6DmBx9vZS9NhO0NezfOlRvJIm3zBRdAvlS oPpjreYoTUcSPBZRzJ/NSAUzpvbc8wwDdrrIBC8uBMCGgNRzvE8d/rNvQlo6JQJrMsiy xJ9kFgn65enChW1EMjNOgJQTwILNJh0MqQhORDTCAxCb/YPJE3hWgPCKleqkiyNLVM26 LpTg7nYyyjuYpukvZsbJQUTEt//StCkiWQwqUBeJZbl41oOVLkv8pPfpDU2aCq054deq gWAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=G5iIiWCsdOonrD2j6UTUHNcrIbRKfpSqOf0g3YVjBNk=; b=uAnN+UsMbRfj8YUrbbEiBIZCikSe4HPzFf/siOXUL7I7ZXs5uPhQhdOWLcFPb6HV+W QFRV01o3icYmWWyB/Yo26Iq33F4yAOVDdd0gNPjlzmbx4n3x+ZWiiN1F8ckYXHIMeKbs 9pf9ywedPEjm+ZPSNYLjt+86RUJsX/LV7963nq0m8Y2PybgQMnQDHV7Sr0ng1EURk0qi x4LT5kzXSf/I1INVm7oPPME0RSOT7FMzwmZLkwzpKrjH5EJW37AVQJskBQy2BKojfpdd Rx8ZW4qHeV/joso2327f1QIM8AZjEP9IO6765doA60jpvL2VE1hMCd2UMta/sxbBQElC Ep/Q== X-Gm-Message-State: APt69E1FsMnaSWN9zk5mHMSd/hlSNvQPrDTgANpFoJD0gRvWx0cJeZ1V fQeaBNEZkeG087UOu82jx/GhxqbkaXtgCu7NQnZoyQ== X-Google-Smtp-Source: AAOMgpdLac0vMDaH9flnfui0weOew+D4HMb1OEW1fyubXRZTgDQgB00Ksqa4lMFcFnWByBu2CS8XBQVI6KOZN2attOg= X-Received: by 2002:aca:3954:: with SMTP id g81-v6mr13887869oia.215.1530910379677; Fri, 06 Jul 2018 13:52:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:3495:0:0:0:0:0 with HTTP; Fri, 6 Jul 2018 13:52:59 -0700 (PDT) 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 To: "Verma, Vishal L" 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 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