@@ -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
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(+)