[PATCH 06/10] nvme/040: create authenticated connections
Shinichiro Kawasaki
shinichiro.kawasaki at wdc.com
Mon Jun 13 21:36:40 PDT 2022
On Jun 10, 2022 / 13:33, Hannes Reinecke wrote:
> Signed-off-by: Hannes Reinecke <hare at suse.de>
> ---
> tests/nvme/040 | 81 ++++++++++++++++++++++++++++++++++++++++++++++
> tests/nvme/040.out | 7 ++++
> 2 files changed, 88 insertions(+)
> create mode 100644 tests/nvme/040
> create mode 100644 tests/nvme/040.out
>
> diff --git a/tests/nvme/040 b/tests/nvme/040
> new file mode 100644
> index 0000000..ce6157f
> --- /dev/null
> +++ b/tests/nvme/040
> @@ -0,0 +1,81 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2021 Hannes Reinecke, SUSE Labs
> +#
> +# Create authenticated connections
> +
> +. tests/nvme/rc
> +
> +DESCRIPTION="Create authenticated connections"
> +QUICK=1
> +
> +requires() {
> + _nvme_requires
> + _have_loop
> + _require_nvme_trtype_is_fabrics
> + _require_nvme_cli_auth
> +}
> +
> +
> +test() {
> + local port
> + local subsys_name="blktests-subsystem-1"
> + local hostid="$(uuidgen)"
> + local hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
> + local file_path="${TMPDIR}/img"
> + local hostkey
> + local ctrldev
> +
> + echo "Running ${TEST_NAME}"
> +
> + hostkey="$(nvme gen-dhchap-key -n ${subsys_name} 2> /dev/null)"
> + if [ $? -ne 0 ] ; then
> + echo "nvme gen-dhchap-key command missing"
This message is a bit confusing. _require_nvme_cli_auth in requries() already
confirmed that nvme gen-dhchap-key command is not missing. I think "nvme
gen-dhchap-key command failed" is a bit better message here.
--
Shin'ichiro Kawasaki
More information about the Linux-nvme
mailing list