From a9c37fd3666e033a9ea388a3e13f812b43ec83e3 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 19 Jun 2017 13:07:20 -0700 Subject: [PATCH] test: move SCSI/NVMe translation test to test/unit Reorganize the scsi_nvme.c unit test to where it ought to be (the file is in lib/bdev now, not part of the SCSI library). Change-Id: I83fd9e1bf2a2644eea2508334362f70ed8e6ad2b Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/366160 Tested-by: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- test/lib/scsi/Makefile | 2 +- test/unit/lib/Makefile | 2 +- test/unit/lib/bdev/Makefile | 44 +++++++++++++++++++ .../lib/bdev/scsi_nvme.c}/.gitignore | 0 .../lib/bdev/scsi_nvme.c}/Makefile | 2 +- .../lib/bdev/scsi_nvme.c}/scsi_nvme_ut.c | 0 unittest.sh | 3 +- 7 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 test/unit/lib/bdev/Makefile rename test/{lib/scsi/scsi_nvme => unit/lib/bdev/scsi_nvme.c}/.gitignore (100%) rename test/{lib/scsi/scsi_nvme => unit/lib/bdev/scsi_nvme.c}/Makefile (97%) rename test/{lib/scsi/scsi_nvme => unit/lib/bdev/scsi_nvme.c}/scsi_nvme_ut.c (100%) diff --git a/test/lib/scsi/Makefile b/test/lib/scsi/Makefile index eeeb49739..500783718 100644 --- a/test/lib/scsi/Makefile +++ b/test/lib/scsi/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = dev init lun scsi_bdev scsi_nvme +DIRS-y = dev init lun scsi_bdev .PHONY: all clean $(DIRS-y) diff --git a/test/unit/lib/Makefile b/test/unit/lib/Makefile index 5fcbff577..0dc04eaee 100644 --- a/test/unit/lib/Makefile +++ b/test/unit/lib/Makefile @@ -34,7 +34,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y = util +DIRS-y = bdev util .PHONY: all clean $(DIRS-y) diff --git a/test/unit/lib/bdev/Makefile b/test/unit/lib/bdev/Makefile new file mode 100644 index 000000000..ec7edc7e9 --- /dev/null +++ b/test/unit/lib/bdev/Makefile @@ -0,0 +1,44 @@ +# +# BSD LICENSE +# +# Copyright (c) Intel Corporation. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Intel Corporation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) +include $(SPDK_ROOT_DIR)/mk/spdk.common.mk + +DIRS-y = scsi_nvme.c + +.PHONY: all clean $(DIRS-y) + +all: $(DIRS-y) +clean: $(DIRS-y) + +include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk diff --git a/test/lib/scsi/scsi_nvme/.gitignore b/test/unit/lib/bdev/scsi_nvme.c/.gitignore similarity index 100% rename from test/lib/scsi/scsi_nvme/.gitignore rename to test/unit/lib/bdev/scsi_nvme.c/.gitignore diff --git a/test/lib/scsi/scsi_nvme/Makefile b/test/unit/lib/bdev/scsi_nvme.c/Makefile similarity index 97% rename from test/lib/scsi/scsi_nvme/Makefile rename to test/unit/lib/bdev/scsi_nvme.c/Makefile index d26f1e525..b88da44f5 100644 --- a/test/lib/scsi/scsi_nvme/Makefile +++ b/test/unit/lib/bdev/scsi_nvme.c/Makefile @@ -30,7 +30,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) +SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.app.mk diff --git a/test/lib/scsi/scsi_nvme/scsi_nvme_ut.c b/test/unit/lib/bdev/scsi_nvme.c/scsi_nvme_ut.c similarity index 100% rename from test/lib/scsi/scsi_nvme/scsi_nvme_ut.c rename to test/unit/lib/bdev/scsi_nvme.c/scsi_nvme_ut.c diff --git a/unittest.sh b/unittest.sh index 8bc206e21..9918ffd0d 100755 --- a/unittest.sh +++ b/unittest.sh @@ -30,6 +30,8 @@ if [ "$cov_avail" = "yes" ]; then $LCOV -q -c -i -d . -t "Baseline" -o $UT_COVERAGE/ut_cov_base.info fi +$valgrind test/unit/lib/bdev/scsi_nvme.c/scsi_nvme_ut + $valgrind test/lib/blob/blob_ut/blob_ut $valgrind test/lib/blobfs/blobfs_async_ut/blobfs_async_ut @@ -66,7 +68,6 @@ $valgrind test/lib/scsi/dev/dev_ut $valgrind test/lib/scsi/init/init_ut $valgrind test/lib/scsi/lun/lun_ut $valgrind test/lib/scsi/scsi_bdev/scsi_bdev_ut -$valgrind test/lib/scsi/scsi_nvme/scsi_nvme_ut $valgrind test/lib/iscsi/param/param_ut $valgrind test/lib/iscsi/target_node/target_node_ut test/lib/iscsi/target_node/target_node.conf