2018-07-12 14:22:17 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-05-10 17:54:24 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
source $rootdir/test/vhost/common.sh
|
|
|
|
|
2019-06-04 20:55:21 +00:00
|
|
|
rpc_py="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
|
2018-07-12 14:22:17 +00:00
|
|
|
|
|
|
|
function run_spdk_fio() {
|
2019-05-30 06:59:51 +00:00
|
|
|
fio_bdev --ioengine=spdk_bdev \
|
2019-05-10 17:54:24 +00:00
|
|
|
"$rootdir/test/vhost/common/fio_jobs/default_initiator.job" --runtime=10 --rw=randrw \
|
2020-01-27 16:36:50 +00:00
|
|
|
--spdk_mem=1024 --spdk_single_seg=1 --spdk_json_conf=$testdir/bdev.json "$@"
|
2018-07-12 14:22:17 +00:00
|
|
|
}
|
|
|
|
|
2019-05-17 21:09:40 +00:00
|
|
|
vhosttestinit
|
|
|
|
|
2018-07-12 14:22:17 +00:00
|
|
|
trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT
|
|
|
|
|
2019-06-05 19:47:53 +00:00
|
|
|
vhost_run 0
|
2018-07-12 14:22:17 +00:00
|
|
|
|
2019-08-09 11:15:35 +00:00
|
|
|
$rpc_py bdev_malloc_create -b Malloc 124 4096
|
2019-09-30 10:51:55 +00:00
|
|
|
$rpc_py vhost_create_blk_controller Malloc.0 Malloc
|
2018-07-12 14:22:17 +00:00
|
|
|
|
|
|
|
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-04 20:55:21 +00:00
|
|
|
vhost_kill 0
|
2019-05-17 21:09:40 +00:00
|
|
|
|
|
|
|
vhosttestfini
|