new file mode 100755
@@ -0,0 +1,64 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2017-2018 Western Digital Corporation or its affiliates.
+#
+# Test NVMeOF target model attributes.
+
+. tests/nvme/rc
+
+DESCRIPTION="Test NVMeOF target model attribute"
+QUICK=1
+
+PORT=""
+NVMEDEV=""
+LOOP_DEV=""
+MODEL="test~model"
+FILE_PATH="$TMPDIR/img"
+SUBSYS_NAME="blktests-subsystem-1"
+
+_have_model()
+
+{
+ _setup_nvmet
+ truncate -s 1G "${FILE_PATH}"
+ LOOP_DEV="$(losetup -f --show "${FILE_PATH}")"
+
+ # we can only know skip reason when we create a subsys
+ _create_nvmet_subsystem "${SUBSYS_NAME}" "${LOOP_DEV}" \
+ "91fdba0d-f87b-4c25-b80f-db7be1418b9e" 14 15 \
+ ${MODEL}
+}
+
+requires() {
+ _have_program nvme && _have_modules loop nvme-loop nvmet && \
+ _have_configfs && _have_model
+}
+
+test() {
+ echo "Running ${TEST_NAME}"
+
+ PORT="$(_create_nvmet_port "loop")"
+ _add_nvmet_subsys_to_port "${PORT}" "${SUBSYS_NAME}"
+
+ nvme connect -t loop -n "${SUBSYS_NAME}"
+
+ udevadm settle
+
+ NVMEDEV="$(_find_nvme_loop_dev)"
+ nvme list | grep "${NVMEDEV}"n1 | grep -q "${MODEL}"
+ result=$?
+
+ 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}"
+
+ if [ ${result} -eq 0 ]; then
+ echo "Test complete"
+ fi
+}
new file mode 100644
@@ -0,0 +1,3 @@
+Running nvme/034
+NQN:blktests-subsystem-1 disconnected 1 controller(s)
+Test complete
The new testcases exercises newly added model attribute for NVMeOF target. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- tests/nvme/034 | 64 ++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/034.out | 3 +++ 2 files changed, 67 insertions(+) create mode 100755 tests/nvme/034 create mode 100644 tests/nvme/034.out