There are a lot of files in the nvme-cli repo on system that either build up (*.core) or produce misleading logs (*.gcda). This patch cleans the nvme-cli repository before compiling. Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Change-Id: I8f169b9eaef2dc91b14b324a63b338611f82a6a5 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2949 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com>
57 lines
1.2 KiB
Bash
Executable File
57 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 [[ $(uname) != "Linux" ]]; then
|
|
echo "NVMe cuse tests only supported on Linux"
|
|
exit 1
|
|
fi
|
|
|
|
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
|
|
|
|
# Build against the version of SPDK under test
|
|
cd $spdk_nvme_cli
|
|
|
|
git clean -dfx
|
|
|
|
rm -f "$spdk_nvme_cli/spdk"
|
|
ln -sf "$rootdir" "$spdk_nvme_cli/spdk"
|
|
|
|
make -j$(nproc) LDFLAGS="$(make -s -C $spdk_nvme_cli/spdk ldflags)"
|
|
|
|
trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
|
|
start_stub "-s 2048 -i 0 -m 0xF"
|
|
|
|
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
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
kill_stub
|