db43b387ba
Do not use iter_pci_class_code function in tests to iterate over NVMe drives. This function can return drives which at the moment of execution can not be whitelisted for use. This can result in test errors (such as simply bdev_nvme_attach_controller RPC command failing) or even using and deleting data from NVMe drive which was not meant to be used in tests. Fixes #1235 Change-Id: I82b9935fc88605b636c2096be6c71d4880a567c8 Signed-off-by: Karol Latecki <karol.latecki@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1309 Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
51 lines
1.2 KiB
Bash
Executable File
51 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
source $rootdir/scripts/common.sh
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
if [ -z "${DEPENDENCY_DIR}" ]; then
|
|
echo DEPENDENCY_DIR not defined!
|
|
exit 1
|
|
fi
|
|
|
|
spdk_nvme_cli="${DEPENDENCY_DIR}/nvme-cli"
|
|
|
|
if [ ! -d $spdk_nvme_cli ]; then
|
|
echo "nvme-cli repository not found at $spdk_nvme_cli; skipping tests."
|
|
exit 1
|
|
fi
|
|
|
|
if [ $(uname) = Linux ]; then
|
|
trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
|
|
start_stub "-s 2048 -i 0 -m 0xF"
|
|
fi
|
|
|
|
# Build against the version of SPDK under test
|
|
rm -f "$spdk_nvme_cli/spdk"
|
|
ln -sf "$rootdir" "$spdk_nvme_cli/spdk"
|
|
|
|
cd $spdk_nvme_cli
|
|
make clean && make -j$(nproc) LDFLAGS="$(make -s -C $spdk_nvme_cli/spdk ldflags)"
|
|
sed -i 's/spdk=0/spdk=1/g' spdk.conf
|
|
sed -i 's/shm_id=.*/shm_id=0/g' spdk.conf
|
|
for bdf in $(get_nvme_bdfs); do
|
|
./nvme list
|
|
./nvme id-ctrl $bdf
|
|
./nvme list-ctrl $bdf
|
|
./nvme get-ns-id $bdf
|
|
./nvme id-ns $bdf
|
|
./nvme fw-log $bdf
|
|
./nvme smart-log $bdf
|
|
./nvme error-log $bdf
|
|
./nvme list-ns $bdf -n 1
|
|
./nvme get-feature $bdf -f 1 -s 1 -l 100
|
|
./nvme get-log $bdf -i 1 -l 100
|
|
./nvme reset $bdf
|
|
done
|
|
if [ $(uname) = Linux ]; then
|
|
trap - SIGINT SIGTERM EXIT
|
|
kill_stub
|
|
fi
|