[PATCH 05/10] nvme/rc: add more arguments to _nvme_connect_subsys()
Shinichiro Kawasaki
shinichiro.kawasaki at wdc.com
Mon Jun 13 21:23:49 PDT 2022
On Jun 10, 2022 / 13:33, Hannes Reinecke wrote:
> From: Hannes Reinecke <hare at suse.com>
>
> Add optional arguments for setting 'hostnqn', 'hostid', 'hostkey',
> and 'ctrlkey' to _nvme_connect_subsys() to make it usable for
> testing nvme in-band authentication.
>
> Signed-off-by: Hannes Reinecke <hare at suse.de>
> ---
> tests/nvme/rc | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/tests/nvme/rc b/tests/nvme/rc
> index 2873037..b7bb3cd 100644
> --- a/tests/nvme/rc
> +++ b/tests/nvme/rc
> @@ -190,11 +190,27 @@ _nvme_connect_subsys() {
> local subsysnqn="$2"
> local traddr="${3:-$def_traddr}"
> local trsvcid="${4:-$def_trsvcid}"
> + local hostnqn="${5:-$def_hostnqn}"
> + local hostid="${6:-$def_hostid}"
I can not find def_hostnqn and def_hostid defined. Did they slip out from this
series?
> + local hostkey="${7}"
> + local ctrlkey="${8}"
>
> ARGS=(-t "${trtype}" -n "${subsysnqn}")
> if [[ "${trtype}" != "loop" ]]; then
> ARGS+=(-a "${traddr}" -s "${trsvcid}")
> fi
> + if [[ "${hostnqn}" != "$def_hostnqn" ]]; then
> + ARGS+=(--hostnqn="${hostnqn}")
> + fi
> + if [[ "${hostid}" != "$def_hostid" ]]; then
> + ARGS+=(--hostid="${hostid}")
> + fi
> + if [[ -n "${hostkey}" ]]; then
> + ARGS+=(--dhchap-secret="${hostkey}")
> + fi
> + if [[ -n "${ctrlkey}" ]]; then
> + ARGS+=(--dhchap-ctrl-secret="${ctrlkey}")
> + fi
> nvme connect "${ARGS[@]}"
> }
>
> --
> 2.26.2
>
>
--
Shin'ichiro Kawasaki
More information about the Linux-nvme
mailing list