Re: [PATCH 1/6] nvmeof-tcp/001: simple test for nvmeof-tcp connection
From: Hannes Reinecke <hare@suse.de>
Date: 2021-11-14 13:50:46
On 11/14/21 11:31 AM, Sagi Grimberg wrote:
quoted
Signed-off-by: Hannes Reinecke <hare@suse.de> --- tests/nvmeof-tcp/001 | 55 +++++++ tests/nvmeof-tcp/001.out | 6 + tests/nvmeof-tcp/rc | 347 +++++++++++++++++++++++++++++++++++++++Why another directory? why nvmeof-tcp? what prevents inband-auth to be tested with loop/rdma?
Technically, nothing. But as I'll be looking into tcp in-band _encryption_ as the next step I found it logical to have a disinct directory. Especially as I still fail to see the actual use-case for using in-band authentication _without_ encryption. We could rename it to nvmeof-auth, though. Especially as there's the nvmeof-mp precedent, which also has a separate directory.
quoted
3 files changed, 408 insertions(+) create mode 100644 tests/nvmeof-tcp/001 create mode 100644 tests/nvmeof-tcp/001.out create mode 100644 tests/nvmeof-tcp/rcdiff --git a/tests/nvmeof-tcp/001 b/tests/nvmeof-tcp/001 new file mode 100644 index 0000000..39f4108 --- /dev/null +++ b/tests/nvmeof-tcp/001@@ -0,0 +1,55 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2021 Hannes Reinecke, SUSE Labs +# +# Test nvme over tcp connection + +. tests/nvmeof-tcp/rc + +DESCRIPTION="Create single 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" + + echo "Running ${TEST_NAME}" + + _setup_nvmet + + truncate -s 512M "${scratch}" + + port="$(_create_nvmet_port "${nvme_trtype}")" + + _create_nvmet_subsystem "${subsys}1" "${scratch}" + _add_nvmet_subsys_to_port "${port}" "${subsys}1" + _create_nvmet_host "${subsys}1" "${hostnqn}" + + nvme connect -t "${nvme_trtype}" -n "${subsys}1" \ + -a "${def_traddr}" -s "${def_trsvcid}" \ + --hostnqn="${hostnqn}" --hostid="${hostid}" + + nvme list-subsys + + nvme disconnect -n "${subsys}1" + + _remove_nvmet_subsystem_from_port "${port}" "${subsys}1" + _remove_nvmet_subsystem "${subsys}1" + + _remove_nvmet_port "${port}" + + rm ${scratch} + + echo "Test complete" +}diff --git a/tests/nvmeof-tcp/001.out b/tests/nvmeof-tcp/001.out new file mode 100644 index 0000000..1eae834 --- /dev/null +++ b/tests/nvmeof-tcp/001.out@@ -0,0 +1,6 @@ +Running nvmeof-tcp/001 +nvme-subsys0 - NQN=blktests-subsystem-1 +\ + +- nvme0 tcp traddr=127.0.0.1,trsvcid=4420 live +NQN:blktests-subsystem-1 disconnected 1 controller(s) +Test completediff --git a/tests/nvmeof-tcp/rc b/tests/nvmeof-tcp/rc new file mode 100644 index 0000000..9ae0899 --- /dev/null +++ b/tests/nvmeof-tcp/rc@@ -0,0 +1,347 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2018 Johannes Thumshirn +# +# Test specific to NVMe devicesIsn't this just a copy of nvme/rc?
Essentially, yes. And I'd be happy to merge them, like having a common nvme rc file to be used for all nvme related tests. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@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