Spdk/test/lib/bdev/blockdev.sh
Ben Walker fd4cb17f81 test: Add a bdev management service
This allows us to query and configure the bdev
modules much more dynamically.

Change-Id: I11f757039892f4353721be422317b641d72bd2a9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370584
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 18:04:55 -04:00

51 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../../..)
source $rootdir/scripts/autotest_common.sh
testdir=$(readlink -f $(dirname $0))
timing_enter blockdev
cp $testdir/bdev.conf.in $testdir/bdev.conf
$rootdir/scripts/gen_nvme.sh >> $testdir/bdev.conf
timing_enter bounds
$testdir/bdevio/bdevio $testdir/bdev.conf
timing_exit bounds
if grep -q Nvme0 $testdir/bdev.conf; then
part_dev_by_gpt $testdir/bdev.conf Nvme0n1 $rootdir
fi
timing_enter bdev_svc
bdevs=$(discover_bdevs $rootdir $testdir/bdev.conf | jq -r '.[] | select(.bdev_opened_for_write == false) | .name')
timing_exit bdev_svc
timing_enter verify
$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 32 -s 4096 -w verify -t 1
timing_exit verify
if [ $RUN_NIGHTLY -eq 1 ]; then
# Use size 192KB which both exceeds typical 128KB max NVMe I/O
# size and will cross 128KB Intel DC P3700 stripe boundaries.
timing_enter perf
$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 128 -w read -s 196608 -t 5
timing_exit perf
# Temporarily disabled - infinite loop
#timing_enter reset
#$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 16 -w reset -s 4096 -t 60
#timing_exit reset
timing_enter unmap
$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 1 -w unmap -s 4096 -t 60
timing_exit unmap
fi
rm -f $testdir/bdev.conf
timing_exit blockdev