test/nvme-cli: skip test if nvme-cli not found

No need to run the stub and other setup work if the nvme-cli repository
is not found on the test agent.

Change-Id: I5a3c0ab8ceb25e65f4693b8fc519812ebccf9ae7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402380
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Daniel Verkamp 2018-03-02 14:19:08 -07:00
parent 8887697f8c
commit 823830c4bc

View File

@ -8,6 +8,11 @@ source $rootdir/scripts/common.sh
source $rootdir/test/common/autotest_common.sh
spdk_nvme_cli="/home/sys_sgsw/nvme-cli"
if [ ! -d $spdk_nvme_cli ]; then
echo "nvme-cli repository not found at $spdk_nvme_cli; skipping tests."
exit 0
fi
timing_enter nvme_cli
if [ `uname` = Linux ]; then
@ -15,7 +20,6 @@ if [ `uname` = Linux ]; then
trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
fi
if [ -d $spdk_nvme_cli ]; then
# Build against the version of SPDK under test
rm -f "$spdk_nvme_cli/spdk"
ln -sf "$rootdir" "$spdk_nvme_cli/spdk"
@ -38,8 +42,6 @@ if [ -d $spdk_nvme_cli ]; then
./nvme get-feature $bdf -n 1 -f 1 -s 1 -l 100
./nvme get-log $bdf -n 1 -i 1 -l 100
./nvme reset $bdf
fi
if [ `uname` = Linux ]; then
trap - SIGINT SIGTERM EXIT
kill_stub