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 (master)
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447183
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Pawel Wodkowski 2019-02-07 11:35:21 +01:00 committed by Darek Stojaczyk
parent 5c50e8e1b5
commit 14d4c7f06d
2 changed files with 19 additions and 9 deletions

View File

@ -78,9 +78,12 @@ if [ $(uname -s) = Linux ]; then
bdf="$(basename $(readlink -e /sys/class/nvme/${dev#/dev/}/device))"
echo "INFO: blacklisting OCSSD device: $dev ($bdf)"
PCI_BLACKLIST+=" $bdf"
OCSSD_PCI_DEVICES+=" $bdf"
fi
done
export OCSSD_PCI_DEVICES
# Now, bind blacklisted devices to pci-stub module. This will prevent
# automatic grabbing these devices when we add device/vendor ID to
# proper driver.

View File

@ -7,20 +7,27 @@ rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
function ftl_kill() {
rm -f $testdir/.testfile_*
function at_ftl_exit() {
# restore original driver
PCI_WHITELIST="$device" PCI_BLACKLIST="" DRIVER_OVERRIDE="$ocssd_original_dirver" ./scripts/setup.sh
}
vendor_id='0x1d1d'
device_id='0x1f1f'
device=$(lspci -d ${vendor_id}:${device_id} | cut -d' ' -f 1)
read device _ <<< "$OCSSD_PCI_DEVICES"
if [ -z "$device" ]; then
echo "Could not find FTL device. Tests skipped."
exit 0
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
trap "ftl_kill; exit 1" SIGINT SIGTERM EXIT
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