[PATCH 6/9] nvme/041: test different key types
Sagi Grimberg
sagi at grimberg.me
Mon Nov 22 00:58:51 PST 2021
On 11/22/21 9:55 AM, Hannes Reinecke wrote:
> Signed-off-by: Hannes Reinecke <hare at suse.de>
> ---
> tests/nvme/041 | 102 +++++++++++++++++++++++++++++++++++++++++++++
> tests/nvme/041.out | 36 ++++++++++++++++
> 2 files changed, 138 insertions(+)
> create mode 100644 tests/nvme/041
> create mode 100644 tests/nvme/041.out
>
> diff --git a/tests/nvme/041 b/tests/nvme/041
> new file mode 100644
> index 0000000..8fc4ab9
> --- /dev/null
> +++ b/tests/nvme/041
> @@ -0,0 +1,102 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-3.0+
> +# Copyright (C) 2021 Hannes Reinecke, SUSE Labs
> +#
> +# Test nvme over tcp dhchap keys
> +
> +. tests/nvme/rc
> +
> +DESCRIPTION="Test dhchap keys for authenticated TCP connection via localhost"
> +QUICK=1
> +
> +requires() {
> + _nvme_requires
> + _have_modules loop
> + _require_nvme_trtype_is_fabrics
> +}
> +
> +
> +test() {
> + local port
> + local genctr
> + local subsys="blktests-subsystem-"
> + local hostid="$(uuidgen)"
> + local hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
> + local scratch="/tmp/blktest-ns1.img"
> + local nvme_trtype="tcp"
> + local hostkey
> +
> + echo "Running ${TEST_NAME}"
> +
> + hostkey="$(nvme gen-dhchap-key -n ${subsys}1 2> /dev/null)"
> + if [ $? -ne 0 ] ; then
> + echo "nvme gen-dhchap-key command missing"
> + return 1
> + fi
Don't we want to test different secret formats?
More information about the Linux-nvme
mailing list