@@ -17,7 +17,7 @@ void builtin_xaction_namespace_reset(void);
struct kmod_ctx;
struct kmod_module;
int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
- int log_level);
+ int log_level, struct ndctl_test *test);
struct ndctl_ctx;
int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx);
@@ -244,7 +244,7 @@ int test_blk_namespaces(int log_level, struct ndctl_test *test,
if (!bus) {
fprintf(stderr, "ACPI.NFIT unavailable falling back to nfit_test\n");
- rc = nfit_test_init(&kmod_ctx, &mod, log_level);
+ rc = nfit_test_init(&kmod_ctx, &mod, log_level, test);
ndctl_invalidate(ctx);
bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
if (rc < 0 || !bus) {
@@ -104,7 +104,7 @@ int ndctl_test_get_skipped(struct ndctl_test *test)
}
int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
- int log_level)
+ int log_level, struct ndctl_test *test)
{
int rc;
unsigned int i;
@@ -142,6 +142,15 @@ int nfit_test_init(struct kmod_ctx **ctx, struct kmod_module **mod,
int state;
name = list[i];
+
+ /*
+ * Don't check for device-dax modules on kernels older
+ * than 4.7.
+ */
+ if (strstr(name, "dax")
+ && !ndctl_test_attempt(test,
+ KERNEL_VERSION(4, 7, 0)))
+ continue;
retry:
rc = kmod_module_new_from_name(*ctx, name, mod);
if (rc) {
@@ -299,7 +299,7 @@ int test_dpa_alloc(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
return 77;
ndctl_set_log_priority(ctx, loglevel);
- 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");
@@ -171,7 +171,7 @@ int test_dsm_fail(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx)
int result = EXIT_FAILURE, err;
ndctl_set_log_priority(ctx, loglevel);
- err = nfit_test_init(&kmod_ctx, &mod, loglevel);
+ err = nfit_test_init(&kmod_ctx, &mod, loglevel, test);
if (err < 0) {
result = 77;
ndctl_test_skip(test);
@@ -253,7 +253,7 @@ int test_multi_pmem(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ctx
ndctl_set_log_priority(ctx, loglevel);
- err = nfit_test_init(&kmod_ctx, &mod, loglevel);
+ err = nfit_test_init(&kmod_ctx, &mod, loglevel, test);
if (err < 0) {
result = 77;
ndctl_test_skip(test);
@@ -229,7 +229,7 @@ int test_parent_uuid(int loglevel, struct ndctl_test *test, struct ndctl_ctx *ct
return 77;
ndctl_set_log_priority(ctx, loglevel);
- 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");
@@ -208,7 +208,7 @@ int test_pmem_namespaces(int log_level, struct ndctl_test *test,
if (!bus) {
fprintf(stderr, "ACPI.NFIT unavailable falling back to nfit_test\n");
- rc = nfit_test_init(&kmod_ctx, &mod, log_level);
+ rc = nfit_test_init(&kmod_ctx, &mod, log_level, test);
ndctl_invalidate(ctx);
bus = ndctl_bus_get_by_provider(ctx, "nfit_test.0");
if (rc < 0 || !bus) {
Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- test.h | 2 +- test/blk_namespaces.c | 2 +- test/core.c | 11 ++++++++++- test/dpa-alloc.c | 2 +- test/dsm-fail.c | 2 +- test/multi-pmem.c | 2 +- test/parent-uuid.c | 2 +- test/pmem_namespaces.c | 2 +- 8 files changed, 17 insertions(+), 8 deletions(-)