From 30964540fa5523196f007440e0b39fa4c54ddd02 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 31 Aug 2021 06:42:08 +0000 Subject: [PATCH] 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 Change-Id: Iece49a6defcf713e00daaebcf054167a55bce8d0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9347 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Reviewed-by: Changpeng Liu Reviewed-by: Dong Yi Reviewed-by: Tomasz Zawadzki --- test/unit/lib/nvmf/Makefile | 4 ++-- test/unit/unittest.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/lib/nvmf/Makefile b/test/unit/lib/nvmf/Makefile index 9934ac623..62f60543d 100644 --- a/test/unit/lib/nvmf/Makefile +++ b/test/unit/lib/nvmf/Makefile @@ -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 diff --git a/test/unit/unittest.sh b/test/unit/unittest.sh index ed025e9ec..1fada56bd 100755 --- a/test/unit/unittest.sh +++ b/test/unit/unittest.sh @@ -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