diff mbox series

[blktests] nvme/43: use a valid hostkey

Message ID 20230703182549.971324-1-alan.adamson@oracle.com (mailing list archive)
State New, archived
Headers show
Series [blktests] nvme/43: use a valid hostkey | expand

Commit Message

Alan Adamson July 3, 2023, 6:25 p.m. UTC
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@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
---
 tests/nvme/043 | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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