Mateusz Kozlowski 5094302f5a test/ftl: Changed bdev_svc usage to spdk_tgt
Changed all ftl tests to use spdk_tgt instead.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ibb19b233f5cb855e1b6edb41145890e5b103493c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461213
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-23 04:09:32 +00:00

72 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
rpc_py=$rootdir/scripts/rpc.py
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 bdevperf
run_test suite $testdir/bdevperf.sh $device
timing_exit bdevperf
timing_enter restore
run_test suite $testdir/restore.sh $device
timing_exit restore
timing_enter dirty_shutdown
run_test suite $testdir/dirty_shutdown.sh $device
timing_exit dirty_shutdown
timing_enter json
run_test suite $testdir/json.sh $device
timing_exit json
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
timing_enter fio_basic
run_test suite $testdir/fio.sh $device basic
timing_exit fio_basic
$rootdir/app/spdk_tgt/spdk_tgt &
svc_pid=$!
trap "killprocess $svc_pid; exit 1" SIGINT SIGTERM EXIT
waitforlisten $svc_pid
uuid=$($rpc_py construct_ftl_bdev -b nvme0 -a $device -l 0-3 | jq -r '.uuid')
killprocess $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