2018-07-12 10:22:17 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-05-10 10:54:24 -07:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
source $rootdir/test/vhost/common.sh
|
|
|
|
|
2019-05-10 11:57:39 -07:00
|
|
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"
|
2018-07-12 10:22:17 -04:00
|
|
|
|
|
|
|
function run_spdk_fio() {
|
2019-05-30 02:59:51 -04:00
|
|
|
fio_bdev --ioengine=spdk_bdev \
|
2019-05-10 10:54:24 -07:00
|
|
|
"$rootdir/test/vhost/common/fio_jobs/default_initiator.job" --runtime=10 --rw=randrw \
|
|
|
|
--spdk_mem=1024 --spdk_single_seg=1 --spdk_conf=$testdir/bdev.conf "$@"
|
2018-07-12 10:22:17 -04:00
|
|
|
}
|
|
|
|
|
2019-05-17 14:09:40 -07:00
|
|
|
vhosttestinit
|
|
|
|
|
2018-07-12 10:22:17 -04:00
|
|
|
trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT
|
|
|
|
|
2019-06-05 12:47:53 -07:00
|
|
|
vhost_run 0
|
2018-07-12 10:22:17 -04:00
|
|
|
|
|
|
|
$rpc_py construct_malloc_bdev -b Malloc 124 4096
|
|
|
|
$rpc_py construct_vhost_blk_controller Malloc.0 Malloc
|
|
|
|
|
|
|
|
run_spdk_fio --size=50% --offset=0 --filename=VirtioBlk0 &
|
|
|
|
run_fio_pid=$!
|
|
|
|
sleep 1
|
|
|
|
run_spdk_fio --size=50% --offset=50% --filename=VirtioBlk0
|
|
|
|
wait $run_fio_pid
|
2019-06-03 14:29:20 -07:00
|
|
|
vhost_kill
|
2019-05-17 14:09:40 -07:00
|
|
|
|
|
|
|
vhosttestfini
|