All of lore.kernel.org
 help / color / mirror / Atom feed
From: chaitanya.kulkarni@wdc.com (Chaitanya Kulkarni)
Subject: [PATCH V2 blktests 07/12] nvme: add NVMeOF effects-log test for file-ns
Date: Tue,  4 Sep 2018 12:32:59 -0700	[thread overview]
Message-ID: <20180904193304.13350-8-chaitanya.kulkarni@wdc.com> (raw)
In-Reply-To: <20180904193304.13350-1-chaitanya.kulkarni@wdc.com>

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

  parent reply	other threads:[~2018-09-04 19:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Chaitanya Kulkarni [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180904193304.13350-8-chaitanya.kulkarni@wdc.com \
    --to=chaitanya.kulkarni@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.