test/external_code: out-of-tree NVMe driver tests

These tests compile the driver both as a shared object and statically
linking it to the identify application.  Additionally, in both
configurations, the app is used to list all available NVMe controllers,
as well as print information about each one indivdually.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I127caf08acad11241bf685b392617ab4b810226b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6680
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Konrad Sztyber 2021-02-25 11:52:04 +01:00 committed by Tomasz Zawadzki
parent ae53ab2ddd
commit b665fd8672
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
testdir=$(readlink -f $(dirname $0))
rootdir=$testdir/../../..
source $rootdir/test/common/autotest_common.sh
export SPDK_LIB_DIR=$rootdir/build/lib
export DPDK_LIB_DIR=${SPDK_RUN_EXTERNAL_DPDK:-$rootdir/dpdk/build}/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPDK_LIB_DIR:$DPDK_LIB_DIR:$testdir
# Make sure all NVMe devices are reported if no address is specified
identify_data=$($testdir/identify)
for bdf in $(get_nvme_bdfs); do
grep $bdf <<< $identify_data
done
# Verify that each device can be queried individually too
for bdf in $(get_nvme_bdfs); do
$testdir/identify $bdf
done

View File

@ -50,6 +50,10 @@ run_test "external_make_hello_no_bdev_shared_iso" make -C $test_root hello_world
run_test "external_run_hello_no_bdev_shared_iso" $test_root/hello_world/hello_bdev \
--json $test_root/hello_world/bdev.json -b Malloc0
# Make the basic NVMe driver linked against individual shared SPDK libraries.
run_test "external_make_nvme_shared" make -C $test_root nvme_shared
run_test "external_run_nvme_shared" $test_root/nvme/identify.sh
make -C $test_root clean
make -C $SPDK_DIR clean
@ -68,6 +72,10 @@ run_test "external_make_hello_no_bdev_static" make -C $test_root hello_world_no_
run_test "external_run_hello_no_bdev_static" $test_root/hello_world/hello_bdev \
--json $test_root/hello_world/bdev.json -b Malloc0
# Make the basic NVMe driver statically linked against individual SPDK archives.
run_test "external_make_nvme_static" make -C $test_root nvme_static
run_test "external_run_nvme_static" $test_root/nvme/identify.sh
make -C $test_root clean
make -C $SPDK_DIR -j$(nproc) clean