test/vhost_boot: Use string to check for disk device

The check if $id is a block device was being performed on the host's
side instead of the VM's. Replace that with a string matching the
target device on the VM.

Fixes issue #2810

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I964bb24eeea2fc5a4c2eacbbf6c97606303b2ebd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15762
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Michal Berger 2022-12-02 09:50:38 +01:00 committed by Konrad Sztyber
parent 1f4a8945d1
commit 817c39a1a2

View File

@ -108,7 +108,7 @@ timing_exit setup_vm
start_part_sector=0 drive_size=0 start_part_sector=0 drive_size=0
while IFS=":" read -r id start end _; do while IFS=":" read -r id start end _; do
start=${start%s} end=${end%s} start=${start%s} end=${end%s}
[[ -b $id ]] && drive_size=$start [[ $id == /dev/sda ]] && drive_size=$start
[[ $id =~ ^[0-9]+$ ]] && start_part_sector=$((end + 1)) [[ $id =~ ^[0-9]+$ ]] && start_part_sector=$((end + 1))
done < <(vm_exec "$vm_no" "parted /dev/sda -ms unit s print") done < <(vm_exec "$vm_no" "parted /dev/sda -ms unit s print")