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-18 13:19:06 +00:00
|
|
|
source $testdir/common.sh
|
2018-10-29 14:40:34 +00:00
|
|
|
|
2019-02-07 10:35:21 +00:00
|
|
|
function at_ftl_exit() {
|
|
|
|
# restore original driver
|
2020-11-25 20:31:42 +00:00
|
|
|
PCI_ALLOWED="$device" PCI_BLOCKED="" DRIVER_OVERRIDE="$ocssd_original_dirver" $rootdir/scripts/setup.sh
|
2019-02-07 10:35:21 +00:00
|
|
|
}
|
|
|
|
|
2019-10-21 10:14:41 +00:00
|
|
|
read -r device _ <<< "$OCSSD_PCI_DEVICES"
|
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))"
|
|
|
|
|
2019-08-09 08:46:01 +00:00
|
|
|
trap 'at_ftl_exit' SIGINT SIGTERM EXIT
|
2019-02-07 10:35:21 +00:00
|
|
|
|
2020-11-25 20:31:42 +00:00
|
|
|
# OCSSD is blocked so bind it to vfio/uio driver before testing
|
|
|
|
PCI_ALLOWED="$device" PCI_BLOCKED="" DRIVER_OVERRIDE="" $rootdir/scripts/setup.sh
|
2019-02-07 10:35:21 +00:00
|
|
|
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "ftl_bdevperf" $testdir/bdevperf.sh $device
|
2020-01-16 14:57:53 +00:00
|
|
|
run_test "ftl_bdevperf_append" $testdir/bdevperf.sh $device --use_append
|
2019-12-19 23:03:30 +00:00
|
|
|
run_test "ftl_restore" $testdir/restore.sh $device
|
|
|
|
run_test "ftl_json" $testdir/json.sh $device
|
2021-06-10 14:06:53 +00:00
|
|
|
run_test "ftl_fio" "$testdir/fio.sh" "$device"
|