test/vhost: Add a simple fio test
You can run this at your desk as follows (from SPDK repo): sudo -E ./test/vhost/fio/fio.sh --iso Change-Id: Ib83e21e8b8450d1bfce6a0223642c4087f9f47dc Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463094 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
51672da05b
commit
236dbd9550
46
test/vhost/fio/fio.sh
Executable file
46
test/vhost/fio/fio.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
testdir=$(readlink -f $(dirname $0))
|
||||
rootdir=$(readlink -f $testdir/../../..)
|
||||
source $rootdir/test/common/autotest_common.sh
|
||||
source $rootdir/test/vhost/common.sh
|
||||
|
||||
MALLOC_BDEV_SIZE=128
|
||||
MALLOC_BLOCK_SIZE=512
|
||||
|
||||
vhosttestinit
|
||||
|
||||
#TODO: Both scsi and blk?
|
||||
|
||||
timing_enter vhost_fio
|
||||
|
||||
trap "at_app_exit; process_shm --id 0; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
vhost_run vhost0 "-m 0x1"
|
||||
|
||||
# Construct vhost scsi controller
|
||||
vhost_rpc vhost0 construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0
|
||||
vhost_rpc vhost0 construct_vhost_scsi_controller naa.VhostScsi0.0
|
||||
vhost_rpc vhost0 add_vhost_scsi_lun naa.VhostScsi0.0 0 "Malloc0"
|
||||
|
||||
# Start qemu based VM.
|
||||
vm_setup --os="$VM_IMAGE" --disk-type=spdk_vhost_scsi --disks="VhostScsi0" --vhost-name=vhost0 --force=0
|
||||
vm_run 0
|
||||
vm_wait_for_boot 300 0
|
||||
sleep 5
|
||||
|
||||
# Run the fio workload on the VM
|
||||
vm_scp 0 $testdir/vhost_fio.job 127.0.0.1:/root/vhost_fio.job
|
||||
vm_exec 0 "fio /root/vhost_fio.job"
|
||||
|
||||
# Shut the VM down
|
||||
vm_shutdown_all
|
||||
|
||||
# Shut vhost down
|
||||
vhost_kill vhost0
|
||||
|
||||
trap - SIGINT SIGTERM EXIT
|
||||
|
||||
vhosttestfini
|
||||
timing_exit vhost_fio
|
19
test/vhost/fio/vhost_fio.job
Normal file
19
test/vhost/fio/vhost_fio.job
Normal file
@ -0,0 +1,19 @@
|
||||
[global]
|
||||
blocksize=4k-512k
|
||||
iodepth=128
|
||||
ioengine=libaio
|
||||
filename=/dev/sdb
|
||||
group_reporting
|
||||
thread
|
||||
numjobs=1
|
||||
direct=1
|
||||
do_verify=1
|
||||
verify=md5
|
||||
verify_fatal=1
|
||||
verify_dump=1
|
||||
verify_backlog=8
|
||||
|
||||
[randwrite]
|
||||
rw=randwrite
|
||||
runtime=15
|
||||
time_based
|
Loading…
Reference in New Issue
Block a user