Pawel Wodkowski b7d5bae1f3 test/ftl: use OCSSD instead first NVMe like
Change-Id: I175bebb68ea1752fda6fe80932cd27c30cf3dcff
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443737
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-02-15 21:43:36 +00:00

62 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
rpc_py=$rootdir/scripts/rpc.py
source $rootdir/test/common/autotest_common.sh
function at_ftl_exit() {
# restore original driver
PCI_WHITELIST="$device" PCI_BLACKLIST="" DRIVER_OVERRIDE="$ocssd_original_dirver" ./scripts/setup.sh
}
read device _ <<< "$OCSSD_PCI_DEVICES"
if [[ -z "$device" ]]; then
echo "OCSSD device list is empty."
echo "This test require that OCSSD_PCI_DEVICES environment variable to be set"
echo "and point to OCSSD devices PCI BDF. You can specify multiple space"
echo "separated BDFs in this case first one will be used."
exit 1
fi
ocssd_original_dirver="$(basename $(readlink /sys/bus/pci/devices/$device/driver))"
trap "at_ftl_exit" SIGINT SIGTERM EXIT
# OCSSD is blacklisted so bind it to vfio/uio driver before testing
PCI_WHITELIST="$device" PCI_BLACKLIST="" DRIVER_OVERRIDE="" ./scripts/setup.sh
timing_enter ftl
timing_enter fio
run_test suite $testdir/fio.sh $device basic
timing_exit fio
timing_enter restore
run_test suite $testdir/restore.sh $device
timing_exit restore
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
$rootdir/test/app/bdev_svc/bdev_svc &
bdev_svc_pid=$!
trap "killprocess $bdev_svc_pid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $bdev_svc_pid
uuid=$($rpc_py construct_ftl_bdev -b nvme0 -a $device -l 0-3 | jq -r '.uuid')
killprocess $bdev_svc_pid
trap - SIGINT SIGTERM EXIT
timing_enter fio_extended
run_test suite $testdir/fio.sh $device extended $uuid
timing_exit fio_extended
fi
timing_exit ftl