From: Logan Gunthorpe Date: Thu, 8 Oct 2020 16:40:22 +0000 (-0600) Subject: nvme/036: Add test for testing reset command on nvme-passthru X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9076b98a72cc10cabc03e6606c70140873e9c7fb;p=users%2Fhch%2Fblktests.git nvme/036: Add test for testing reset command on nvme-passthru Similar to test 022 but for passthru controllers. Signed-off-by: Logan Gunthorpe --- diff --git a/tests/nvme/036 b/tests/nvme/036 new file mode 100755 index 0000000..8218c65 --- /dev/null +++ b/tests/nvme/036 @@ -0,0 +1,37 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2019 Logan Gunthorpe +# Copyright (C) 2019 Eideticom Communications Inc. + +. tests/nvme/rc + +DESCRIPTION="test NVMe reset command on an NVMeOF target with a passthru controller" +QUICK=1 + +requires() { + _nvme_requires + _have_kernel_option NVME_TARGET_PASSTHRU +} + +test_device() { + local subsys="blktests-subsystem-1" + local ctrldev + local port + + echo "Running ${TEST_NAME}" + + _setup_nvmet + port=$(_nvmet_passthru_target_setup "${subsys}") + nsdev=$(_nvmet_passthru_target_connect "${nvme_trtype}" "${subsys}") + + ctrldev=$(_find_nvme_dev "${subsys}") + + if ! nvme reset "/dev/${ctrldev}" >> "$FULL" 2>&1; then + echo "ERROR: reset failed" + fi + + _nvme_disconnect_subsys "${subsys}" + _nvmet_passthru_target_cleanup "${port}" "${subsys}" + + echo "Test complete" +} diff --git a/tests/nvme/036.out b/tests/nvme/036.out new file mode 100644 index 0000000..d294f86 --- /dev/null +++ b/tests/nvme/036.out @@ -0,0 +1,3 @@ +Running nvme/036 +NQN:blktests-subsystem-1 disconnected 1 controller(s) +Test complete