From: Dan Williams <dan.j.williams@intel.com>
To: vishal.l.verma@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: [ndctl PATCH 2/2] test/dax.sh: Split into ext4 and xfs tests
Date: Fri, 25 Oct 2019 18:06:27 -0700 [thread overview]
Message-ID: <157205198738.4128114.5465698718258048294.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <157205197710.4128114.10329643056047769577.stgit@dwillia2-desk3.amr.corp.intel.com>
Given the test can fail based on the fs make it a passed in parameter
and split the tests.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
test/Makefile.am | 3 +-
test/dax-ext4.sh | 1 +
test/dax-xfs.sh | 1 +
test/dax.sh | 101 +++++++++++++++++++++++++++++++-----------------------
4 files changed, 62 insertions(+), 44 deletions(-)
create mode 120000 test/dax-ext4.sh
create mode 120000 test/dax-xfs.sh
diff --git a/test/Makefile.am b/test/Makefile.am
index 84474d080252..829146d5da74 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -46,7 +46,8 @@ TESTS +=\
blk-ns \
pmem-ns \
dax-dev \
- dax.sh \
+ dax-ext4.sh \
+ dax-xfs.sh \
device-dax \
device-dax-fio.sh \
mmap.sh \
diff --git a/test/dax-ext4.sh b/test/dax-ext4.sh
new file mode 120000
index 000000000000..da4ec437a92a
--- /dev/null
+++ b/test/dax-ext4.sh
@@ -0,0 +1 @@
+dax.sh
\ No newline at end of file
diff --git a/test/dax-xfs.sh b/test/dax-xfs.sh
new file mode 120000
index 000000000000..da4ec437a92a
--- /dev/null
+++ b/test/dax-xfs.sh
@@ -0,0 +1 @@
+dax.sh
\ No newline at end of file
diff --git a/test/dax.sh b/test/dax.sh
index 44bc6436a4a9..3933107920a9 100755
--- a/test/dax.sh
+++ b/test/dax.sh
@@ -59,6 +59,56 @@ run_test() {
fi
}
+run_ext4() {
+ mkfs.ext4 -b 4096 /dev/$blockdev
+ mount /dev/$blockdev $MNT -o dax
+ fallocate -l 1GiB $MNT/$FILE
+ run_test $LINENO
+ umount $MNT
+
+ # convert pmem to put the memmap on the device
+ json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
+ eval $(json2var <<< "$json")
+ [ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
+ #note the blockdev returned from ndctl create-namespace lacks the /dev prefix
+
+ mkfs.ext4 -b 4096 /dev/$blockdev
+ mount /dev/$blockdev $MNT -o dax
+ fallocate -l 1GiB $MNT/$FILE
+ run_test $LINENO
+ umount $MNT
+ json=$($NDCTL create-namespace -m raw -f -e $dev)
+
+ eval $(json2var <<< "$json")
+ [ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
+ true
+}
+
+run_xfs() {
+ mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
+ mount /dev/$blockdev $MNT -o dax
+ fallocate -l 1GiB $MNT/$FILE
+ run_test $LINENO
+ umount $MNT
+
+ # convert pmem to put the memmap on the device
+ json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
+ eval $(json2var <<< "$json")
+ [ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
+ mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
+
+ mount /dev/$blockdev $MNT -o dax
+ fallocate -l 1GiB $MNT/$FILE
+ run_test $LINENO
+ umount $MNT
+ # revert namespace to raw mode
+
+ json=$($NDCTL create-namespace -m raw -f -e $dev)
+ eval $(json2var <<< "$json")
+ [ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
+ true
+}
+
set -e
mkdir -p $MNT
trap 'err $LINENO cleanup' ERR
@@ -68,48 +118,13 @@ json=$($NDCTL list -N -n $dev)
eval $(json2var <<< "$json")
rc=1
-mkfs.ext4 -b 4096 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-# convert pmem to put the memmap on the device
-json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
-
-#note the blockdev returned from ndctl create-namespace lacks the /dev prefix
-mkfs.ext4 -b 4096 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-json=$($NDCTL create-namespace -m raw -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
-
-mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-# convert pmem to put the memmap on the device
-json=$($NDCTL create-namespace -m fsdax -M dev -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
-
-mkfs.xfs -f -d su=2m,sw=1,agcount=2 -m reflink=0 /dev/$blockdev
-mount /dev/$blockdev $MNT -o dax
-fallocate -l 1GiB $MNT/$FILE
-run_test $LINENO
-umount $MNT
-
-# revert namespace to raw mode
-json=$($NDCTL create-namespace -m raw -f -e $dev)
-eval $(json2var <<< "$json")
-[ $mode != "fsdax" ] && echo "fail: $LINENO" && exit 1
+if [ $(basename $0) = "dax-ext4.sh" ]; then
+ run_ext4
+elif [ $(basename $0) = "dax-xfs.sh" ]; then
+ run_xfs
+else
+ run_ext4
+ run_xfs
+fi
exit 0
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org
prev parent reply other threads:[~2019-10-26 1:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-26 1:06 [ndctl PATCH 0/2] test/dax.sh: fixup and split by fs Dan Williams
2019-10-26 1:06 ` [ndctl PATCH 1/2] test/dax.sh: Make dax.sh more robust vs small namespaces Dan Williams
2019-10-26 1:06 ` Dan Williams [this message]
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=157205198738.4128114.5465698718258048294.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.org \
--cc=vishal.l.verma@intel.com \
/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).