[PATCH 06/10] nvme/039: create authenticated connections
Hannes Reinecke
hare at suse.de
Mon Dec 13 23:09:10 PST 2021
On 12/13/21 11:55 PM, Chaitanya Kulkarni wrote:
> On 11/22/21 11:49 PM, Hannes Reinecke wrote:
>> Signed-off-by: Hannes Reinecke <hare at suse.de>
>> ---
>> tests/nvme/039 | 83 ++++++++++++++++++++++++++++++++++++++++++++++
>> tests/nvme/039.out | 7 ++++
>> 2 files changed, 90 insertions(+)
>> create mode 100644 tests/nvme/039
>> create mode 100644 tests/nvme/039.out
>>
>> diff --git a/tests/nvme/039 b/tests/nvme/039
>> new file mode 100644
>> index 0000000..4fbe7de
>> --- /dev/null
>> +++ b/tests/nvme/039
>> @@ -0,0 +1,83 @@
>> +#!/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_modules loop
>> + _require_nvme_trtype_is_fabrics
>> + _require_nvme_cli_auth
>> +}
>> +
>> +
>> +test() {
>> + local port
>> + local subsys="blktests-subsystem-1"
>> + local hostid="$(uuidgen)"
>> + local hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}"
>> + local scratch="/tmp/blktest-ns1.img"
>> + local hostkey
>> + local ctrldev
>> +
>> + echo "Running ${TEST_NAME}"
>> +
>> + hostkey="$(nvme gen-dhchap-key -n ${subsys} 2> /dev/null)"
>> + if [ $? -ne 0 ] ; then
>> + echo "nvme gen-dhchap-key command missing"
>> + return 1
>> + fi
>> +
>
> We add following in the patch 4 that is called in requires of this
> testcase, by any chance above check for gen-dhcap-key is duplicate ? :-
>
> +_require_nvme_cli_auth() {
> + local hostkey
> +
> + hostkey="$(nvme gen-dhchap-key -n nvmf-test-subsys 2> /dev/null)"
> + if [ $? -ne 0 ] ; then
> + SKIP_REASON="nvme gen-dhchap-key command missing"
> + return 1
> + fi
> + return 0
> +}
> +
>
You are right, this can be removed.
Will be resubmitting.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer
More information about the Linux-nvme
mailing list