5 testdir
=$
(readlink
-f $
(dirname $0))
6 rootdir
=$
(readlink
-f $testdir/..
/..
)
7 source $rootdir/scripts
/common.sh
8 source $rootdir/test
/common
/autotest_common.sh
10 if [ -z "${DEPENDENCY_DIR}" ]; then
11 echo DEPENDENCY_DIR not defined
!
15 spdk_nvme_cli
="${DEPENDENCY_DIR}/nvme-cli"
17 if [ ! -d $spdk_nvme_cli ]; then
18 echo "nvme-cli repository not found at $spdk_nvme_cli; skipping tests."
24 if [ `uname` = Linux
]; then
25 start_stub
"-s 2048 -i 0 -m 0xF"
26 trap "kill_stub; exit 1" SIGINT SIGTERM EXIT
29 # Build against the version of SPDK under test
30 rm -f "$spdk_nvme_cli/spdk"
31 ln -sf "$rootdir" "$spdk_nvme_cli/spdk"
33 bdfs
=$
(iter_pci_class_code
01 08 02)
34 bdf
=$
(echo $bdfs|
awk '{ print $1 }')
37 make clean
&& make -j$
(nproc
) LDFLAGS
="$(make -s -C $spdk_nvme_cli/spdk ldflags)"
38 sed -i 's/spdk=0/spdk=1/g' spdk.conf
39 sed -i 's/shm_id=1/shm_id=0/g' spdk.conf
48 .
/nvme list-ns
$bdf -n 1
49 .
/nvme get-feature
$bdf -n 1 -f 1 -s 1 -l 100
50 .
/nvme get-log
$bdf -n 1 -i 1 -l 100
52 if [ `uname` = Linux
]; then
53 trap - SIGINT SIGTERM EXIT
57 report_test_completion spdk_nvme_cli