From b665fd86722e2a661ee738d4e3ea53bc6fd2e136 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Thu, 25 Feb 2021 11:52:04 +0100 Subject: [PATCH] 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 Change-Id: I127caf08acad11241bf685b392617ab4b810226b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6680 Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot --- test/external_code/nvme/identify.sh | 21 +++++++++++++++++++++ test/external_code/test_make.sh | 8 ++++++++ 2 files changed, 29 insertions(+) create mode 100755 test/external_code/nvme/identify.sh diff --git a/test/external_code/nvme/identify.sh b/test/external_code/nvme/identify.sh new file mode 100755 index 000000000..3476bcdd0 --- /dev/null +++ b/test/external_code/nvme/identify.sh @@ -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 diff --git a/test/external_code/test_make.sh b/test/external_code/test_make.sh index 6d6be10cc..23be4dba3 100755 --- a/test/external_code/test_make.sh +++ b/test/external_code/test_make.sh @@ -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