All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: linux-nvdimm@lists.01.org
Cc: Joao Martins <joao.m.martins@oracle.com>
Subject: [PATCH daxctl v2 5/5] daxctl/test: Add a test for daxctl-create with align
Date: Wed, 16 Dec 2020 22:48:33 +0000	[thread overview]
Message-ID: <20201216224833.6229-6-joao.m.martins@oracle.com> (raw)
In-Reply-To: <20201216224833.6229-1-joao.m.martins@oracle.com>

Add a test which uses the newly added --align property
which allows a device created with daxctl create-device
to select its page size. If the available size is bigger
than 1G then use 1G as page size, otherwise use 2M.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
 test/daxctl-create.sh | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/test/daxctl-create.sh b/test/daxctl-create.sh
index 0d35112b4119..5598e5a89aaf 100755
--- a/test/daxctl-create.sh
+++ b/test/daxctl-create.sh
@@ -281,6 +281,34 @@ daxctl_test5()
 	test_pass
 }
 
+# Test 6: align
+# Successfully creates a device with a align property
+daxctl_test6()
+{
+	local daxdev
+	local align
+	local size
+
+	# Available size
+	size=$available
+
+	# Use 2M by default or 1G if supported
+	align=2097152
+	if [[ $((available >= 1073741824 )) ]]; then
+		align=1073741824
+		size=$align
+	fi
+
+	daxdev=$("$DAXCTL" create-device -r 0 -s $size -a $align | jq -er '.[].chardev')
+
+	test -n "$daxdev"
+
+	"$DAXCTL" disable-device "$daxdev" && "$DAXCTL" destroy-device "$daxdev"
+
+	clear_dev
+	test_pass
+}
+
 find_testdev
 rc=1
 setup_dev
@@ -290,5 +318,6 @@ daxctl_test2
 daxctl_test3
 daxctl_test4
 daxctl_test5
+daxctl_test6
 reset_dev
 exit 0
-- 
1.8.3.1
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  parent reply	other threads:[~2020-12-16 22:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 22:48 [PATCH daxctl v2 0/5] daxctl: device align support Joao Martins
2020-12-16 22:48 ` [PATCH daxctl v2 1/5] daxctl: add daxctl_dev_{get,set}_align() Joao Martins
2020-12-16 22:48 ` [PATCH daxctl v2 2/5] util/json: Print device align Joao Martins
2020-12-16 22:48 ` [PATCH daxctl v2 3/5] daxctl: add align support in reconfigure-device Joao Martins
2020-12-16 22:48 ` [PATCH daxctl v2 4/5] daxctl: add align support in create-device Joao Martins
2020-12-16 22:48 ` Joao Martins [this message]
2020-12-17  0:48 ` [PATCH daxctl v2 0/5] daxctl: device align support Verma, Vishal L

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=20201216224833.6229-6-joao.m.martins@oracle.com \
    --to=joao.m.martins@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.