Commit a5dab6cf authored by Michal Berger's avatar Michal Berger Committed by Konrad Sztyber
Browse files

test/nvme/xnvme: Make sure nvme selected for tests is not used



Change-Id: Id2ce8c4f417abeb50407b766dda5fb4483a62712
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25422


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
parent 87650986
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -72,10 +72,18 @@ prep_nvme() {
	# Make sure io_poll gets enabled
	modprobe -r nvme
	modprobe nvme poll_queues=$(nproc)

	# As a last touch update xnvme_filename[@] with a device that we consider "free"
	local nvme
	for nvme in /dev/nvme*n!(*p*); do
		block_in_use "$nvme" && continue
		xnvme_filename["libaio"]=$nvme
		xnvme_filename["io_uring"]=$nvme
		xnvme_filename["io_uring_cmd"]=${nvme/nvme/ng}
		return 0
	done

	return 1
}

prep_nvme

for dev in "${xnvme_filename[@]}"; do
	[[ -e $dev ]]
done