Spdk/test/vhost/fio/fio.sh
paul luse eb53c23236 add (c) and SPDX header to bash files as needed
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc)

For intel copyrights added, --follow and -C95% were used.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2ef86976095b88a9bf5b1003e59f3943cd6bbe4c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15209
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-29 08:27:51 +00:00

62 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (C) 2019 Intel Corporation
# All rights reserved.
#
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 -n vhost0 -a "-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