diff mbox series

[blktests,1/2] nvme: handle model attr in subsys create helper

Message ID 20191030195258.31108-2-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series nvme: add a new test to check model attr | expand

Commit Message

Chaitanya Kulkarni Oct. 30, 2019, 7:52 p.m. UTC
This patch allows _create_nvmet_subsystem to handle and optionally
set model attribute for the subsys.
---
 tests/nvme/rc | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Chaitanya Kulkarni Nov. 1, 2019, 7:42 a.m. UTC | #1
On 10/30/2019 12:53 PM, Chaitanya Kulkarni wrote:
> This patch allows _create_nvmet_subsystem to handle and optionally
> set model attribute for the subsys.

Will send out updated version along with kernel patch.
diff mbox series

Patch

diff --git a/tests/nvme/rc b/tests/nvme/rc
index 40f0413..2d11e2e 100644
--- a/tests/nvme/rc
+++ b/tests/nvme/rc
@@ -121,10 +121,14 @@  _create_nvmet_subsystem() {
 	local nvmet_subsystem="$1"
 	local blkdev="$2"
 	local uuid=$3
+	local model=$4
 	local cfs_path="${NVMET_CFS}/subsystems/${nvmet_subsystem}"
 
 	mkdir -p "${cfs_path}"
 	echo 1 > "${cfs_path}/attr_allow_any_host"
+	if [ -f "${cfs_path}/attr_model" ] && [ ! -z ${model+x} ]; then
+		echo -n ${model} > "${cfs_path}/attr_model"
+	fi
 	_create_nvmet_ns "${nvmet_subsystem}" "1" "${blkdev}" "${uuid}"
 }