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