[PATCH blktests] nvme/43: use a valid hostkey

Alan Adamson alan.adamson at oracle.com
Mon Jul 3 11:25:49 PDT 2023


The test does not generate a hostkey and uses a NULL when setting
up and connecting to a target. The test passes, but a valid hotkey
should be used. This patch generates a valid hostkey and uses it
when setting up the target.

Signed-off-by: Alan Adamson <alan.adamson at oracle.com>
Reviewed-by: Hannes Reinecke <hare at suse.de>
---
 tests/nvme/043 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/nvme/043 b/tests/nvme/043
index a030884aa4ed..d498fd7ae885 100755
--- a/tests/nvme/043
+++ b/tests/nvme/043
@@ -39,6 +39,11 @@ test() {
 		return 1
 	fi
 	hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
+	hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
+	if [ -z "$hostkey" ] ; then
+		echo "nvme gen-dhchap-key failed"
+		return 1
+	fi
 
 	_setup_nvmet
 
-- 
2.31.1




More information about the Linux-nvme mailing list