linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH 1/4] test/dax.sh: Fix failure reporting / handling
Date: Sat, 19 Oct 2019 09:39:43 -0700	[thread overview]
Message-ID: <157150318391.3940762.7285126205451065448.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <157150317870.3940762.5638079137146963300.stgit@dwillia2-desk3.amr.corp.intel.com>

Instrument the cleanup() function rather than the err() function to
handle run_test() failures. This ensures umount runs and reports the
line number of the test rather than the line number internal to
run_test().

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/dax.sh |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/dax.sh b/test/dax.sh
index 3bb44ac0a26c..b8eb4ce54e10 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -33,7 +33,7 @@ run_test() {
 	if ! ./dax-pmd $MNT/$FILE; then
 		rc=$?
 		if [ $rc -ne 77 -a $rc -ne 0 ]; then
-			err
+			cleanup $1
 		fi
 	fi
 }
@@ -50,7 +50,7 @@ rc=1
 mkfs.ext4 -b 4096 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 # convert pmem to put the memmap on the device
@@ -62,7 +62,7 @@ eval $(json2var <<< "$json")
 mkfs.ext4 -b 4096 /dev/$blockdev
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 json=$($NDCTL create-namespace -m raw -f -e $dev)
@@ -72,7 +72,7 @@ eval $(json2var <<< "$json")
 mkfs.xfs -f /dev/$blockdev -m reflink=0
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 # convert pmem to put the memmap on the device
@@ -83,7 +83,7 @@ eval $(json2var <<< "$json")
 mkfs.xfs -f /dev/$blockdev -m reflink=0
 mount /dev/$blockdev $MNT -o dax
 fallocate -l 1GiB $MNT/$FILE
-run_test
+run_test $LINENO
 umount $MNT
 
 # revert namespace to raw mode
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply	other threads:[~2019-10-19 16:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19 16:39 [ndctl PATCH 0/4] test/dax.sh: Add huge page fault validation Dan Williams
2019-10-19 16:39 ` Dan Williams [this message]
2019-10-19 16:39 ` [ndctl PATCH 2/4] test/dax.sh: Fix xfs 2M alignment Dan Williams
2019-10-19 16:39 ` [ndctl PATCH 3/4] test/dax.sh: Validate huge page mappings Dan Williams
2019-10-23 19:33   ` Verma, Vishal L
2019-10-23 19:41     ` Verma, Vishal L
2019-10-25 22:44       ` Verma, Vishal L
2019-10-25 23:26         ` Dan Williams
2019-10-19 16:39 ` [ndctl PATCH 4/4] test/dax.sh: Split into ext4 and xfs tests Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157150318391.3940762.7285126205451065448.stgit@dwillia2-desk3.amr.corp.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).