test/vhost: Replace old style config with json in initiator test
Change-Id: I622448dcd1de960793894395d7da55ebd612dcc7 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/529 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
2f551f09ce
commit
1fd96c85b4
@ -753,6 +753,7 @@ function discover_bdevs()
|
||||
{
|
||||
local rootdir=$1
|
||||
local config_file=$2
|
||||
local cfg_type=$3
|
||||
local rpc_server=/var/tmp/spdk-discover-bdevs.sock
|
||||
|
||||
if [ ! -e $config_file ]; then
|
||||
@ -760,10 +761,14 @@ function discover_bdevs()
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z $cfg_type ]; then
|
||||
cfg_type="-c"
|
||||
fi
|
||||
|
||||
# Start the bdev service to query for the list of available
|
||||
# bdevs.
|
||||
$rootdir/test/app/bdev_svc/bdev_svc -r $rpc_server -i 0 \
|
||||
-c $config_file &>/dev/null &
|
||||
$cfg_type $config_file &>/dev/null &
|
||||
stubpid=$!
|
||||
while ! [ -e /var/run/spdk_bdev0 ]; do
|
||||
sleep 1
|
||||
|
@ -1,21 +0,0 @@
|
||||
[VirtioUser0]
|
||||
Path naa.Nvme0n1_scsi0.0
|
||||
Queues 8
|
||||
|
||||
[VirtioUser1]
|
||||
Path naa.Malloc0.0
|
||||
Queues 8
|
||||
|
||||
[VirtioUser2]
|
||||
Path naa.Malloc1.0
|
||||
Queues 8
|
||||
|
||||
[VirtioUser3]
|
||||
Path naa.Nvme0n1_blk0.0
|
||||
Type Blk
|
||||
Queues 8
|
||||
|
||||
[VirtioUser4]
|
||||
Path naa.Nvme0n1_blk1.0
|
||||
Type Blk
|
||||
Queues 8
|
59
test/vhost/initiator/bdev.json
Normal file
59
test/vhost/initiator/bdev.json
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"subsystems": [
|
||||
{
|
||||
"config": [
|
||||
{
|
||||
"params": {
|
||||
"vq_count": 8,
|
||||
"dev_type": "scsi",
|
||||
"trtype": "user",
|
||||
"traddr": "naa.Nvme0n1_scsi0.0",
|
||||
"name": "VirtioScsi0"
|
||||
},
|
||||
"method": "bdev_virtio_attach_controller"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
"vq_count": 8,
|
||||
"dev_type": "scsi",
|
||||
"trtype": "user",
|
||||
"traddr": "naa.Malloc0.0",
|
||||
"name": "VirtioScsi1"
|
||||
},
|
||||
"method": "bdev_virtio_attach_controller"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
"vq_count": 8,
|
||||
"dev_type": "scsi",
|
||||
"trtype": "user",
|
||||
"traddr": "naa.Malloc1.0",
|
||||
"name": "VirtioScsi2"
|
||||
},
|
||||
"method": "bdev_virtio_attach_controller"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
"vq_count": 8,
|
||||
"dev_type": "blk",
|
||||
"trtype": "user",
|
||||
"traddr": "naa.Nvme0n1_blk0.0",
|
||||
"name": "VirtioBlk3"
|
||||
},
|
||||
"method": "bdev_virtio_attach_controller"
|
||||
},
|
||||
{
|
||||
"params": {
|
||||
"vq_count": 8,
|
||||
"dev_type": "blk",
|
||||
"trtype": "user",
|
||||
"traddr": "naa.Nvme0n1_blk1.0",
|
||||
"name": "VirtioBlk4"
|
||||
},
|
||||
"method": "bdev_virtio_attach_controller"
|
||||
}
|
||||
],
|
||||
"subsystem": "bdev"
|
||||
}
|
||||
]
|
||||
}
|
@ -82,7 +82,7 @@ function create_bdev_config()
|
||||
$RPC_PY vhost_create_scsi_controller naa.Malloc1.0
|
||||
$RPC_PY vhost_scsi_controller_add_target naa.Malloc1.0 0 Malloc1
|
||||
|
||||
vbdevs=$(discover_bdevs $rootdir $testdir/bdev.conf)
|
||||
vbdevs=$(discover_bdevs $rootdir $testdir/bdev.json "--json")
|
||||
virtio_bdevs=$(jq -r '[.[].name] | join(":")' <<< $vbdevs)
|
||||
virtio_with_unmap=$(jq -r '[.[] | select(.supported_io_types.unmap==true).name]
|
||||
| join(":")' <<< $vbdevs)
|
||||
@ -98,12 +98,11 @@ timing_exit create_bdev_config
|
||||
|
||||
timing_enter run_spdk_fio
|
||||
run_spdk_fio $testdir/bdev.fio --filename=$virtio_bdevs --section=job_randwrite --section=job_randrw \
|
||||
--section=job_write --section=job_rw --spdk_conf=$testdir/bdev.conf
|
||||
--section=job_write --section=job_rw --spdk_json_conf=$testdir/bdev.json
|
||||
timing_exit run_spdk_fio
|
||||
|
||||
timing_enter run_spdk_fio_unmap
|
||||
run_spdk_fio $testdir/bdev.fio --filename=$virtio_with_unmap --spdk_conf=$testdir/bdev.conf \
|
||||
--spdk_conf=$testdir/bdev.conf
|
||||
run_spdk_fio $testdir/bdev.fio --filename=$virtio_with_unmap --spdk_json_conf=$testdir/bdev.json
|
||||
timing_exit run_spdk_fio_unmap
|
||||
|
||||
$RPC_PY bdev_nvme_detach_controller Nvme0
|
||||
|
Loading…
Reference in New Issue
Block a user