Skip to contentSkip to conversation

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

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

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

RFC v2 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.

The aim of this proposed module is to implement a similar functionality to the existing module but without the ACPI dependencies. Currently two regions are implemented without interleaving or error injection. Using make check with this module passes 11 tests. The rest of tests are mostly dependent on error injection or on the availability of 'nfit'.

---
 tools/testing/nvdimm/config_check.c |   3 +-
 tools/testing/nvdimm/test/Kbuild    |   6 +-
 tools/testing/nvdimm/test/ndtest.c  | 768 ++++++++++++++++++++++++++++
 tools/testing/nvdimm/test/ndtest.h  |  63 +++
 4 files changed, 838 insertions(+), 2 deletions(-)
 create mode 100644 tools/testing/nvdimm/test/ndtest.c
 create mode 100644 tools/testing/nvdimm/test/ndtest.h
tools/testing/nvdimm/config_check.c +2 -1
index cac891028cd1b..3e3a5f5188640 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 +5 -1
index 75baebf8f4ba1..197bcb2b7f351 100644
@@ -5,5 +5,9 @@ ccflags-y += -I$(srctree)/drivers/acpi/nfit/
 obj-m += nfit_test.o
 obj-m += nfit_test_iomap.o
 
-nfit_test-y := nfit.o
+ifeq  ($(CONFIG_ACPI_NFIT),m)
+	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 +768 -0

768 lines not on this page · raw message

tools/testing/nvdimm/test/ndtest.h new file +63 -0

63 lines not on this page · raw message

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