All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] blktests: new testcases for NVMeOF
@ 2018-08-27 22:55 Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 1/6] blktests: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Hi,

This adds new testcases for Dataset Management, write-zeroes and
smart-log for block device and file backed namespace when NVMeOF
target is configured with loop mode (nvme-loop.ko).

Please note that I'm leaving out "018" for Hannes's ANA realted testcase :-
http://lists.infradead.org/pipermail/linux-nvme/2018-August/019553.html.

Regards,
Chaitanya

Chaitanya Kulkarni (6):
  blktests: add NVMeOF DSM discard test for bdev-ns
  blktests: add NVMeOF DSM discard test for file-ns
  blktests: add NVMeOF write-zeroes test for bdev-ns
  blktests: add NVMeOF write-zeroes test for file-ns
  blktests: add NVMeOF smart-log test for bdev-ns
  blktests: add NVMeOF smart-log test for file-ns

 tests/nvme/019     | 78 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/019.out |  6 ++++
 tests/nvme/020     | 72 ++++++++++++++++++++++++++++++++++++++++
 tests/nvme/020.out |  6 ++++
 tests/nvme/021     | 78 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/021.out |  6 ++++
 tests/nvme/022     | 72 ++++++++++++++++++++++++++++++++++++++++
 tests/nvme/022.out |  6 ++++
 tests/nvme/023     | 82 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/023.out |  5 +++
 tests/nvme/024     | 80 ++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/024.out |  5 +++
 12 files changed, 496 insertions(+)
 create mode 100755 tests/nvme/019
 create mode 100644 tests/nvme/019.out
 create mode 100755 tests/nvme/020
 create mode 100644 tests/nvme/020.out
 create mode 100755 tests/nvme/021
 create mode 100644 tests/nvme/021.out
 create mode 100755 tests/nvme/022
 create mode 100644 tests/nvme/022.out
 create mode 100755 tests/nvme/023
 create mode 100644 tests/nvme/023.out
 create mode 100755 tests/nvme/024
 create mode 100644 tests/nvme/024.out

-- 
2.17.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] blktests: add NVMeOF DSM discard test for bdev-ns
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
@ 2018-08-27 22:55 ` Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 2/6] blktests: add NVMeOF DSM discard test for file-ns Chaitanya Kulkarni
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/019     | 78 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/019.out |  6 ++++
 2 files changed, 84 insertions(+)
 create mode 100755 tests/nvme/019
 create mode 100644 tests/nvme/019.out

diff --git a/tests/nvme/019 b/tests/nvme/019
new file mode 100755
index 0000000..a622765
--- /dev/null
+++ b/tests/nvme/019
@@ -0,0 +1,78 @@
+#!/bin/bash
+# Test NVMe DSM Discard command on NVMeOF with a block-device ns.
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+#   Author: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
+#
+
+. tests/nvme/rc
+
+DESCRIPTION="test NVMe DSM Discard command on NVMeOF block-device ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module loop && \
+		_have_module nvmet && _have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local nvmedev
+	local loop_dev
+	local file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+	local nblk_range="10,10,10,10,10,10,10,10,10,10"
+	local sblk_range="100,200,300,400,500,600,700,800,900,1000"
+
+	truncate -s 1G "${file_path}"
+
+	loop_dev="$(losetup -f --show "${file_path}")"
+
+	_create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme connect -t loop -n "${subsys_name}"
+
+	nvmedev="$(_find_nvme_loop_dev)"
+	cat "/sys/block/${nvmedev}n1/uuid"
+	cat "/sys/block/${nvmedev}n1/wwid"
+
+	nvme dsm "/dev/${nvmedev}" -n 1 -d -s "${sblk_range}" -b "${nblk_range}"
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	losetup -d "${loop_dev}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
diff --git a/tests/nvme/019.out b/tests/nvme/019.out
new file mode 100644
index 0000000..3e649a4
--- /dev/null
+++ b/tests/nvme/019.out
@@ -0,0 +1,6 @@
+Running nvme/019
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVMe DSM: success
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/6] blktests: add NVMeOF DSM discard test for file-ns
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 1/6] blktests: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
@ 2018-08-27 22:55 ` Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 3/6] blktests: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/020     | 72 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/020.out |  6 ++++
 2 files changed, 78 insertions(+)
 create mode 100755 tests/nvme/020
 create mode 100644 tests/nvme/020.out

diff --git a/tests/nvme/020 b/tests/nvme/020
new file mode 100755
index 0000000..03ab500
--- /dev/null
+++ b/tests/nvme/020
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Test NVMe DSM Discard command on NVMeOF with a file-backed ns.
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+#   Author: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
+#
+
+. tests/nvme/rc
+
+DESCRIPTION="test NVMe DSM Discard command on NVMeOF file-backed ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_configfs \
+		_have_module nvmet
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local nvmedev
+	local file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+	local nblk_range="10,10,10,10,10,10,10,10,10,10"
+	local sblk_range="100,200,300,400,500,600,700,800,900,1000"
+
+	truncate -s 1G "${file_path}"
+
+	_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme connect -t loop -n "${subsys_name}"
+
+	nvmedev="$(_find_nvme_loop_dev)"
+	cat "/sys/block/${nvmedev}n1/uuid"
+	cat "/sys/block/${nvmedev}n1/wwid"
+
+	nvme dsm "/dev/${nvmedev}" -n 1 -d -s "${sblk_range}" -b "${nblk_range}"
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+	echo "Test complete"
+}
diff --git a/tests/nvme/020.out b/tests/nvme/020.out
new file mode 100644
index 0000000..113c177
--- /dev/null
+++ b/tests/nvme/020.out
@@ -0,0 +1,6 @@
+Running nvme/020
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVMe DSM: success
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/6] blktests: add NVMeOF write-zeroes test for bdev-ns
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 1/6] blktests: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 2/6] blktests: add NVMeOF DSM discard test for file-ns Chaitanya Kulkarni
@ 2018-08-27 22:55 ` Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 4/6] blktests: add NVMeOF write-zeroes test for file-ns Chaitanya Kulkarni
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/021     | 78 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/021.out |  6 ++++
 2 files changed, 84 insertions(+)
 create mode 100755 tests/nvme/021
 create mode 100644 tests/nvme/021.out

diff --git a/tests/nvme/021 b/tests/nvme/021
new file mode 100755
index 0000000..557ca02
--- /dev/null
+++ b/tests/nvme/021
@@ -0,0 +1,78 @@
+#!/bin/bash
+# Test NVMe write-zeroes command on NVMeOF with a block-device ns.
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+#   Author: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
+#
+
+. tests/nvme/rc
+
+DESCRIPTION="test NVMe write-zeroes command on NVMeOF block-device ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module loop && \
+		_have_module nvmet && _have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local nvmedev
+	local loop_dev
+	local file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+	local sblk=0
+	local nblk=99
+
+	truncate -s 1G "${file_path}"
+
+	loop_dev="$(losetup -f --show "${file_path}")"
+
+	_create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme connect -t loop -n "${subsys_name}"
+
+	nvmedev="$(_find_nvme_loop_dev)"
+	cat "/sys/block/${nvmedev}n1/uuid"
+	cat "/sys/block/${nvmedev}n1/wwid"
+
+	nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	losetup -d "${loop_dev}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
diff --git a/tests/nvme/021.out b/tests/nvme/021.out
new file mode 100644
index 0000000..29939e6
--- /dev/null
+++ b/tests/nvme/021.out
@@ -0,0 +1,6 @@
+Running nvme/021
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVME Write Zeroes Success
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/6] blktests: add NVMeOF write-zeroes test for file-ns
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (2 preceding siblings ...)
  2018-08-27 22:55 ` [PATCH 3/6] blktests: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
@ 2018-08-27 22:55 ` Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 5/6] blktests: add NVMeOF smart-log test for bdev-ns Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/022     | 72 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/022.out |  6 ++++
 2 files changed, 78 insertions(+)
 create mode 100755 tests/nvme/022
 create mode 100644 tests/nvme/022.out

diff --git a/tests/nvme/022 b/tests/nvme/022
new file mode 100755
index 0000000..e11a88f
--- /dev/null
+++ b/tests/nvme/022
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Test NVMe write-zeroes command on NVMeOF with a file-backed ns.
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+#   Author: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
+#
+
+. tests/nvme/rc
+
+DESCRIPTION="test NVMe write-zeroes command on NVMeOF file-backed ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_configfs \
+		_have_module nvmet
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local nvmedev
+	local file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+	local sblk=0
+	local nblk=99
+
+	truncate -s 1G "${file_path}"
+
+	_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme connect -t loop -n "${subsys_name}"
+
+	nvmedev="$(_find_nvme_loop_dev)"
+	cat "/sys/block/${nvmedev}n1/uuid"
+	cat "/sys/block/${nvmedev}n1/wwid"
+
+	nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+	echo "Test complete"
+}
diff --git a/tests/nvme/022.out b/tests/nvme/022.out
new file mode 100644
index 0000000..d2a0606
--- /dev/null
+++ b/tests/nvme/022.out
@@ -0,0 +1,6 @@
+Running nvme/022
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVME Write Zeroes Success
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/6] blktests: add NVMeOF smart-log test for bdev-ns
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (3 preceding siblings ...)
  2018-08-27 22:55 ` [PATCH 4/6] blktests: add NVMeOF write-zeroes test for file-ns Chaitanya Kulkarni
@ 2018-08-27 22:55 ` Chaitanya Kulkarni
  2018-08-27 22:55 ` [PATCH 6/6] blktests: add NVMeOF smart-log test for file-ns Chaitanya Kulkarni
  2018-08-28 23:22 ` [PATCH 0/6] blktests: new testcases for NVMeOF Omar Sandoval
  6 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/023     | 82 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/023.out |  5 +++
 2 files changed, 87 insertions(+)
 create mode 100755 tests/nvme/023
 create mode 100644 tests/nvme/023.out

diff --git a/tests/nvme/023 b/tests/nvme/023
new file mode 100755
index 0000000..b1beb3e
--- /dev/null
+++ b/tests/nvme/023
@@ -0,0 +1,82 @@
+#!/bin/bash
+# Test NVMe smart-log command on NVMeOF with a block-device ns.
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+#   Author: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
+#
+
+. tests/nvme/rc
+
+DESCRIPTION="test NVMe smart-log command on NVMeOF block-device ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module loop && \
+		_have_module nvmet && _have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local nvmedev
+	local loop_dev
+	local file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	truncate -s 1G "${file_path}"
+
+	loop_dev="$(losetup -f --show "${file_path}")"
+
+	_create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme connect -t loop -n "${subsys_name}"
+
+	nvmedev="$(_find_nvme_loop_dev)"
+	cat "/sys/block/${nvmedev}n1/uuid"
+	cat "/sys/block/${nvmedev}n1/wwid"
+
+	nvme smart-log "/dev/${nvmedev}" -n 1 1>&2 > /dev/null
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	losetup -d "${loop_dev}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+
+	if [ $rc -ne 0 ]; then
+		echo "Test Failed"
+	else
+		echo "Test complete"
+	fi
+}
diff --git a/tests/nvme/023.out b/tests/nvme/023.out
new file mode 100644
index 0000000..aeb3ea7
--- /dev/null
+++ b/tests/nvme/023.out
@@ -0,0 +1,5 @@
+Running nvme/023
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/6] blktests: add NVMeOF smart-log test for file-ns
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (4 preceding siblings ...)
  2018-08-27 22:55 ` [PATCH 5/6] blktests: add NVMeOF smart-log test for bdev-ns Chaitanya Kulkarni
@ 2018-08-27 22:55 ` Chaitanya Kulkarni
  2018-08-28 23:22 ` [PATCH 0/6] blktests: new testcases for NVMeOF Omar Sandoval
  6 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-27 22:55 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/024     | 80 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/024.out |  5 +++
 2 files changed, 85 insertions(+)
 create mode 100755 tests/nvme/024
 create mode 100644 tests/nvme/024.out

diff --git a/tests/nvme/024 b/tests/nvme/024
new file mode 100755
index 0000000..f43cbb8
--- /dev/null
+++ b/tests/nvme/024
@@ -0,0 +1,80 @@
+#!/bin/bash
+# Test NVMe smart-log command on NVMeOF with a file-backed ns.
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+#
+#   Author: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
+#
+
+. tests/nvme/rc
+
+DESCRIPTION="test NVMe smart-log command on NVMeOF file-backed ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module loop && \
+		_have_module nvmet && _have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local nvmedev
+	local loop_dev
+	local file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	truncate -s 1G "${file_path}"
+
+	_create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme connect -t loop -n "${subsys_name}"
+
+	nvmedev="$(_find_nvme_loop_dev)"
+	cat "/sys/block/${nvmedev}n1/uuid"
+	cat "/sys/block/${nvmedev}n1/wwid"
+
+	nvme smart-log "/dev/${nvmedev}" -n 1 1>&2 > /dev/null
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	losetup -d "${loop_dev}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+
+	if [ $rc -ne 0 ]; then
+		echo "Test Failed"
+	else
+		echo "Test complete"
+	fi
+}
diff --git a/tests/nvme/024.out b/tests/nvme/024.out
new file mode 100644
index 0000000..737d22f
--- /dev/null
+++ b/tests/nvme/024.out
@@ -0,0 +1,5 @@
+Running nvme/024
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 0/6] blktests: new testcases for NVMeOF
  2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (5 preceding siblings ...)
  2018-08-27 22:55 ` [PATCH 6/6] blktests: add NVMeOF smart-log test for file-ns Chaitanya Kulkarni
@ 2018-08-28 23:22 ` Omar Sandoval
  2018-08-28 23:48   ` Chaitanya Kulkarni
  6 siblings, 1 reply; 9+ messages in thread
From: Omar Sandoval @ 2018-08-28 23:22 UTC (permalink / raw)


On Mon, Aug 27, 2018@03:55:36PM -0700, Chaitanya Kulkarni wrote:
> Hi,
> 
> This adds new testcases for Dataset Management, write-zeroes and
> smart-log for block device and file backed namespace when NVMeOF
> target is configured with loop mode (nvme-loop.ko).
> 
> Please note that I'm leaving out "018" for Hannes's ANA realted testcase :-
> http://lists.infradead.org/pipermail/linux-nvme/2018-August/019553.html.
> 
> Regards,
> Chaitanya

Hi, Chaitanya, thanks for the tests. On v4.19-rc1, I'm getting:

nvme/019 (test NVMe DSM Discard command on NVMeOF block-device ns) [passed]
    runtime  0.730s  ...  0.722s
nvme/020 (test NVMe DSM Discard command on NVMeOF file-backed ns) [passed]
    runtime  0.575s  ...  0.507s
nvme/021 (test NVMe write-zeroes command on NVMeOF block-device ns) [failed]
    runtime  0.657s  ...  0.647s
    --- tests/nvme/021.out      2018-08-28 15:36:47.586392748 -0700
    +++ /home/vmuser/linux/blktests/results/nodev/nvme/021.out.bad      2018-08-28 16:03:25.888026800 -0700
    @@ -1,6 +1,6 @@
     Running nvme/021
     91fdba0d-f87b-4c25-b80f-db7be1418b9e
     uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
    -NVME Write Zeroes Success
    +NVME IO command error:Unknown(400f)
     NQN:blktests-subsystem-1 disconnected 1 controller(s)
     Test complete
nvme/022 (test NVMe write-zeroes command on NVMeOF file-backed ns) [passed]
    runtime  0.539s  ...  0.519s
nvme/023 (test NVMe smart-log command on NVMeOF block-device ns) [passed]
    runtime  0.794s  ...  0.744s
nvme/024 (test NVMe smart-log command on NVMeOF file-backed ns) [failed]
    runtime  0.428s  ...  0.438s
    --- tests/nvme/024.out      2018-08-28 15:36:47.586392748 -0700
    +++ /home/vmuser/linux/blktests/results/nodev/nvme/024.out.bad      2018-08-28 16:03:28.028041782 -0700
    @@ -1,5 +1,8 @@
     Running nvme/024
    -91fdba0d-f87b-4c25-b80f-db7be1418b9e
    -uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
    +tests/nvme/rc: line 76: printf: write error: Invalid argument
    +cat: /sys/block/nvme1n1/uuid: No such file or directory
    +cat: /sys/block/nvme1n1/wwid: No such file or directory
    +NVMe Status:INVALID_NS(b)
    ...
    (Run 'diff -u tests/nvme/024.out /home/vmuser/linux/blktests/results/nodev/nvme/024.out.bad' to see the entire diff)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 0/6] blktests: new testcases for NVMeOF
  2018-08-28 23:22 ` [PATCH 0/6] blktests: new testcases for NVMeOF Omar Sandoval
@ 2018-08-28 23:48   ` Chaitanya Kulkarni
  0 siblings, 0 replies; 9+ messages in thread
From: Chaitanya Kulkarni @ 2018-08-28 23:48 UTC (permalink / raw)


Thanks for the quick response, let me retest this along with future comments and send out the V2.



From: Omar Sandoval <osandov@osandov.com>
Sent: Tuesday, August 28, 2018 4:22 PM
To: Chaitanya Kulkarni
Cc: linux-nvme at lists.infradead.org; osandov at fb.com
Subject: Re: [PATCH 0/6] blktests: new testcases for NVMeOF
? 
 
On Mon, Aug 27, 2018@03:55:36PM -0700, Chaitanya Kulkarni wrote:
> Hi,
> 
> This adds new testcases for Dataset Management, write-zeroes and
> smart-log for block device and file backed namespace when NVMeOF
> target is configured with loop mode (nvme-loop.ko).
> 
> Please note that I'm leaving out "018" for Hannes's ANA realted testcase :-
>  http://lists.infradead.org/pipermail/linux-nvme/2018-August/019553.html.
> 
> Regards,
> Chaitanya

Hi, Chaitanya, thanks for the tests. On v4.19-rc1, I'm getting:

nvme/019 (test NVMe DSM Discard command on NVMeOF block-device ns) [passed]
??? runtime? 0.730s? ...? 0.722s
nvme/020 (test NVMe DSM Discard command on NVMeOF file-backed ns) [passed]
??? runtime? 0.575s? ...? 0.507s
nvme/021 (test NVMe write-zeroes command on NVMeOF block-device ns) [failed]
??? runtime? 0.657s? ...? 0.647s
??? --- tests/nvme/021.out????? 2018-08-28 15:36:47.586392748 -0700
??? +++ /home/vmuser/linux/blktests/results/nodev/nvme/021.out.bad????? 2018-08-28 16:03:25.888026800 -0700
??? @@ -1,6 +1,6 @@
???? Running nvme/021
???? 91fdba0d-f87b-4c25-b80f-db7be1418b9e
???? uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
??? -NVME Write Zeroes Success
??? +NVME IO command error:Unknown(400f)
???? NQN:blktests-subsystem-1 disconnected 1 controller(s)
???? Test complete
nvme/022 (test NVMe write-zeroes command on NVMeOF file-backed ns) [passed]
??? runtime? 0.539s? ...? 0.519s
nvme/023 (test NVMe smart-log command on NVMeOF block-device ns) [passed]
??? runtime? 0.794s? ...? 0.744s
nvme/024 (test NVMe smart-log command on NVMeOF file-backed ns) [failed]
??? runtime? 0.428s? ...? 0.438s
??? --- tests/nvme/024.out????? 2018-08-28 15:36:47.586392748 -0700
??? +++ /home/vmuser/linux/blktests/results/nodev/nvme/024.out.bad????? 2018-08-28 16:03:28.028041782 -0700
??? @@ -1,5 +1,8 @@
???? Running nvme/024
??? -91fdba0d-f87b-4c25-b80f-db7be1418b9e
??? -uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
??? +tests/nvme/rc: line 76: printf: write error: Invalid argument
??? +cat: /sys/block/nvme1n1/uuid: No such file or directory
??? +cat: /sys/block/nvme1n1/wwid: No such file or directory
??? +NVMe Status:INVALID_NS(b)
??? ...
??? (Run 'diff -u tests/nvme/024.out /home/vmuser/linux/blktests/results/nodev/nvme/024.out.bad' to see the entire diff)
    

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-08-28 23:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 22:55 [PATCH 0/6] blktests: new testcases for NVMeOF Chaitanya Kulkarni
2018-08-27 22:55 ` [PATCH 1/6] blktests: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
2018-08-27 22:55 ` [PATCH 2/6] blktests: add NVMeOF DSM discard test for file-ns Chaitanya Kulkarni
2018-08-27 22:55 ` [PATCH 3/6] blktests: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
2018-08-27 22:55 ` [PATCH 4/6] blktests: add NVMeOF write-zeroes test for file-ns Chaitanya Kulkarni
2018-08-27 22:55 ` [PATCH 5/6] blktests: add NVMeOF smart-log test for bdev-ns Chaitanya Kulkarni
2018-08-27 22:55 ` [PATCH 6/6] blktests: add NVMeOF smart-log test for file-ns Chaitanya Kulkarni
2018-08-28 23:22 ` [PATCH 0/6] blktests: new testcases for NVMeOF Omar Sandoval
2018-08-28 23:48   ` Chaitanya Kulkarni

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.