Skip to contentSkip to conversation

blktests: NVMeOF new testcases for file and bdev ns

PATCH Superseded Chaitanya Kulkarni 3 participants 38 messages Jun 11, 2018 – Jun 25, 2018 1 message not in the archive NVMe

lore
Share & tools
lore
#0 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

Hi,

This patch series restructures the target side namespace creation code and adds new testcases for NVMeOF loop target (nvme_loop). Also, we add one fio helper for basic data verification, new testcases like basic creation/deletion of the host/target, fio based data verification testcases for both block device and file backed target namespace and file system formatting and data verification from the host side.

-Regards,
Chaitanya

Changes Since V1:-

1. Add fio data verification helper.
2. Add a new test for many namespaces creation for file-backed ns.
3. Minor fixes and cleanups.

Chaitanya Kulkarni (14):
blktests: common/nvme export ns-mgmt interfaces
blktests: add NVMeOF bdev-ns target creation test
blktests: add NVMeOF file-ns target creation test
blktests: add NVMeOF bdev-ns host creation
blktests: add NVMeOF file-ns host creation
blktests: add fio data verification routine
blktests: add NVMeoF data verification test for bdev-ns
blktests: add NVMeOF data verification test for file-ns
blktests: add NVMeOF mkfs test for bdev-ns
blktests: add NVMeOF mkfs test for file-ns
blktests: add NVMeOF flush test for bdev-ns
blktests: add NVMeOF flush test for file-ns
blktests: add NVMeOF many bdev-ns creation test
blktests: add NVMeOF many file-ns creation test

 common/fio         | 12 +++++++
 common/nvme        | 46 +++++++++++++++++-------
 tests/nvme/006     | 62 ++++++++++++++++++++++++++++++++
 tests/nvme/006.out |  2 ++
 tests/nvme/007     | 60 +++++++++++++++++++++++++++++++
 tests/nvme/007.out |  2 ++
 tests/nvme/008     | 72 +++++++++++++++++++++++++++++++++++++
 tests/nvme/008.out |  5 +++
 tests/nvme/009     | 66 ++++++++++++++++++++++++++++++++++
 tests/nvme/009.out |  5 +++
 tests/nvme/010     | 76 +++++++++++++++++++++++++++++++++++++++
 tests/nvme/010.out |  5 +++
 tests/nvme/011     | 71 +++++++++++++++++++++++++++++++++++++
 tests/nvme/011.out |  5 +++
 tests/nvme/012     | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/012.out |  5 +++
 tests/nvme/013     | 84 +++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/013.out |  5 +++
 tests/nvme/014     | 76 +++++++++++++++++++++++++++++++++++++++
 tests/nvme/014.out |  6 ++++
 tests/nvme/015     | 68 +++++++++++++++++++++++++++++++++++
 tests/nvme/015.out |  6 ++++
 tests/nvme/016     | 64 +++++++++++++++++++++++++++++++++
 tests/nvme/016.out | 13 +++++++
 tests/nvme/017     | 70 ++++++++++++++++++++++++++++++++++++
 tests/nvme/017.out | 13 +++++++
 26 files changed, 974 insertions(+), 13 deletions(-)
 create mode 100755 tests/nvme/006
 create mode 100644 tests/nvme/006.out
 create mode 100755 tests/nvme/007
 create mode 100644 tests/nvme/007.out
 create mode 100755 tests/nvme/008
 create mode 100644 tests/nvme/008.out
 create mode 100755 tests/nvme/009
 create mode 100644 tests/nvme/009.out
 create mode 100755 tests/nvme/010
 create mode 100644 tests/nvme/010.out
 create mode 100755 tests/nvme/011
 create mode 100644 tests/nvme/011.out
 create mode 100755 tests/nvme/012
 create mode 100644 tests/nvme/012.out
 create mode 100755 tests/nvme/013
 create mode 100644 tests/nvme/013.out
 create mode 100755 tests/nvme/014
 create mode 100755 tests/nvme/014.out
 create mode 100755 tests/nvme/015
 create mode 100755 tests/nvme/015.out
 create mode 100755 tests/nvme/016
 create mode 100644 tests/nvme/016.out
 create mode 100755 tests/nvme/017
 create mode 100644 tests/nvme/017.out
Signature · 1 line
2.17.0
#1 lore raw

PATCH v2 1/14 blktests: common/nvme export ns-mgmt interfaces

This patch modifies and exports the interfaces to create and delete ns which can be consumed by future testcases like creation/deletion of ns.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 common/nvme | 46 +++++++++++++++++++++++++++++++++-------------
 1 file changed, 33 insertions(+), 13 deletions(-)
common/nvme +33 -13
index 5d7d89c..044d7fe 100644
@@ -48,31 +48,51 @@ _remove_nvmet_port() {
 	rmdir "${NVMET_CFS}/ports/${port}"
 }
 
-_create_nvmet_subsystem() {
+_create_nvmet_ns() {
 	local nvmet_subsystem="$1"
-	local blkdev="$2"
+	local nsid="$2"
+	local blkdev="$3"
 	local uuid="00000000-0000-0000-0000-000000000000"
-	local cfs_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
+	local subsys_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
+	local ns_path="${subsys_path}/namespaces/${nsid}"
 
-	if [[ $# -eq 3 ]]; then
-		uuid="$3"
+	if [[ $# -eq 4 ]]; then
+		uuid="$4"
 	fi
 
+	mkdir "${ns_path}"
+	printf "%s" "${blkdev}" > "${ns_path}/device_path"
+	printf "%s" "${uuid}" > "${ns_path}/device_uuid"
+	printf 1 > "${ns_path}/enable"
+}
+
+_create_nvmet_subsystem() {
+	local nvmet_subsystem="$1"
+	local blkdev="$2"
+	local uuid=$3
+	local cfs_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
+
 	mkdir -p "${cfs_path}"
 	echo 1 > "${cfs_path}/attr_allow_any_host"
-	mkdir "${cfs_path}/namespaces/1"
-	printf "%s" "$blkdev" > "${cfs_path}/namespaces/1/device_path"
-	printf "%s" "$uuid" > "${cfs_path}/namespaces/1/device_uuid"
-	printf 1 > "${cfs_path}/namespaces/1/enable"
+	_create_nvmet_ns "${nvmet_subsystem}" "1" "${blkdev}" "${uuid}"
+}
+
+_remove_nvmet_ns() {
+	local nvmet_subsystem="$1"
+	local nsid=$2
+	local subsys_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
+	local nvmet_ns_path="${subsys_path}/namespaces/${nsid}"
+
+	echo 0 > "${nvmet_ns_path}/enable"
+	rmdir "${nvmet_ns_path}"
 }
 
 _remove_nvmet_subsystem() {
 	local nvmet_subsystem="$1"
-	local cfs_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
+	local subsys_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
 
-	echo 0 > "${cfs_path}/namespaces/1/enable"
-	rmdir "${cfs_path}/namespaces/1/"
-	rmdir "${cfs_path}"
+	_remove_nvmet_ns "${nvmet_subsystem}" "1"
+	rmdir "${subsys_path}"
 }
 
 _add_nvmet_subsys_to_port() {
Signature · 1 line
2.17.0
#2 lore raw

PATCH v2 1/14 blktests: common/nvme export ns-mgmt interfaces

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#3 lore raw

PATCH v2 2/14 blktests: add NVMeOF bdev-ns target creation test

In reply to Chaitanya Kulkarni

This adds a new unit test to create NVMeOF target with block-device backed namespace.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/006     | 62 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/006.out |  2 ++
 2 files changed, 64 insertions(+)
 create mode 100755 tests/nvme/006
 create mode 100644 tests/nvme/006.out
tests/nvme/006 new file +62 -0
new file mode 100755
index 0000000..57cd2b9
@@ -0,0 +1,62 @@
+#!/bin/bash
+# Test NVMeOF target creation with a block device 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>
+#
+
+DESCRIPTION="unit tests for creating target with a 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}"
+
+	local port
+	local loop_dev
+	local subsys_name="blktests-subsystem-1"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	truncate -s 1G "$TMPDIR/img"
+
+	loop_dev="$(losetup -f --show "$TMPDIR/img")"
+
+	_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}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	losetup -d "$loop_dev"
+
+	rm "$TMPDIR/img"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
tests/nvme/006.out new file +2 -0
new file mode 100644
index 0000000..b66cd5a
@@ -0,0 +1,2 @@
+Running nvme/006
+Test complete
Signature · 1 line
2.17.0
#4 lore raw

PATCH v2 3/14 blktests: add NVMeOF file-ns target creation test

In reply to Chaitanya Kulkarni

This adds a new unit test to create NVMeOF target with file backed namespace.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/007     | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/007.out |  2 ++
 2 files changed, 62 insertions(+)
 create mode 100755 tests/nvme/007
 create mode 100644 tests/nvme/007.out
tests/nvme/007 new file +60 -0
new file mode 100755
index 0000000..74eed0d
@@ -0,0 +1,60 @@
+#!/bin/bash
+# Test NVMeOF target creation 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>
+#
+
+DESCRIPTION="unit tests for creating target with a file backed ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module nvmet && \
+		_have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	local port
+	local file_path
+	local subsys_name="blktests-subsystem-1"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	file_path="${TMPDIR}/img"
+
+	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}"
+
+	_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"
+}
tests/nvme/007.out new file +2 -0
new file mode 100644
index 0000000..fdb3472
@@ -0,0 +1,2 @@
+Running nvme/007
+Test complete
Signature · 1 line
2.17.0
#5 lore raw

PATCH v2 3/14 blktests: add NVMeOF file-ns target creation test

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#6 lore raw

PATCH v2 4/14 blktests: add NVMeOF bdev-ns host creation

In reply to Chaitanya Kulkarni

This adds a new unit test to create NVMeOF target and host. In the test we create one block device backed namespace on target.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/008     | 72 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/008.out |  5 ++++
 2 files changed, 77 insertions(+)
 create mode 100755 tests/nvme/008
 create mode 100644 tests/nvme/008.out
tests/nvme/008 new file +72 -0
new file mode 100755
index 0000000..28079cb
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Test NVMeOF host creation with a block device 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>
+#
+
+DESCRIPTION="unit test for creating a host with one block device 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}"
+
+	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 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"
+}
tests/nvme/008.out new file +5 -0
new file mode 100644
index 0000000..b05b46d
@@ -0,0 +1,5 @@
+Running nvme/008
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#7 lore raw

PATCH v2 4/14 blktests: add NVMeOF bdev-ns host creation

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#8 lore raw

PATCH v2 5/14 blktests: add NVMeOF file-ns host creation

In reply to Chaitanya Kulkarni

This adds a new unit test to create NVMeOF target and host. In the test we create one file backed namespace on target.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/009     | 66 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/009.out |  5 ++++
 2 files changed, 71 insertions(+)
 create mode 100755 tests/nvme/009
 create mode 100644 tests/nvme/009.out
tests/nvme/009 new file +66 -0
new file mode 100755
index 0000000..80484fd
@@ -0,0 +1,66 @@
+#!/bin/bash
+# Test NVMeOF host creation 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>
+#
+
+DESCRIPTION="unit test for creating a host with one 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"
+
+	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 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"
+}
tests/nvme/009.out new file +5 -0
new file mode 100644
index 0000000..7fd27ff
@@ -0,0 +1,5 @@
+Running nvme/009
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#9 lore raw

PATCH v2 5/14 blktests: add NVMeOF file-ns host creation

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#10 lore raw

PATCH v2 6/14 blktests: add fio data verification routine

In reply to Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 common/fio | 12 ++++++++++++
 1 file changed, 12 insertions(+)
common/fio +12 -0
index e83258d..abe5ee2 100644
@@ -162,10 +162,17 @@ _fio_perf() {
 # tests that should run for a specific amount of time.
 _run_fio() {
 	local args=("--output=$TMPDIR/fio_perf" "--output-format=terse" "--terse-version=4" "--group_reporting=1")
+
 	if [[ -v TIMEOUT ]]; then
 		args+=("--runtime=$TIMEOUT")
 	fi
+
 	fio "${args[@]}" "$@"
+
+	if [ $? -ne 0 ]; then
+		echo "error fio failed"
+		cat "$TMPDIR"/fio_perf
+	fi
 }
 
 # Wrapper around _run_fio used if you need some I/O but don't really care much
@@ -175,6 +182,11 @@ _run_fio_rand_io() {
 		--name=reads --direct=1 "$@"
 }
 
+_run_fio_verify_io() {
+	_run_fio --name=verify --rw=randwrite --direct=1 --ioengine=libaio --bs=4k \
+		      --norandommap --iodepth=16 --verify=crc32c "$@"
+}
+
 _fio_perf_report() {
 	# If there is more than one group, we don't know what to report.
 	if [[ $(wc -l < "$TMPDIR/fio_perf") -gt 1 ]]; then
Signature · 1 line
2.17.0
#11 lore raw

PATCH v2 6/14 blktests: add fio data verification routine

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#12 lore raw

PATCH v2 6/14 blktests: add fio data verification routine

In reply to Chaitanya Kulkarni
Quoted 14 lines · Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 common/fio | 12 ++++++++++++
 1 file changed, 12 insertions(+)
common/fio +1 -0
index e83258d..abe5ee2 100644
@@ -162,10 +162,17 @@ _fio_perf() {
 # tests that should run for a specific amount of time.
 _run_fio() {
 	local args=("--output=$TMPDIR/fio_perf" "--output-format=terse" "--terse-version=4" "--group_reporting=1")
+

common/fio _fio_perf() { · line 175

Quoted 10 lines
common/fio +6 -0
 	if [[ -v TIMEOUT ]]; then
 		args+=("--runtime=$TIMEOUT")
 	fi
+
 	fio "${args[@]}" "$@"
+
+	if [ $? -ne 0 ]; then
+		echo "error fio failed"
+		cat "$TMPDIR"/fio_perf
+	fi

I simplified this to

if ! fio "${args[@]}" "$@"; then

	...

fi

#13 lore raw

PATCH v2 6/14 blktests: add fio data verification routine

[CK] Fine with me.

From: Omar Sandoval <[email protected]>
Sent: Monday, June 11, 2018 2:09 PM
To: Chaitanya Kulkarni
Cc: linux-nvme at lists.infradead.org; jthumshirn at suse.de
Subject: Re: [PATCH V2 06/14] blktests: add fio data verification routine ?

Quoted 16 lines · Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>

---
? common/fio | 12 ++++++++++++
? 1 file changed, 12 insertions(+)

common/fio +0 -0
index e83258d..abe5ee2 100644
@@ -162,10 +162,17 @@ _fio_perf() {

? # tests that should run for a specific amount of time.
? _run_fio() {
??????? local args=("--output=$TMPDIR/fio_perf" "--output-format=terse" "--terse-version=4" "--group_reporting=1") +
??????? if [[ -v TIMEOUT ]]; then
??????????????? args+=("--runtime=$TIMEOUT")

Quoted 8 lines

??????? fi
+
??????? fio "${args[@]}" "$@"
+
+???? if [ $? -ne 0 ]; then
+???????????? echo "error fio failed"
+???????????? cat "$TMPDIR"/fio_perf
+???? fi

I simplified this to

if ! fio "${args[@]}" "$@"; then
??????? ...
fi

#14 lore raw

PATCH v2 7/14 blktests: add NVMeoF data verification test for bdev-ns

In reply to Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/010     | 76 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/010.out |  5 +++
 2 files changed, 81 insertions(+)
 create mode 100755 tests/nvme/010
 create mode 100644 tests/nvme/010.out
tests/nvme/010 new file +76 -0
new file mode 100755
index 0000000..4224ea6
@@ -0,0 +1,76 @@
+#!/bin/bash
+# This is a data verification test for block device 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>
+#
+
+DESCRIPTION="data verification test for block device backed ns"
+
+requires() {
+	_have_program nvme && _have_fio && _have_module loop && \
+		_have_configfs && _have_module nvme-loop && \
+		_have_module nvmet
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local ret=0
+	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"
+
+	_run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1"
+
+	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}"
+	rm -f local*verify*state "${fio_out}"
+
+	modprobe -r nvme_loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
tests/nvme/010.out new file +5 -0
new file mode 100644
index 0000000..788ea96
@@ -0,0 +1,5 @@
+Running nvme/010
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#15 lore raw

PATCH v2 7/14 blktests: add NVMeoF data verification test for bdev-ns

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#16 lore raw

PATCH v2 8/14 blktests: add NVMeOF data verification test for file-ns

In reply to Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/011     | 71 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/011.out |  5 ++++
 2 files changed, 76 insertions(+)
 create mode 100755 tests/nvme/011
 create mode 100644 tests/nvme/011.out
tests/nvme/011 new file +71 -0
new file mode 100755
index 0000000..3038920
@@ -0,0 +1,71 @@
+#!/bin/bash
+# This is a data verification test for 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>
+#
+
+DESCRIPTION="data verification test for file backed ns"
+
+requires() {
+	_have_program nvme && _have_fio && _have_configfs && \
+		_have_module nvme-loop && _have_module nvmet
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local ret=0
+	local nvmedev
+	local file_path
+	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"
+
+	_run_fio_verify_io --size=950m --filename="/dev/${nvmedev}n1"
+
+	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}"
+	rm -f local-write-and-verify*state "${fio_out}"
+
+	modprobe -r nvme_loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
tests/nvme/011.out new file +5 -0
new file mode 100644
index 0000000..ab29fa2
@@ -0,0 +1,5 @@
+Running nvme/011
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#17 lore raw

PATCH v2 8/14 blktests: add NVMeOF data verification test for file-ns

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#18 lore raw

PATCH v2 9/14 blktests: add NVMeOF mkfs test for bdev-ns

In reply to Chaitanya Kulkarni

This adds a new test which formats the ns with file system on the host side and runs fio data verification workload.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/012     | 88 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/012.out |  5 +++
 2 files changed, 93 insertions(+)
 create mode 100755 tests/nvme/012
 create mode 100644 tests/nvme/012.out
tests/nvme/012 new file +88 -0
new file mode 100755
index 0000000..191cec8
@@ -0,0 +1,88 @@
+#!/bin/bash
+# Test mkfs with data verification for block device 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>
+#
+
+DESCRIPTION="test mkfs with data verification for block device backed ns"
+
+requires() {
+	_have_program nvme && _have_program mkfs.xfs && _have_program fio && \
+		_have_module loop && _have_module nvmet && \
+		_have_module nvme-loop && _have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local ret=0
+	local nvmedev
+	local loop_dev
+	local mount_dir="/mnt/blktests"
+	local file_path="${TMPDIR}/img"
+	local subsys_name="blktests-subsystem-1"
+
+	mkdir -p "${mount_dir}" > /dev/null 2>&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"
+
+	umount ${mount_dir} > /dev/null 2>&1
+
+	mkfs.xfs -f /dev/"${nvmedev}n1" > /dev/null 2>&1
+
+	mount /dev/"${nvmedev}n1" "${mount_dir}"
+
+	_run_fio_verify_io --size=950m --directory="${mount_dir}/"
+
+	umount "${mount_dir}" > /dev/null 2>&1
+
+	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 local*verify*state
+	rm "${file_path}"
+	rm -fr "${mount_dir}"
+
+	modprobe -r nvme_loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
tests/nvme/012.out new file +5 -0
new file mode 100644
index 0000000..581e686
@@ -0,0 +1,5 @@
+Running nvme/012
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#19 lore raw

PATCH v2 9/14 blktests: add NVMeOF mkfs test for bdev-ns

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#20 lore raw

PATCH v2 10/14 blktests: add NVMeOF mkfs test for file-ns

In reply to Chaitanya Kulkarni

This adds a new test which formats the ns with file system on the host side and runs fio data verification workload.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/013     | 84 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/013.out |  5 +++
 2 files changed, 89 insertions(+)
 create mode 100755 tests/nvme/013
 create mode 100644 tests/nvme/013.out
tests/nvme/013 new file +84 -0
new file mode 100755
index 0000000..164a15e
@@ -0,0 +1,84 @@
+#!/bin/bash
+# Test mkfs with data verification for 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>
+#
+
+DESCRIPTION="test mkfs with data verification for file backed ns"
+
+requires() {
+	_have_program nvme && _have_program mkfs.xfs && _have_fio && \
+		_have_module nvmet && _have_module nvme-loop && \
+		_have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	local port
+	local ret=0
+	local nvmedev
+	local mount_dir="/mnt/blktests/"
+	local file_path="${TMPDIR}/img"
+
+	local subsys_name="blktests-subsystem-1"
+
+	mkdir -p "${mount_dir}" > /dev/null 2>&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"
+
+	umount ${mount_dir} > /dev/null 2>&1
+
+	mkfs.xfs -f /dev/"${nvmedev}n1" > /dev/null 2>&1
+
+	mount /dev/"${nvmedev}n1" "${mount_dir}"
+
+	_run_fio_verify_io --size=800m --directory="${mount_dir}/"
+
+	umount "${mount_dir}" > /dev/null 2>&1
+
+	nvme disconnect -n "${subsys_name}"
+
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_subsystem "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	rm -f local*verify*state
+	rm "${file_path}"
+	rm -fr "${mount_dir}"
+
+	modprobe -r nvme_loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
tests/nvme/013.out new file +5 -0
new file mode 100644
index 0000000..f7285a9
@@ -0,0 +1,5 @@
+Running nvme/013
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#21 lore raw

PATCH v2 10/14 blktests: add NVMeOF mkfs test for file-ns

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#22 lore raw

PATCH v2 11/14 blktests: add NVMeOF flush test for bdev-ns

In reply to Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/014     | 76 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/014.out |  6 ++++
 2 files changed, 82 insertions(+)
 create mode 100755 tests/nvme/014
 create mode 100755 tests/nvme/014.out
tests/nvme/014 new file +76 -0
new file mode 100755
index 0000000..b2490c8
@@ -0,0 +1,76 @@
+#!/bin/bash
+# Test NVMeOF flush command from host with a block device 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>
+#
+
+DESCRIPTION="unit test for NVMe flush for block device 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}"
+
+	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"
+
+	dd=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k
+
+	nvme flush /dev/"${nvmedev}n1"
+
+	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"
+}
tests/nvme/014.out new file +6 -0
new file mode 100755
index 0000000..0285826
@@ -0,0 +1,6 @@
+Running nvme/014
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVMe Flush: success
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#23 lore raw

PATCH v2 11/14 blktests: add NVMeOF flush test for bdev-ns

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#24 lore raw

PATCH v2 12/14 blktests: add NVMeOF flush test for file-ns

In reply to Chaitanya Kulkarni
Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/015     | 68 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/015.out |  6 ++++
 2 files changed, 74 insertions(+)
 create mode 100755 tests/nvme/015
 create mode 100755 tests/nvme/015.out
tests/nvme/015 new file +68 -0
new file mode 100755
index 0000000..5f86d45
@@ -0,0 +1,68 @@
+#!/bin/bash
+# Test NVMeOF flush command from host 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>
+#
+
+DESCRIPTION="unit test for NVMe flush for file backed ns"
+QUICK=1
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module loop && \
+		 _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"
+
+	dd=/dev/urandom of="/dev/${nvmedev}n1" count=128000 bs=4k
+
+	nvme flush /dev/"${nvmedev}n1"
+
+	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}"
+
+	echo "Test complete"
+}
tests/nvme/015.out new file +6 -0
new file mode 100755
index 0000000..23763f1
@@ -0,0 +1,6 @@
+Running nvme/015
+91fdba0d-f87b-4c25-b80f-db7be1418b9e
+uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
+NVMe Flush: success
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
Signature · 1 line
2.17.0
#25 lore raw

PATCH v2 12/14 blktests: add NVMeOF flush test for file-ns

Looks good,
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#26 lore raw

PATCH v2 13/14 blktests: add NVMeOF many bdev-ns creation test

In reply to Chaitanya Kulkarni

This patch adds a new testcase to exercise a large number of ns creation and deletion along with discovery command.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/016     | 64 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/016.out | 13 ++++++++++
 2 files changed, 77 insertions(+)
 create mode 100755 tests/nvme/016
 create mode 100644 tests/nvme/016.out
tests/nvme/016 new file +64 -0
new file mode 100755
index 0000000..affcfb8
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Test many target bdev-ns creation/deletion under one subsystem.
+# 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>
+#
+
+DESCRIPTION="create/delete many bdev-ns and test discovery"
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module nvmet \
+		_have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	local port
+	local iterations=1000
+	local loop_dev="$(losetup -f)"
+	local subsys_nqn="blktests-subsystem-1"
+	local subsys_nqn_path="${NVMET_CFS}/subsystems/${subsys_nqn}"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	_create_nvmet_subsystem "${subsys_nqn}" "${loop_dev}"
+
+	for ((i = 2; i <= iterations; i++)); do
+		_create_nvmet_ns "${subsys_nqn}" "${i}" "${loop_dev}"
+	done
+
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "$port" "${subsys_nqn}"
+
+	nvme discover -t loop | sed -r -e "s/portid:  [0-9]+/portid:  X/"
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_nqn}"
+	_remove_nvmet_port "${port}"
+
+	for ((i = iterations; i > 1; i--)); do
+		_remove_nvmet_ns "${subsys_nqn}" $i
+	done
+
+	_remove_nvmet_subsystem "${subsys_nqn}"
+
+	modprobe -r nvme-loop nvmet
+	echo "Test complete"
+}
tests/nvme/016.out new file +13 -0
new file mode 100644
index 0000000..59bd293
@@ -0,0 +1,13 @@
+Running nvme/016
+
+Discovery Log Number of Records 1, Generation counter 1
+=====Discovery Log Entry 0======
+trtype:  loop
+adrfam:  pci
+subtype: nvme subsystem
+treq:    not specified
+portid:  X
+trsvcid: 
+subnqn:  blktests-subsystem-1
+traddr:  
+Test complete
Signature · 1 line
2.17.0
#27 lore raw

PATCH v2 13/14 blktests: add NVMeOF many bdev-ns creation test

Quoted 2 lines · Chaitanya Kulkarni

This patch adds a new testcase to exercise a large number of ns creation and deletion along with discovery command.

How would we actually detect an error with this test? All we do is issuing a discovery, this doesn't give us a list of namespaces.

Maybe add something like 'ls /dev/${nvmedev}n* | wc -l' to verify we really have $iterations namespaces created?

[...]

tests/nvme/016 line 45

Quoted 3 lines
tests/nvme/016 new file +3 -0
+	_create_nvmet_subsystem "${subsys_nqn}" "${loop_dev}"
+
+	for ((i = 2; i <= iterations; i++)); do

Ahm I don't understand why you start with i = 2 here.

Thanks,
Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#28 lore raw

PATCH v2 13/14 blktests: add NVMeOF many bdev-ns creation test

From: Johannes Thumshirn <[email protected]>
Sent: Monday, June 11, 2018 4:38 AM
To: Chaitanya Kulkarni
Cc: linux-nvme at lists.infradead.org; osandov at osandov.com
Subject: Re: [PATCH V2 13/14] blktests: add NVMeOF many bdev-ns creation test ?

Quoted 2 lines · Chaitanya Kulkarni

This patch adds a new testcase to exercise a large number of ns creation and deletion along with discovery command.

How would we actually detect an error with this test? All we do is issuing a discovery, this doesn't give us a list of namespaces.

[CK] we need to check the changed_ns_list_log/nvme ns-list, I've already posted the nvme-cli implementation of changed ns list, once that is accepted I can add this here.

Maybe add something like 'ls /dev/${nvmedev}n* | wc -l' to verify we really have $iterations namespaces created?

[CK] I'd read the log page through NVMe-Cli.

[...]

Quoted 3 lines

+???? _create_nvmet_subsystem "${subsys_nqn}" "${loop_dev}" +
+???? for ((i = 2; i <= iterations; i++)); do

Ahm I don't understand why? you start with i = 2 here.

[CK] This retains the default behavior of creating one ns at the time of subsystem creation which is present in tests/nvme/001-005.

Thanks,
??????? Johannes

Signature · 6 lines
Johannes Thumshirn????????????????????????????????????????? Storage
jthumshirn at suse.de??????????????????????????????? +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#29 lore raw

PATCH v2 14/14 blktests: add NVMeOF many file-ns creation test

In reply to Chaitanya Kulkarni

This patch adds a new testcase to exercise a large number of ns creation and deletion along with discovery command.

Signed-off-by Chaitanya Kulkarni <chaitanya.kulkarni at wdc.com>
---
 tests/nvme/017     | 70 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/nvme/017.out | 13 +++++++++
 2 files changed, 83 insertions(+)
 create mode 100755 tests/nvme/017
 create mode 100644 tests/nvme/017.out
tests/nvme/017 new file +70 -0
new file mode 100755
index 0000000..ce63aa0
@@ -0,0 +1,70 @@
+#!/bin/bash
+# Test many target file-ns creation/deletion under one subsystem.
+# 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>
+#
+
+DESCRIPTION="create/delete many file-ns and test discovery"
+
+requires() {
+	_have_program nvme && _have_module nvme-loop && _have_module nvmet && \
+		_have_configfs
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	local port
+	local file_path
+	local subsys_name="blktests-subsystem-1"
+
+	modprobe nvmet
+	modprobe nvme-loop
+
+	file_path="${TMPDIR}/img"
+
+	truncate -s 1G "${file_path}"
+
+	_create_nvmet_subsystem "${subsys_name}" "${file_path}" \
+		"91fdba0d-f87b-4c25-b80f-db7be1418b9e"
+
+	for ((i = 2; i <= iterations; i++)); do
+		_create_nvmet_ns "${subsys_name}" "${i}" "${loop_dev}"
+	done
+
+	port="$(_create_nvmet_port "loop")"
+	_add_nvmet_subsys_to_port "${port}" "${subsys_name}"
+
+	nvme discover -t loop | sed -r -e "s/portid:  [0-9]+/portid:  X/"
+	_remove_nvmet_subsystem_from_port "${port}" "${subsys_name}"
+	_remove_nvmet_port "${port}"
+
+	for ((i = iterations; i > 1; i--)); do
+		_remove_nvmet_ns "${subsys_name}" $i
+	done
+
+	_remove_nvmet_subsystem "${subsys_name}"
+
+	rm "${file_path}"
+
+	modprobe -r nvme-loop
+	modprobe -r nvmet
+
+	echo "Test complete"
+}
tests/nvme/017.out new file +13 -0
new file mode 100644
index 0000000..4b0877a
@@ -0,0 +1,13 @@
+Running nvme/017
+
+Discovery Log Number of Records 1, Generation counter 1
+=====Discovery Log Entry 0======
+trtype:  loop
+adrfam:  pci
+subtype: nvme subsystem
+treq:    not specified
+portid:  X
+trsvcid: 
+subnqn:  blktests-subsystem-1
+traddr:  
+Test complete
Signature · 1 line
2.17.0
#30 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

In reply to Chaitanya Kulkarni
Quoted 9 lines · Chaitanya Kulkarni

Hi,

This patch series restructures the target side namespace creation code and adds new testcases for NVMeOF loop target (nvme_loop). Also, we add one fio helper for basic data verification, new testcases like basic creation/deletion of the host/target, fio based data verification testcases for both block device and file backed target namespace and file system formatting and data verification from the host side.

Quoted 8 lines

-Regards,
Chaitanya

Changes Since V1:-

1. Add fio data verification helper.
2. Add a new test for many namespaces creation for file-backed ns.
3. Minor fixes and cleanups.

Can you please add the already issued Reviewed-by's next time you do a re-submission?

Thanks,
Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
#31 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

In reply to Chaitanya Kulkarni
Quoted 9 lines · Chaitanya Kulkarni

Hi,

This patch series restructures the target side namespace creation code and adds new testcases for NVMeOF loop target (nvme_loop). Also, we add one fio helper for basic data verification, new testcases like basic creation/deletion of the host/target, fio based data verification testcases for both block device and file backed target namespace and file system formatting and data verification from the host side.

Quoted 8 lines

-Regards,
Chaitanya

Changes Since V1:-

1. Add fio data verification helper.
2. Add a new test for many namespaces creation for file-backed ns.
3. Minor fixes and cleanups.

Hey, Chaitanya,

I had to change TMPDIR to use the blktests repository instead of /tmp to get the file-backed ones to pass. I also changed the descriptions to read as "this test will..." for consistency with the other tests, and added TIMED=1 to the data verification tests.

The flush tests fail for me, and Johannes still has some comments on the last two, so I applied patches 1-10. The flush tests fail like this:

nvme/014 (flush a NVMeOF block device-backed ns) [failed]
runtime 0.788s ... 0.803s

    --- tests/nvme/014.out      2018-06-11 15:01:41.449896278 -0700
    +++ results/nodev/nvme/014.out.bad  2018-06-11 15:07:31.425480955 -0700
    @@ -1,6 +1,6 @@
     Running nvme/014
     91fdba0d-f87b-4c25-b80f-db7be1418b9e
     uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
    -NVMe Flush: success
    +NVME IO command error:INVALID_NS(400b)
     NQN:blktests-subsystem-1 disconnected 1 controller(s)
     Test complete

Any idea what that is?

Thanks for the tests!

Quoted 15 lines

Chaitanya Kulkarni (14):
blktests: common/nvme export ns-mgmt interfaces
blktests: add NVMeOF bdev-ns target creation test
blktests: add NVMeOF file-ns target creation test
blktests: add NVMeOF bdev-ns host creation
blktests: add NVMeOF file-ns host creation
blktests: add fio data verification routine
blktests: add NVMeoF data verification test for bdev-ns
blktests: add NVMeOF data verification test for file-ns
blktests: add NVMeOF mkfs test for bdev-ns
blktests: add NVMeOF mkfs test for file-ns
blktests: add NVMeOF flush test for bdev-ns
blktests: add NVMeOF flush test for file-ns
blktests: add NVMeOF many bdev-ns creation test
blktests: add NVMeOF many file-ns creation test

#32 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

Hi Omar,

From: Omar Sandoval <[email protected]>
Sent: Monday, June 11, 2018 3:14 PM
To: Chaitanya Kulkarni
Cc: linux-nvme at lists.infradead.org; jthumshirn at suse.de
Subject: Re: [PATCH V2 00/14] blktests: NVMeOF new testcases for file and bdev ns ?

Quoted 9 lines · Chaitanya Kulkarni

Hi,

This patch series restructures the target side namespace creation code and adds new testcases for NVMeOF loop target (nvme_loop). Also, we add one fio helper for basic data verification, new testcases like basic creation/deletion of the host/target, fio based data verification testcases for both block device and file backed target namespace and file system formatting and data verification from the host side.

Quoted 8 lines

-Regards,
Chaitanya

Changes Since V1:-

1. Add fio data verification helper.
2. Add a new test for many namespaces creation for file-backed ns.
3. Minor fixes and cleanups.

Hey, Chaitanya,

I had to change TMPDIR to use the blktests repository instead of /tmp to get the file-backed ones to pass. I also changed the descriptions to read as "this test will..." for consistency with the other tests, and added TIMED=1 to the data verification tests.

[CK] Sounds good and thanks.

The flush tests fail for me, and Johannes still has some comments on the last two, so I applied patches 1-10. The flush tests fail like this:

nvme/014 (flush a NVMeOF block device-backed ns)???????????? [failed] runtime? 0.788s? ...? 0.803s
??? --- tests/nvme/014.out????? 2018-06-11 15:01:41.449896278 -0700 ??? +++ results/nodev/nvme/014.out.bad? 2018-06-11 15:07:31.425480955 -0700 ??? @@ -1,6 +1,6 @@
???? Running nvme/014
???? 91fdba0d-f87b-4c25-b80f-db7be1418b9e
???? uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
??? -NVMe Flush: success
??? +NVME IO command error:INVALID_NS(400b)
???? NQN:blktests-subsystem-1 disconnected 1 controller(s)
???? Test complete

Any idea what that is?

[CK] I ran the all the tests didn't see that error:-

# for i in 006 007 008 009 010 011 012 013 014 015 016 017; do ./check tests/nvme/$i; done 
nvme/006 (unit tests for creating target with a block device ns) [passed]
    runtime  0.363s  ...  0.289s
nvme/007 (unit tests for creating target with a file backed ns) [passed]
    runtime  0.298s  ...  0.226s
nvme/008 (unit test for creating a host with one block device backed ns) [passed]
    runtime  0.667s  ...  0.552s
nvme/009 (unit test for creating a host with one file backed ns) [passed]
    runtime  0.605s  ...  0.510s
nvme/010 (data verification test for block device backed ns) [passed]
    runtime  42.825s  ...  41.327s
nvme/011 (data verification test for file backed ns)         [passed]
    runtime  274.323s  ...  201.583s
nvme/012 (test mkfs with data verification for block device backed ns) [passed]
    runtime  277.448s  ...  279.184s
nvme/013 (test mkfs with data verification for file backed ns) [passed]
    runtime  226.276s  ...  239.203s
nvme/014 (unit test for NVMe flush for block device backed ns) [passed]
    runtime  0.736s  ...  0.566s
nvme/015 (unit test for NVMe flush for file backed ns)       [passed]
    runtime  0.501s  ...  0.507s
nvme/016 (create/delete many bdev-ns and test discovery)     [passed]
    runtime  28.271s  ...  27.361s
nvme/017 (create/delete many file-ns and test discovery)     [passed]
    runtime  0.285s  ...  0.302s

I suspect it may be backend file creation issue when configuring the target side namespace, but not entirely sure.

Thanks for the tests!

Quoted 15 lines

Chaitanya Kulkarni (14):
?? blktests: common/nvme export ns-mgmt interfaces ?? blktests: add NVMeOF bdev-ns target creation test ?? blktests: add NVMeOF file-ns target creation test ?? blktests: add NVMeOF bdev-ns host creation
?? blktests: add NVMeOF file-ns host creation
?? blktests: add fio data verification routine
?? blktests: add NVMeoF data verification test for bdev-ns ?? blktests: add NVMeOF data verification test for file-ns ?? blktests: add NVMeOF mkfs test for bdev-ns
?? blktests: add NVMeOF mkfs test for file-ns
?? blktests: add NVMeOF flush test for bdev-ns
?? blktests: add NVMeOF flush test for file-ns
?? blktests: add NVMeOF many bdev-ns creation test ?? blktests: add NVMeOF many file-ns creation test

#33 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

In reply to Omar Sandoval

From: Omar Sandoval <[email protected]>
Sent: Monday, June 11, 2018 3:14 PM
To: Chaitanya Kulkarni
Cc: linux-nvme at lists.infradead.org; jthumshirn at suse.de
Subject: Re: [PATCH V2 00/14] blktests: NVMeOF new testcases for file and bdev ns ?

Quoted 9 lines · Chaitanya Kulkarni

Hi,

This patch series restructures the target side namespace creation code and adds new testcases for NVMeOF loop target (nvme_loop). Also, we add one fio helper for basic data verification, new testcases like basic creation/deletion of the host/target, fio based data verification testcases for both block device and file backed target namespace and file system formatting and data verification from the host side.

Quoted 8 lines

-Regards,
Chaitanya

Changes Since V1:-

1. Add fio data verification helper.
2. Add a new test for many namespaces creation for file-backed ns.
3. Minor fixes and cleanups.

Hey, Chaitanya,

I had to change TMPDIR to use the blktests repository instead of /tmp to get the file-backed ones to pass. I also changed the descriptions to read as "this test will..." for consistency with the other tests, and added TIMED=1 to the data verification tests.

The flush tests fail for me, and Johannes still has some comments on the last two, so I applied patches 1-10. The flush tests fail like this:

[CK] Johannes, can we get the remaining testcases in?

nvme/014 (flush a NVMeOF block device-backed ns)???????????? [failed] runtime? 0.788s? ...? 0.803s
??? --- tests/nvme/014.out????? 2018-06-11 15:01:41.449896278 -0700 ??? +++ results/nodev/nvme/014.out.bad? 2018-06-11 15:07:31.425480955 -0700 ??? @@ -1,6 +1,6 @@
???? Running nvme/014
???? 91fdba0d-f87b-4c25-b80f-db7be1418b9e
???? uuid.91fdba0d-f87b-4c25-b80f-db7be1418b9e
??? -NVMe Flush: success
??? +NVME IO command error:INVALID_NS(400b)
???? NQN:blktests-subsystem-1 disconnected 1 controller(s)
???? Test complete

Any idea what that is?

Thanks for the tests!

Quoted 15 lines

Chaitanya Kulkarni (14):
?? blktests: common/nvme export ns-mgmt interfaces ?? blktests: add NVMeOF bdev-ns target creation test ?? blktests: add NVMeOF file-ns target creation test ?? blktests: add NVMeOF bdev-ns host creation
?? blktests: add NVMeOF file-ns host creation
?? blktests: add fio data verification routine
?? blktests: add NVMeoF data verification test for bdev-ns ?? blktests: add NVMeOF data verification test for file-ns ?? blktests: add NVMeOF mkfs test for bdev-ns
?? blktests: add NVMeOF mkfs test for file-ns
?? blktests: add NVMeOF flush test for bdev-ns
?? blktests: add NVMeOF flush test for file-ns
?? blktests: add NVMeOF many bdev-ns creation test ?? blktests: add NVMeOF many file-ns creation test

#34 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

Quoted 4 lines · Chaitanya Kulkarni

The flush tests fail for me, and Johannes still has some comments on the last two, so I applied patches 1-10. The flush tests fail like this:

[CK] Johannes, can we get the remaining testcases in?

Well I guess we can fix it later.

Johannes

Signature · 6 lines
Johannes Thumshirn                                          Storage
jthumshirn at suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg
GF: Felix Imend?rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N?rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

A message that is not in the archive (sent off-list or not yet received): BN6PR04MB120367ABC523F7DDEC83C35A867E0@BN6PR04MB1203.namprd04.prod.outlook.com

#36 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

Quoted 4 lines · Chaitanya Kulkarni

Thanks, Johannes for the review comments.

Omar, let me know if you find any issues, otherwise, we can merge this series.

I was able to fix the flush tests by replacing

nvme flush /dev/"${nvmedev}n1"

With

nvme flush /dev/"${nvmedev}" -n 1

(Going off of https://github.com/linux-nvme/nvme-cli/issues/174). Does that seem sane?

The last two tests sometimes fail like this:

nvme/016 (create/delete many NVMeOF block device-backed ns and test discovery) [failed]
runtime ... 44.535s

    --- tests/nvme/016.out      2018-06-25 11:56:39.176313626 -0700
    +++ results/nodev/nvme/016.out.bad  2018-06-25 11:59:30.153990955 -0700
    @@ -1,6 +1,6 @@
     Running nvme/016

    -Discovery Log Number of Records 1, Generation counter 1
    +Discovery Log Number of Records 1, Generation counter 3
     =====Discovery Log Entry 0======
     trtype:  loop
     adrfam:  pci

I don't know enough about NVMe to know how important this is, but it looks like this needs some sort of filter :)

#37 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

Quoted 32 lines · Omar Sandoval
Quoted 4 lines · Chaitanya Kulkarni

Thanks, Johannes for the review comments.

Omar, let me know if you find any issues, otherwise, we can merge this series.

I was able to fix the flush tests by replacing

nvme flush /dev/"${nvmedev}n1"

With

nvme flush /dev/"${nvmedev}" -n 1

(Going off of https://github.com/linux-nvme/nvme-cli/issues/174). Does that seem sane?

The last two tests sometimes fail like this:

nvme/016 (create/delete many NVMeOF block device-backed ns and test discovery) [failed]
runtime ... 44.535s

    --- tests/nvme/016.out      2018-06-25 11:56:39.176313626 -0700
    +++ results/nodev/nvme/016.out.bad  2018-06-25 11:59:30.153990955 -0700
    @@ -1,6 +1,6 @@
     Running nvme/016

    -Discovery Log Number of Records 1, Generation counter 1
    +Discovery Log Number of Records 1, Generation counter 3
     =====Discovery Log Entry 0======
     trtype:  loop
     adrfam:  pci
Quoted 2 lines

I don't know enough about NVMe to know how important this is, but it looks like this needs some sort of filter :)

Actually, the last test is just broken. It uses loop_dev which isn't defined. Please fix that, too :)

#38 lore raw

v2 cover blktests: NVMeOF new testcases for file and bdev ns

From: Omar Sandoval <[email protected]>
Sent: Monday, June 25, 2018 12:06 PM
To: Chaitanya Kulkarni
Cc: Johannes Thumshirn; linux-nvme at lists.infradead.org
Subject: Re: [PATCH V2 00/14] blktests: NVMeOF new testcases for file and bdev ns ?

Quoted 26 lines · Omar Sandoval
Quoted 4 lines · Chaitanya Kulkarni

Thanks, Johannes for the review comments.

Omar, let me know if you find any issues, otherwise, we can merge this series.

I was able to fix the flush tests by replacing

nvme flush /dev/"${nvmedev}n1"

With

nvme flush /dev/"${nvmedev}" -n 1

(Going off of https://github.com/linux-nvme/nvme-cli/issues/174). Does that seem sane?

The last two tests sometimes fail like this:

nvme/016 (create/delete many NVMeOF block device-backed ns and test discovery) [failed] runtime???? ...? 44.535s
???? --- tests/nvme/016.out????? 2018-06-25 11:56:39.176313626 -0700
???? +++ results/nodev/nvme/016.out.bad? 2018-06-25 11:59:30.153990955 -0700 ???? @@ -1,6 +1,6 @@
????? Running nvme/016

Quoted 8 lines

???? -Discovery Log Number of Records 1, Generation counter 1 ???? +Discovery Log Number of Records 1, Generation counter 3 ????? =====Discovery Log Entry 0======
????? trtype:? loop
????? adrfam:? pci

I don't know enough about NVMe to know how important this is, but it looks like this needs some sort of filter :)

[CK] Generation counter needs to be 1, when I ran the tests I did not see any issue, let me see if you I can reproduce it and fix the problem.

Actually, the last test is just broken. It uses loop_dev which isn't defined. Please fix that, too :)

[CK] Thanks for reporting, I'll just send 017 with the fix and if I find generation counter issue, will resend both 016 and 017.