From patchwork Thu Apr 20 20:59:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 9691331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8221A601D4 for ; Thu, 20 Apr 2017 21:04:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E33C2780C for ; Thu, 20 Apr 2017 21:04:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62FB428481; Thu, 20 Apr 2017 21:04:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F7652780C for ; Thu, 20 Apr 2017 21:04:58 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EC7212195406C; Thu, 20 Apr 2017 14:04:58 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D40892194EB63 for ; Thu, 20 Apr 2017 14:04:57 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 14:04:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.37,227,1488873600"; d="scan'208"; a="1158941813" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.125]) by fmsmga002.fm.intel.com with ESMTP; 20 Apr 2017 14:04:56 -0700 Subject: [ndctl PATCH 1/5] test: teach nfit_test_init to only expect device-dax on v4.7+ From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 20 Apr 2017 13:59:04 -0700 Message-ID: <149272194448.23427.1991038457299500600.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <149272193912.23427.11500536718990091103.stgit@dwillia2-desk3.amr.corp.intel.com> References: <149272193912.23427.11500536718990091103.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Dan Williams --- 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(-) diff --git a/test.h b/test.h index 5d17398c02f4..8abe13dd410c 100644 --- a/test.h +++ b/test.h @@ -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); diff --git a/test/blk_namespaces.c b/test/blk_namespaces.c index 1f112744e605..178f73cacb16 100644 --- a/test/blk_namespaces.c +++ b/test/blk_namespaces.c @@ -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) { diff --git a/test/core.c b/test/core.c index a2f2c76b1d29..1f6dd5966404 100644 --- a/test/core.c +++ b/test/core.c @@ -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) { diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c index 53656cab1004..9c80fa3fc8c9 100644 --- a/test/dpa-alloc.c +++ b/test/dpa-alloc.c @@ -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"); diff --git a/test/dsm-fail.c b/test/dsm-fail.c index 0f82e7e3c4ad..22ec94451146 100644 --- a/test/dsm-fail.c +++ b/test/dsm-fail.c @@ -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); diff --git a/test/multi-pmem.c b/test/multi-pmem.c index a8c286cc49c7..abd5f3657eed 100644 --- a/test/multi-pmem.c +++ b/test/multi-pmem.c @@ -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); diff --git a/test/parent-uuid.c b/test/parent-uuid.c index fbe1c5b0c8ee..87ea4d75b5a5 100644 --- a/test/parent-uuid.c +++ b/test/parent-uuid.c @@ -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"); diff --git a/test/pmem_namespaces.c b/test/pmem_namespaces.c index 2d3ad736b0bb..94a5986955b3 100644 --- a/test/pmem_namespaces.c +++ b/test/pmem_namespaces.c @@ -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) {