diff mbox

[ndctl,2/5] test, libndctl: gate dax and pfn tests on 4.8

Message ID 149272194976.23427.2063717455117169640.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit f78913ce1df0
Headers show

Commit Message

Dan Williams April 20, 2017, 8:59 p.m. UTC
The current tests require the nfit_test conversion from cma to vmalloc.
Disable the tests on earlier kernels.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 test/libndctl.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/test/libndctl.c b/test/libndctl.c
index 39822ee71c0e..f5a6abe50edd 100644
--- a/test/libndctl.c
+++ b/test/libndctl.c
@@ -2405,16 +2405,21 @@  static int do_test0(struct ndctl_ctx *ctx, struct ndctl_test *test)
 	ndctl_region_foreach(bus, region)
 		ndctl_region_enable(region);
 
-	if (ndctl_test_attempt(test, KERNEL_VERSION(4, 7, 0))) {
+	/* pfn and dax tests require vmalloc-enabled nfit_test */
+	if (ndctl_test_attempt(test, KERNEL_VERSION(4, 8, 0))) {
 		rc = check_regions(bus, regions0, ARRAY_SIZE(regions0), DAX);
 		if (rc)
 			return rc;
 		reset_bus(bus);
 	}
-	rc = check_regions(bus, regions0, ARRAY_SIZE(regions0), PFN);
-	if (rc)
-		return rc;
-	reset_bus(bus);
+
+	if (ndctl_test_attempt(test, KERNEL_VERSION(4, 8, 0))) {
+		rc = check_regions(bus, regions0, ARRAY_SIZE(regions0), PFN);
+		if (rc)
+			return rc;
+		reset_bus(bus);
+	}
+
 	return check_regions(bus, regions0, ARRAY_SIZE(regions0), BTT);
 }
 
@@ -2464,7 +2469,7 @@  int test_libndctl(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
 	daxctl_set_log_priority(daxctl_ctx, loglevel);
 	ndctl_set_private_data(ctx, test);
 
-	err = nfit_test_init(&kmod_ctx, &mod, loglevel);
+	err = nfit_test_init(&kmod_ctx, &mod, loglevel, test);
 	if (err < 0) {
 		ndctl_test_skip(test);
 		fprintf(stderr, "nfit_test unavailable skipping tests\n");