Commit f846377c authored by Boris Glimcher's avatar Boris Glimcher Committed by Tomasz Zawadzki
Browse files

test/nvmf: add asynchronous NVMe/TLS initialization test



The test verifies that the NVMe/TLS driver initialization is
asynchronous. This is an addition to already existing async
NVMe tests. This test attaches NVMe bdev by connecting back
to itself, with the target app running on a single core.

This verifies that the initialization is completely
asynchronous, as each blocking call would stall the application.

Change-Id: I9977e06f4f0ee292c6ce529d9a2230434759f3f4
Signed-off-by: default avatarBoris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19137


Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 5c23b7b1
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -49,5 +49,30 @@ $rpc_py bdev_get_bdevs -b ${nvme_bdev}n1
# Finally, detach the controller to verify the detach path
$rpc_py bdev_nvme_detach_controller $nvme_bdev

# Add new listener with TLS using PSK
key_path=$(mktemp)
echo -n "NVMeTLSkey-1:01:MDAxMTIyMzM0NDU1NjY3Nzg4OTlhYWJiY2NkZGVlZmZwJEiQ:" > $key_path
chmod 0600 $key_path
$rpc_py nvmf_subsystem_allow_any_host nqn.2016-06.io.spdk:cnode0 --disable
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT \
	-a $NVMF_FIRST_TARGET_IP -s $NVMF_SECOND_PORT --secure-channel
$rpc_py nvmf_subsystem_add_host nqn.2016-06.io.spdk:cnode0 nqn.2016-06.io.spdk:host1 \
	--psk $key_path

# Then attach NVMe bdev by connecting back to itself, with the target app running on a single core.
# This verifies that the initialization is completely asynchronous, as each blocking call would
# stall the application.
$rpc_py bdev_nvme_attach_controller -b $nvme_bdev -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP \
	-f ipv4 -s $NVMF_SECOND_PORT -n nqn.2016-06.io.spdk:cnode0 -q nqn.2016-06.io.spdk:host1 --psk $key_path

# Make sure the bdev was created successfully
$rpc_py bdev_get_bdevs -b ${nvme_bdev}n1

# Finally, detach the controller to verify the detach path
$rpc_py bdev_nvme_detach_controller $nvme_bdev

# cleanup
rm -f $key_path

trap - SIGINT SIGTERM EXIT
nvmftestfini