test/nvmf: only build and run transport_ut.c when RDMA is enabled

transport_ut.c has hard dependencies on RDMA header files,
so we cannot try to build it if CONFIG_RDMA was not specified
at configure time.

Found by OSS-Fuzz.

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37892
https://oss-fuzz-build-logs.storage.googleapis.com/log-b5922a9c-3219-479f-a0a8-50b69ca19473.txt

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iece49a6defcf713e00daaebcf054167a55bce8d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9347
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Jim Harris 2021-08-31 06:42:08 +00:00 committed by Tomasz Zawadzki
parent 95e4b24d5e
commit 30964540fa
2 changed files with 3 additions and 3 deletions

View File

@ -34,9 +34,9 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
DIRS-y = tcp.c ctrlr.c subsystem.c ctrlr_discovery.c ctrlr_bdev.c nvmf.c transport.c
DIRS-y = tcp.c ctrlr.c subsystem.c ctrlr_discovery.c ctrlr_bdev.c nvmf.c
DIRS-$(CONFIG_RDMA) += rdma.c
DIRS-$(CONFIG_RDMA) += rdma.c transport.c
DIRS-$(CONFIG_FC) += fc.c fc_ls.c

View File

@ -96,7 +96,6 @@ function unittest_nvmf() {
$valgrind $testdir/lib/nvmf/subsystem.c/subsystem_ut
$valgrind $testdir/lib/nvmf/tcp.c/tcp_ut
$valgrind $testdir/lib/nvmf/nvmf.c/nvmf_ut
$valgrind $testdir/lib/nvmf/transport.c/transport_ut
}
function unittest_scsi() {
@ -217,6 +216,7 @@ run_test "unittest_log" $valgrind $testdir/lib/log/log.c/log_ut
run_test "unittest_lvol" $valgrind $testdir/lib/lvol/lvol.c/lvol_ut
if grep -q '#define SPDK_CONFIG_RDMA 1' $rootdir/include/spdk/config.h; then
run_test "unittest_nvme_rdma" $valgrind $testdir/lib/nvme/nvme_rdma.c/nvme_rdma_ut
run_test "unittest_nvmf_transport" $valgrind $testdir/lib/nvmf/transport.c/transport_ut
fi
if grep -q '#define SPDK_CONFIG_NVME_CUSE 1' $rootdir/include/spdk/config.h; then