Commit 7cd8de9c authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

test/vhost: Avoid globbing in the vm_exec() argument



Since the command including * was being passed unquoted, the actual
pattern was being expanded on the host side. This became problematic
when multiple nvme drives were installed inside the host, e.g. the
command on the VM side was looking for a specific ctrl which didn't
exist there. Fix that by passing the full command as a literal string.

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


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
parent 030bbebe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1033,7 +1033,7 @@ function vm_check_blk_location() {
}

function vm_check_nvme_location() {
	SCSI_DISK="$(vm_exec $1 grep -l SPDK /sys/class/nvme/*/model | awk -F/ '{print $5"n1"}')"
	SCSI_DISK="$(vm_exec $1 "grep -l SPDK /sys/class/nvme/*/model" | awk -F/ '{print $5"n1"}')"
	if [[ -z "$SCSI_DISK" ]]; then
		error "no vfio-user nvme test disk found!"
		return 1