2018-10-29 14:40:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
|
2019-06-10 07:16:46 +00:00
|
|
|
rpc_py=$rootdir/scripts/rpc.py
|
|
|
|
|
2019-02-07 10:35:21 +00:00
|
|
|
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
|
2018-10-29 14:40:34 +00:00
|
|
|
fi
|
|
|
|
|
2019-02-07 10:35:21 +00:00
|
|
|
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
|
|
|
|
|
2018-10-29 14:40:34 +00:00
|
|
|
timing_enter ftl
|
2019-03-07 11:36:23 +00:00
|
|
|
timing_enter bdevperf
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-03-07 11:36:23 +00:00
|
|
|
run_test suite $testdir/bdevperf.sh $device
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-03-07 11:36:23 +00:00
|
|
|
timing_exit bdevperf
|
2018-10-29 14:40:34 +00:00
|
|
|
|
|
|
|
timing_enter restore
|
2019-01-29 09:54:46 +00:00
|
|
|
run_test suite $testdir/restore.sh $device
|
2018-10-29 14:40:34 +00:00
|
|
|
timing_exit restore
|
|
|
|
|
2019-05-31 11:35:12 +00:00
|
|
|
timing_enter dirty_shutdown
|
|
|
|
run_test suite $testdir/dirty_shutdown.sh $device
|
|
|
|
timing_exit dirty_shutdown
|
|
|
|
|
2019-02-19 10:06:12 +00:00
|
|
|
timing_enter json
|
|
|
|
run_test suite $testdir/json.sh $device
|
|
|
|
timing_exit json
|
|
|
|
|
2019-01-29 09:54:46 +00:00
|
|
|
if [ $SPDK_TEST_FTL_EXTENDED -eq 1 ]; then
|
2019-03-20 09:03:46 +00:00
|
|
|
timing_enter fio_basic
|
|
|
|
run_test suite $testdir/fio.sh $device basic
|
|
|
|
timing_exit fio_basic
|
|
|
|
|
2019-01-29 09:54:46 +00:00
|
|
|
$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
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-01-29 09:54:46 +00:00
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
|
|
|
|
timing_enter fio_extended
|
2019-03-20 09:03:46 +00:00
|
|
|
run_test suite $testdir/fio.sh $device extended $uuid
|
2019-01-29 09:54:46 +00:00
|
|
|
timing_exit fio_extended
|
|
|
|
fi
|
|
|
|
|
|
|
|
timing_exit ftl
|