Linux-NVDIMM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3] libnvdimm: Enable unit test infrastructure compile checks
@ 2019-08-31 18:52 Dan Williams
  2019-09-02  6:22 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Williams @ 2019-08-31 18:52 UTC (permalink / raw)
  To: jgg
  Cc: linux-kernel, Jérôme Glisse, Jason Gunthorpe,
	Christoph Hellwig, linux-nvdimm

The infrastructure to mock core libnvdimm routines for unit testing
purposes is prone to bitrot relative to refactoring of that core.
Arrange for the unit test core to be built when CONFIG_COMPILE_TEST=y.
This does not result in a functional unit test environment, it is only a
helper for 0day to catch unit test build regressions.

Note that there are a few x86isms in the implementation, so this does
not bother compile testing this architectures other than 64-bit x86.

Cc: Jérôme Glisse <jglisse@redhat.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Link: https://lore.kernel.org/r/156097224232.1086847.9463861924683372741.stgit@dwillia2-desk3.amr.corp.intel.com
---
Changes since v2:
- Fixed a 0day report when the unit test infrastructure is built-in.
  Arrange for it to only compile as a module. This has received a build
  success notifcation from the robot over 142 configs.

Hi Jason,

As we discussed previously please take this through the hmm tree to give
compile coverage for devm_memremap_pages() updates.

 drivers/nvdimm/Kconfig  |   12 ++++++++++++
 drivers/nvdimm/Makefile |    4 ++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig
index a5fde15e91d3..36af7af6b7cf 100644
--- a/drivers/nvdimm/Kconfig
+++ b/drivers/nvdimm/Kconfig
@@ -118,4 +118,16 @@ config NVDIMM_KEYS
 	depends on ENCRYPTED_KEYS
 	depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
 
+config NVDIMM_TEST_BUILD
+	tristate "Build the unit test core"
+	depends on m
+	depends on COMPILE_TEST && X86_64
+	default m if COMPILE_TEST
+	help
+	  Build the core of the unit test infrastructure. The result of
+	  this build is non-functional for unit test execution, but it
+	  otherwise helps catch build errors induced by changes to the
+	  core devm_memremap_pages() implementation and other
+	  infrastructure.
+
 endif
diff --git a/drivers/nvdimm/Makefile b/drivers/nvdimm/Makefile
index cefe233e0b52..6557e126892f 100644
--- a/drivers/nvdimm/Makefile
+++ b/drivers/nvdimm/Makefile
@@ -29,3 +29,7 @@ libnvdimm-$(CONFIG_BTT) += btt_devs.o
 libnvdimm-$(CONFIG_NVDIMM_PFN) += pfn_devs.o
 libnvdimm-$(CONFIG_NVDIMM_DAX) += dax_devs.o
 libnvdimm-$(CONFIG_NVDIMM_KEYS) += security.o
+
+TOOLS := ../../tools
+TEST_SRC := $(TOOLS)/testing/nvdimm/test
+obj-$(CONFIG_NVDIMM_TEST_BUILD) := $(TEST_SRC)/iomap.o

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] libnvdimm: Enable unit test infrastructure compile checks
  2019-08-31 18:52 [PATCH v3] libnvdimm: Enable unit test infrastructure compile checks Dan Williams
@ 2019-09-02  6:22 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2019-09-02  6:22 UTC (permalink / raw)
  To: Dan Williams
  Cc: linux-kernel, Jérôme Glisse, Christoph Hellwig, linux-nvdimm

On Sat, Aug 31, 2019 at 11:52:47AM -0700, Dan Williams wrote:
> The infrastructure to mock core libnvdimm routines for unit testing
> purposes is prone to bitrot relative to refactoring of that core.
> Arrange for the unit test core to be built when CONFIG_COMPILE_TEST=y.
> This does not result in a functional unit test environment, it is only a
> helper for 0day to catch unit test build regressions.
> 
> Note that there are a few x86isms in the implementation, so this does
> not bother compile testing this architectures other than 64-bit x86.
> 
> Cc: Jérôme Glisse <jglisse@redhat.com>
> Cc: Jason Gunthorpe <jgg@mellanox.com>
> Reported-by: Christoph Hellwig <hch@lst.de>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> Link: https://lore.kernel.org/r/156097224232.1086847.9463861924683372741.stgit@dwillia2-desk3.amr.corp.intel.com
> Changes since v2:
> - Fixed a 0day report when the unit test infrastructure is built-in.
>   Arrange for it to only compile as a module. This has received a build
>   success notifcation from the robot over 142 configs.
> 
> Hi Jason,
> 
> As we discussed previously please take this through the hmm tree to give
> compile coverage for devm_memremap_pages() updates.

Okay, applied again and 0-day passed

Thanks,
Jason
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31 18:52 [PATCH v3] libnvdimm: Enable unit test infrastructure compile checks Dan Williams
2019-09-02  6:22 ` Jason Gunthorpe

Linux-NVDIMM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvdimm/0 linux-nvdimm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvdimm linux-nvdimm/ https://lore.kernel.org/linux-nvdimm \
		linux-nvdimm@lists.01.org linux-nvdimm@archiver.kernel.org
	public-inbox-index linux-nvdimm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.01.lists.linux-nvdimm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox