2018-10-29 14:40:34 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
|
|
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
|
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
|
2018-10-29 14:40:34 +00:00
|
|
|
}
|
|
|
|
|
2019-02-07 10:35:21 +00:00
|
|
|
read device _ <<< "$OCSSD_PCI_DEVICES"
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-02-07 10:35:21 +00:00
|
|
|
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
|
|
|
|
run_test suite $testdir/restore.sh $device $uuid
|
|
|
|
timing_exit restore
|
|
|
|
|
|
|
|
timing_exit ftl
|
|
|
|
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
2019-03-07 11:36:23 +00:00
|
|
|
at_ftl_exit
|