summaryrefslogtreecommitdiffstats
path: root/src/spdk/test/vhost/fio
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/spdk/test/vhost/fio
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/spdk/test/vhost/fio')
-rwxr-xr-xsrc/spdk/test/vhost/fio/fio.sh58
-rw-r--r--src/spdk/test/vhost/fio/vhost_fio.job19
2 files changed, 77 insertions, 0 deletions
diff --git a/src/spdk/test/vhost/fio/fio.sh b/src/spdk/test/vhost/fio/fio.sh
new file mode 100755
index 000000000..3d8bf6092
--- /dev/null
+++ b/src/spdk/test/vhost/fio/fio.sh
@@ -0,0 +1,58 @@
+#!/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"
+
+# Create vhost scsi controller
+vhost_rpc vhost0 bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc0
+vhost_rpc vhost0 vhost_create_scsi_controller naa.VhostScsi0.0
+vhost_rpc vhost0 vhost_scsi_controller_add_target naa.VhostScsi0.0 0 "Malloc0"
+
+# Create vhost blk controller
+vhost_rpc vhost0 bdev_malloc_create $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE -b Malloc1
+vhost_rpc vhost0 vhost_create_blk_controller naa.Malloc1.1 Malloc1
+
+# Start qemu based VMs
+vm_setup --os="$VM_IMAGE" --disk-type=spdk_vhost_scsi --disks="VhostScsi0" --vhost-name=vhost0 --force=0
+vm_setup --os="$VM_IMAGE" --disk-type=spdk_vhost_blk --disks="Malloc1" --vhost-name=vhost0 --force=1
+
+vm_run 0
+vm_run 1
+
+vm_wait_for_boot 300 0
+vm_wait_for_boot 300 1
+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"
+
+vm_scp 1 $testdir/vhost_fio.job 127.0.0.1:/root/vhost_fio.job
+vm_exec 1 "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
diff --git a/src/spdk/test/vhost/fio/vhost_fio.job b/src/spdk/test/vhost/fio/vhost_fio.job
new file mode 100644
index 000000000..350aa895e
--- /dev/null
+++ b/src/spdk/test/vhost/fio/vhost_fio.job
@@ -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