[PATCH 6/9] nvme/041: test different key types
Hannes Reinecke
hare at suse.de
Mon Nov 22 01:25:43 PST 2021
On 11/22/21 9:58 AM, Sagi Grimberg wrote:
>
>
> 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?
We do.
But this is just a check if the nvme cli contains functionality for
generating keys in the first place.
Maybe we should make this a requirement (like
_requre_nvme_trtype_is_fabrics).
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, 90409 Nürnberg
GF: F. Imendörffer, HRB 36809 (AG Nürnberg)
More information about the Linux-nvme
mailing list