Commit 766b1f62 authored by Pawel Kaminski's avatar Pawel Kaminski Committed by Jim Harris
Browse files

test/vhost: test multiple connections to a single vhost device



Two fio instancess will try to do simultaneous I/O
to a single vhost block device.

The test uses default_initiator.job as a fio config,
which apparently wasn't used anywhere and had to be
slightly adjusted to work. Specificaly, we had to
specify an empty job in the config file, as specifying
it from the command line wouldn't make it inherit
any options from the [global] section in the file.

Change-Id: I2c2a96a709c567f5c910715a5b3d85a4e28bcb97
Signed-off-by: default avatarPawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/419066


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent 1d0a8e1c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ if [ $SPDK_TEST_VHOST_INIT -eq 1 ]; then
	timing_enter vhost_initiator
	run_test suite ./test/vhost/initiator/blockdev.sh
	run_test suite ./test/spdkcli/virtio.sh
	run_test suite ./test/vhost/shared/shared.sh
	report_test_completion "vhost_initiator"
	timing_exit vhost_initiator
fi
+2 −0
Original line number Diff line number Diff line
@@ -7,3 +7,5 @@ do_verify=1
verify=md5
verify_backlog=1024
fsync_on_close=1
iodepth=32
[job0]
+5 −0
Original line number Diff line number Diff line
[VirtioUser0]
  Path Malloc.0
  Queues 2
  Type Blk
  Name VirtioBlk0
+30 −0
Original line number Diff line number Diff line
#!/usr/bin/env bash

set -e
SHARED_DIR=$(readlink -f $(dirname $0))
[[ -z "$COMMON_DIR" ]] && COMMON_DIR="$(cd $SHARED_DIR/../common && pwd)"
ROOT_DIR=$(readlink -f $SHARED_DIR/../../..)
source $COMMON_DIR/common.sh
PLUGIN_DIR=$ROOT_DIR/examples/bdev/fio_plugin
FIO_PATH="/usr/src/fio"
rpc_py="$SPDK_BUILD_DIR/scripts/rpc.py -s $(get_vhost_dir)/rpc.sock"

function run_spdk_fio() {
	LD_PRELOAD=$PLUGIN_DIR/fio_plugin $FIO_PATH/fio --ioengine=spdk_bdev \
	"$COMMON_DIR/fio_jobs/default_initiator.job" --runtime=10 --rw=randrw \
	--spdk_mem=1024 --spdk_single_seg=1 --spdk_conf=$SHARED_DIR/bdev.conf "$@"
}

trap 'error_exit "${FUNCNAME}" "${LINENO}"' ERR SIGTERM SIGABRT

spdk_vhost_run

$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
spdk_vhost_kill