Skip to contentSkip to conversation

tools/testing/nvdimm: Add generic test module for non-nfit platforms

RFC Superseded Santosh Sivaraj 1 participant 1 message May 14, 2020 libnvdimm: non-volatile memory device

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

RFC 1/1 tools/testing/nvdimm: Add generic test module for non-nfit platforms

We cannot use ndctl test facility (make check) in platforms that don't support ACPI. In order to get the ndctl tests working, we need a module which can emulate NVDIMM devices without relying on ACPI/NFIT, which the current nfit_test module does.

In this proposed module, which is mostly a copy of nfit_test.c but without the ACPI dependencies, two regions are implemented without interleaving or error injection. Using make check with this module passes only three tests because of the limited implementation.

Please comment if anything can be done differently or better.

---
 tools/testing/nvdimm/config_check.c |   3 +-
 tools/testing/nvdimm/test/Kbuild    |   4 +
 tools/testing/nvdimm/test/ndtest.c  | 603 ++++++++++++++++++++++++++++
 3 files changed, 609 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/nvdimm/test/ndtest.c
tools/testing/nvdimm/config_check.c +2 -1
index cac891028cd1..3e3a5f518864 100644
@@ -12,7 +12,8 @@ void check(void)
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_ND_BTT));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_ND_PFN));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_ND_BLK));
-	BUILD_BUG_ON(!IS_MODULE(CONFIG_ACPI_NFIT));
+	if (IS_ENABLED(CONFIG_ACPI_NFIT))
+		BUILD_BUG_ON(!IS_MODULE(CONFIG_ACPI_NFIT));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_DEV_DAX));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_DEV_DAX_PMEM));
 }
tools/testing/nvdimm/test/Kbuild +4 -0
index 75baebf8f4ba..2607da1be2cc 100644
@@ -5,5 +5,9 @@ ccflags-y += -I$(srctree)/drivers/acpi/nfit/
 obj-m += nfit_test.o
 obj-m += nfit_test_iomap.o
 
+ifeq  ($(CONFIG_ACPI),y)
 nfit_test-y := nfit.o
+else
+nfit_test-y := ndtest.o
+endif
 nfit_test_iomap-y := iomap.o
tools/testing/nvdimm/test/ndtest.c new file +603 -0

603 lines not on this page · raw message

Signature · 4 lines
2.25.4
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]