1#!/usr/bin/env bash 2 3SYSTEM=`uname -s` 4if [ $SYSTEM = "FreeBSD" ] ; then 5 echo "blob_io_wait.sh cannot run on FreeBSD currently." 6 exit 0 7fi 8 9testdir=$(readlink -f $(dirname $0)) 10rootdir=$(readlink -f $testdir/../../..) 11source $rootdir/test/common/autotest_common.sh 12source $rootdir/test/nvmf/common.sh 13rpc_py="python $rootdir/scripts/rpc.py" 14set -e 15 16timing_enter blob_bdev_io_wait 17 18truncate -s 64M $testdir/aio.bdev 19 20$rootdir/test/app/bdev_svc/bdev_svc & 21bdev_svc_pid=$! 22 23trap "killprocess $bdev_svc_pid; exit 1" SIGINT SIGTERM EXIT 24 25waitforlisten $bdev_svc_pid 26$rpc_py construct_aio_bdev $testdir/aio.bdev aio0 4096 27$rpc_py construct_lvol_store aio0 lvs0 28$rpc_py construct_lvol_bdev -l lvs0 lvol0 32 29 30killprocess $bdev_svc_pid 31 32# Minimal number of bdev io pool (128) and cache (1) 33echo "[Bdev]" > $testdir/bdevperf.conf 34echo "BdevIoPoolSize 128" >> $testdir/bdevperf.conf 35echo "BdevIoCacheSize 1" >> $testdir/bdevperf.conf 36echo "[AIO]" >> $testdir/bdevperf.conf 37echo "AIO $testdir/aio.bdev aio0 4096" >> $testdir/bdevperf.conf 38 39$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w write -t 1 40$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w read -t 1 41$rootdir/test/bdev/bdevperf/bdevperf -c $testdir/bdevperf.conf -q 128 -o 4096 -w unmap -t 1 42 43sync 44rm -rf $testdir/bdevperf.conf 45rm -rf $testdir/aio.bdev 46trap - SIGINT SIGTERM EXIT 47 48report_test_completion "blob_io_wait" 49timing_exit bdev_io_wait 50