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.willi...@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-le...@lists.01.org

Reply via email to