All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF
@ 2018-09-04 19:32 Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 01/12] nvme: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 UTC (permalink / raw)


Hi,

This adds Dataset Management, write-zeroes, smart-log and several
small command specitic new testcases 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

Changes since V1:-

1. Addition of new testcases.
2. Test the code on 4.19.0-rc2.
# git log -12 --oneline
bcdac08 (HEAD -> master) nvme: add NVMeOF reset test for file-ns
4455a3a nvme: add NVMeOF list test for file-ns
0cb2c82 nvme: add NVMeOF list-subsys test for file-ns
249883d nvme: add NVMeOF ns-rescan test for file-ns
c8f1876 nvme: add NVMeOF ns-desc test for file-ns
5972074 nvme: add NVMeOF effects-log test for file-ns
d5b2ef4 nvme: add NVMeOF smart-log test for file-ns
5bd0bee nvme: add NVMeOF smart-log test for bdev-ns
c749e08 nvme: add NVMeOF write-zeroes test for file-ns
3ef94d3 nvme: add NVMeOF write-zeroes test for bdev-ns
140833b nvme: add NVMeOF DSM discard test for file-ns
cb52922 nvme: add NVMeOF DSM discard test for bdev-ns

nvme/019 (test NVMe DSM Discard command on NVMeOF block-device ns) [passed]
    runtime  0.818s  ...  0.832s
nvme/020 (test NVMe DSM Discard command on NVMeOF file-backed ns) [passed]
    runtime  0.767s  ...  0.766s
nvme/021 (test NVMe write-zeroes command on NVMeOF block-device ns) [passed]
    runtime  0.819s  ...  0.819s
nvme/022 (test NVMe write-zeroes command on NVMeOF file-backed ns) [passed]
    runtime  0.782s  ...  0.770s
nvme/023 (test NVMe smart-log command on NVMeOF block-device ns) [passed]
    runtime  0.815s  ...  0.823s
nvme/024 (test NVMe smart-log command on NVMeOF file-backed ns) [passed]
    runtime  0.776s  ...  0.773s
nvme/025 (test NVMe effects-log command on NVMeOF file-backed ns) [passed]
    runtime  0.783s  ...  0.753s
nvme/026 (test NVMe ns-descs command on NVMeOF file-backed ns) [passed]
    runtime  0.774s  ...  0.766s
nvme/027 (test NVMe ns-rescan command on NVMeOF file-backed ns) [passed]
    runtime  0.783s  ...  0.784s
nvme/028 (test NVMe list-subsys command on NVMeOF file-backed ns) [passed]
    runtime  0.772s  ...  0.775s
nvme/029 (test NVMe list command on NVMeOF file-backed ns)   [passed]
    runtime  0.768s  ...  0.760s
nvme/030 (test NVMe reset command on NVMeOF file-backed ns)  [passed]
    runtime  1.026s  ...  1.003s

Chaitanya Kulkarni (12):
  nvme: add NVMeOF DSM discard test for bdev-ns
  nvme: add NVMeOF DSM discard test for file-ns
  nvme: add NVMeOF write-zeroes test for bdev-ns
  nvme: add NVMeOF write-zeroes test for file-ns
  nvme: add NVMeOF smart-log test for bdev-ns
  nvme: add NVMeOF smart-log test for file-ns
  nvme: add NVMeOF effects-log test for file-ns
  nvme: add NVMeOF ns-desc test for file-ns
  nvme: add NVMeOF ns-rescan test for file-ns
  nvme: add NVMeOF list-subsys test for file-ns
  nvme: add NVMeOF list test for file-ns
  nvme: add NVMeOF reset 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     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/024.out |  5 +++
 tests/nvme/025     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/025.out |  5 +++
 tests/nvme/026     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/026.out |  5 +++
 tests/nvme/027     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/027.out |  5 +++
 tests/nvme/028     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/028.out |  5 +++
 tests/nvme/029     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/029.out |  5 +++
 tests/nvme/030     | 77 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/030.out |  5 +++
 24 files changed, 985 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
 create mode 100755 tests/nvme/025
 create mode 100644 tests/nvme/025.out
 create mode 100755 tests/nvme/026
 create mode 100644 tests/nvme/026.out
 create mode 100755 tests/nvme/027
 create mode 100644 tests/nvme/027.out
 create mode 100755 tests/nvme/028
 create mode 100644 tests/nvme/028.out
 create mode 100755 tests/nvme/029
 create mode 100644 tests/nvme/029.out
 create mode 100755 tests/nvme/030
 create mode 100644 tests/nvme/030.out

-- 
2.17.0

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

* [PATCH V2 blktests 01/12] nvme: add NVMeOF DSM discard test for bdev-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 02/12] nvme: add NVMeOF DSM discard test for file-ns Chaitanya Kulkarni
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 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..b180369
--- /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 -f "${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] 15+ messages in thread

* [PATCH V2 blktests 02/12] nvme: add NVMeOF DSM discard test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 01/12] nvme: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 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..fcf68df
--- /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 -f "${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] 15+ messages in thread

* [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 01/12] nvme: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 02/12] nvme: add NVMeOF DSM discard test for file-ns Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-12 22:37   ` Omar Sandoval
  2018-09-04 19:32 ` [PATCH V2 blktests 04/12] nvme: add NVMeOF write-zeroes test for file-ns Chaitanya Kulkarni
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 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..efcbb3f
--- /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 -f "${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] 15+ messages in thread

* [PATCH V2 blktests 04/12] nvme: add NVMeOF write-zeroes test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (2 preceding siblings ...)
  2018-09-04 19:32 ` [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 05/12] nvme: add NVMeOF smart-log test for bdev-ns Chaitanya Kulkarni
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 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..952f140
--- /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 -f "${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] 15+ messages in thread

* [PATCH V2 blktests 05/12] nvme: add NVMeOF smart-log test for bdev-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (3 preceding siblings ...)
  2018-09-04 19:32 ` [PATCH V2 blktests 04/12] nvme: add NVMeOF write-zeroes test for file-ns Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 06/12] nvme: add NVMeOF smart-log test for file-ns Chaitanya Kulkarni
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 UTC (permalink / raw)


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..5d2b36b
--- /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 > /dev/null 2>&1
+
+	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 -f "${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] 15+ messages in thread

* [PATCH V2 blktests 06/12] nvme: add NVMeOF smart-log test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (4 preceding siblings ...)
  2018-09-04 19:32 ` [PATCH V2 blktests 05/12] nvme: add NVMeOF smart-log test for bdev-ns Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-04 19:32 ` [PATCH V2 blktests 07/12] nvme: add NVMeOF effects-log " Chaitanya Kulkarni
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 UTC (permalink / raw)


Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/024     | 77 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/024.out |  5 +++
 2 files changed, 82 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..49a4eb9
--- /dev/null
+++ b/tests/nvme/024
@@ -0,0 +1,77 @@
+#!/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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 smart-log "/dev/${nvmedev}" -n 1 > /dev/null 2>&1
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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] 15+ messages in thread

* [PATCH V2 blktests 07/12] nvme: add NVMeOF effects-log test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (5 preceding siblings ...)
  2018-09-04 19:32 ` [PATCH V2 blktests 06/12] nvme: add NVMeOF smart-log test for file-ns Chaitanya Kulkarni
@ 2018-09-04 19:32 ` Chaitanya Kulkarni
  2018-09-04 19:33 ` [PATCH V2 blktests 08/12] nvme: add NVMeOF ns-desc " Chaitanya Kulkarni
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:32 UTC (permalink / raw)


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

diff --git a/tests/nvme/025 b/tests/nvme/025
new file mode 100755
index 0000000..b12a5f5
--- /dev/null
+++ b/tests/nvme/025
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Test NVMe effects-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 effects-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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 effects-log "/dev/${nvmedev}" > /dev/null 2>&1
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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/025.out b/tests/nvme/025.out
new file mode 100644
index 0000000..b700bc7
--- /dev/null
+++ b/tests/nvme/025.out
@@ -0,0 +1,5 @@
+Running nvme/025
+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] 15+ messages in thread

* [PATCH V2 blktests 08/12] nvme: add NVMeOF ns-desc test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (6 preceding siblings ...)
  2018-09-04 19:32 ` [PATCH V2 blktests 07/12] nvme: add NVMeOF effects-log " Chaitanya Kulkarni
@ 2018-09-04 19:33 ` Chaitanya Kulkarni
  2018-09-04 19:33 ` [PATCH V2 blktests 09/12] nvme: add NVMeOF ns-rescan " Chaitanya Kulkarni
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:33 UTC (permalink / raw)


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

diff --git a/tests/nvme/026 b/tests/nvme/026
new file mode 100755
index 0000000..38ef38a
--- /dev/null
+++ b/tests/nvme/026
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Test NVMe ns-descs 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 ns-descs 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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 ns-descs "/dev/${nvmedev}" -n 1 > /dev/null 2>&1
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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/026.out b/tests/nvme/026.out
new file mode 100644
index 0000000..dcee481
--- /dev/null
+++ b/tests/nvme/026.out
@@ -0,0 +1,5 @@
+Running nvme/026
+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] 15+ messages in thread

* [PATCH V2 blktests 09/12] nvme: add NVMeOF ns-rescan test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (7 preceding siblings ...)
  2018-09-04 19:33 ` [PATCH V2 blktests 08/12] nvme: add NVMeOF ns-desc " Chaitanya Kulkarni
@ 2018-09-04 19:33 ` Chaitanya Kulkarni
  2018-09-04 19:33 ` [PATCH V2 blktests 10/12] nvme: add NVMeOF list-subsys " Chaitanya Kulkarni
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:33 UTC (permalink / raw)


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

diff --git a/tests/nvme/027 b/tests/nvme/027
new file mode 100755
index 0000000..8711f48
--- /dev/null
+++ b/tests/nvme/027
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Test NVMe ns-rescan 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 ns-rescan 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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 ns-rescan "/dev/${nvmedev}" > /dev/null 2>&1
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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/027.out b/tests/nvme/027.out
new file mode 100644
index 0000000..f114fcd
--- /dev/null
+++ b/tests/nvme/027.out
@@ -0,0 +1,5 @@
+Running nvme/027
+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] 15+ messages in thread

* [PATCH V2 blktests 10/12] nvme: add NVMeOF list-subsys test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (8 preceding siblings ...)
  2018-09-04 19:33 ` [PATCH V2 blktests 09/12] nvme: add NVMeOF ns-rescan " Chaitanya Kulkarni
@ 2018-09-04 19:33 ` Chaitanya Kulkarni
  2018-09-04 19:33 ` [PATCH V2 blktests 11/12] nvme: add NVMeOF list " Chaitanya Kulkarni
  2018-09-04 19:33 ` [PATCH V2 blktests 12/12] nvme: add NVMeOF reset " Chaitanya Kulkarni
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:33 UTC (permalink / raw)


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

diff --git a/tests/nvme/028 b/tests/nvme/028
new file mode 100755
index 0000000..5b46794
--- /dev/null
+++ b/tests/nvme/028
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Test NVMe list-subsys 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 list-subsys 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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 list-subsys | grep -q loop
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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/028.out b/tests/nvme/028.out
new file mode 100644
index 0000000..c92b82d
--- /dev/null
+++ b/tests/nvme/028.out
@@ -0,0 +1,5 @@
+Running nvme/028
+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] 15+ messages in thread

* [PATCH V2 blktests 11/12] nvme: add NVMeOF list test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (9 preceding siblings ...)
  2018-09-04 19:33 ` [PATCH V2 blktests 10/12] nvme: add NVMeOF list-subsys " Chaitanya Kulkarni
@ 2018-09-04 19:33 ` Chaitanya Kulkarni
  2018-09-04 19:33 ` [PATCH V2 blktests 12/12] nvme: add NVMeOF reset " Chaitanya Kulkarni
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:33 UTC (permalink / raw)


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

diff --git a/tests/nvme/029 b/tests/nvme/029
new file mode 100755
index 0000000..9375c3d
--- /dev/null
+++ b/tests/nvme/029
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Test NVMe list 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 list 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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 list > /dev/null 2>&1
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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/029.out b/tests/nvme/029.out
new file mode 100644
index 0000000..98d7dec
--- /dev/null
+++ b/tests/nvme/029.out
@@ -0,0 +1,5 @@
+Running nvme/029
+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] 15+ messages in thread

* [PATCH V2 blktests 12/12] nvme: add NVMeOF reset test for file-ns
  2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
                   ` (10 preceding siblings ...)
  2018-09-04 19:33 ` [PATCH V2 blktests 11/12] nvme: add NVMeOF list " Chaitanya Kulkarni
@ 2018-09-04 19:33 ` Chaitanya Kulkarni
  11 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-04 19:33 UTC (permalink / raw)


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

diff --git a/tests/nvme/030 b/tests/nvme/030
new file mode 100755
index 0000000..a723aa9
--- /dev/null
+++ b/tests/nvme/030
@@ -0,0 +1,77 @@
+#!/bin/bash
+# Test NVMe reset 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 reset 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 file_path="$TMPDIR/img"
+	local subsys_name="blktests-subsystem-1"
+
+	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 reset "/dev/${nvmedev}" > /dev/null 2>&1
+
+	rc=$?
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f "${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/030.out b/tests/nvme/030.out
new file mode 100644
index 0000000..0fc1b3d
--- /dev/null
+++ b/tests/nvme/030.out
@@ -0,0 +1,5 @@
+Running nvme/030
+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] 15+ messages in thread

* [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns
  2018-09-04 19:32 ` [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
@ 2018-09-12 22:37   ` Omar Sandoval
  2018-09-12 23:53     ` Chaitanya Kulkarni
  0 siblings, 1 reply; 15+ messages in thread
From: Omar Sandoval @ 2018-09-12 22:37 UTC (permalink / raw)


On Tue, Sep 04, 2018@12:32:55PM -0700, Chaitanya Kulkarni wrote:
> 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


This test is still failing for me sometimes. If I apply the following
patch:

diff --git a/tests/nvme/021 b/tests/nvme/021
index efcbb3f..137e89e 100755
--- a/tests/nvme/021
+++ b/tests/nvme/021
@@ -59,6 +59,10 @@ test() {
 	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 write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
+	nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
+	nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
 	nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
 
 	nvme disconnect -n "${subsys_name}"
diff --git a/tests/nvme/021.out b/tests/nvme/021.out
index 29939e6..658be05 100644
--- a/tests/nvme/021.out
+++ b/tests/nvme/021.out
@@ -2,5 +2,9 @@ Running nvme/021
 91fdba0d-f87b-4c25-b80f-db7be1418b9e
 uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
 NVME Write Zeroes Success
+NVME Write Zeroes Success
+NVME Write Zeroes Success
+NVME Write Zeroes Success
+NVME Write Zeroes Success
 NQN:blktests-subsystem-1 disconnected 1 controller(s)
 Test complete

Then some of the commands pass and some fail:

--- tests/nvme/021.out	2018-09-12 14:41:29.563976539 -0700
+++ /home/vmuser/linux/blktests/results/nodev/nvme/021.out.bad	2018-09-12 15:30:43.037900569 -0700
@@ -1,10 +1,10 @@
 Running nvme/021
 91fdba0d-f87b-4c25-b80f-db7be1418b9e
 uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVME IO command error:Unknown(400f)
 NVME Write Zeroes Success
+NVME IO command error:Unknown(400f)
 NVME Write Zeroes Success
-NVME Write Zeroes Success
-NVME Write Zeroes Success
-NVME Write Zeroes Success
+NVME IO command error:Unknown(400f)
 NQN:blktests-subsystem-1 disconnected 1 controller(s)
 Test complete

I'll look a bit more, but do you know what might be causing this? This
is on v4.19-rc3 with nvme-cli 1.6.
using nvme

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

* [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns
  2018-09-12 22:37   ` Omar Sandoval
@ 2018-09-12 23:53     ` Chaitanya Kulkarni
  0 siblings, 0 replies; 15+ messages in thread
From: Chaitanya Kulkarni @ 2018-09-12 23:53 UTC (permalink / raw)


Let me test again, I'll send out the next version with the fix.





From: Omar Sandoval <osandov@osandov.com>
Sent: Wednesday, September 12, 2018 3:37 PM
To: Chaitanya Kulkarni
Cc: linux-nvme at lists.infradead.org; osandov at fb.com
Subject: Re: [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns
? 
 
On Tue, Sep 04, 2018@12:32:55PM -0700, Chaitanya Kulkarni wrote:
> 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


This test is still failing for me sometimes. If I apply the following
patch:

diff --git a/tests/nvme/021 b/tests/nvme/021
index efcbb3f..137e89e 100755
--- a/tests/nvme/021
+++ b/tests/nvme/021
@@ -59,6 +59,10 @@ test() {
???????? 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 write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
+?????? nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
+?????? nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
???????? nvme write-zeroes "/dev/${nvmedev}" -n 1 -d -s "${sblk}" -c "${nblk}"
?
???????? nvme disconnect -n "${subsys_name}"
diff --git a/tests/nvme/021.out b/tests/nvme/021.out
index 29939e6..658be05 100644
--- a/tests/nvme/021.out
+++ b/tests/nvme/021.out
@@ -2,5 +2,9 @@ Running nvme/021
?91fdba0d-f87b-4c25-b80f-db7be1418b9e
?uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
?NVME Write Zeroes Success
+NVME Write Zeroes Success
+NVME Write Zeroes Success
+NVME Write Zeroes Success
+NVME Write Zeroes Success
?NQN:blktests-subsystem-1 disconnected 1 controller(s)
?Test complete

Then some of the commands pass and some fail:

--- tests/nvme/021.out? 2018-09-12 14:41:29.563976539 -0700
+++ /home/vmuser/linux/blktests/results/nodev/nvme/021.out.bad? 2018-09-12 15:30:43.037900569 -0700
@@ -1,10 +1,10 @@
?Running nvme/021
?91fdba0d-f87b-4c25-b80f-db7be1418b9e
?uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVME IO command error:Unknown(400f)
?NVME Write Zeroes Success
+NVME IO command error:Unknown(400f)
?NVME Write Zeroes Success
-NVME Write Zeroes Success
-NVME Write Zeroes Success
-NVME Write Zeroes Success
+NVME IO command error:Unknown(400f)
?NQN:blktests-subsystem-1 disconnected 1 controller(s)
?Test complete

I'll look a bit more, but do you know what might be causing this? This
is on v4.19-rc3 with nvme-cli 1.6.
using nvme
    

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

end of thread, other threads:[~2018-09-12 23:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 19:32 [PATCH V2 blktests 00/12] nvme: new testcases for NVMeOF Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 01/12] nvme: add NVMeOF DSM discard test for bdev-ns Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 02/12] nvme: add NVMeOF DSM discard test for file-ns Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 03/12] nvme: add NVMeOF write-zeroes test for bdev-ns Chaitanya Kulkarni
2018-09-12 22:37   ` Omar Sandoval
2018-09-12 23:53     ` Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 04/12] nvme: add NVMeOF write-zeroes test for file-ns Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 05/12] nvme: add NVMeOF smart-log test for bdev-ns Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 06/12] nvme: add NVMeOF smart-log test for file-ns Chaitanya Kulkarni
2018-09-04 19:32 ` [PATCH V2 blktests 07/12] nvme: add NVMeOF effects-log " Chaitanya Kulkarni
2018-09-04 19:33 ` [PATCH V2 blktests 08/12] nvme: add NVMeOF ns-desc " Chaitanya Kulkarni
2018-09-04 19:33 ` [PATCH V2 blktests 09/12] nvme: add NVMeOF ns-rescan " Chaitanya Kulkarni
2018-09-04 19:33 ` [PATCH V2 blktests 10/12] nvme: add NVMeOF list-subsys " Chaitanya Kulkarni
2018-09-04 19:33 ` [PATCH V2 blktests 11/12] nvme: add NVMeOF list " Chaitanya Kulkarni
2018-09-04 19:33 ` [PATCH V2 blktests 12/12] nvme: add NVMeOF reset " 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.