From patchwork Fri Sep 11 00:20:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 7156681 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C15A6BEEC1 for ; Fri, 11 Sep 2015 00:26:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF4A62064F for ; Fri, 11 Sep 2015 00:26:07 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 0380C2060C for ; Fri, 11 Sep 2015 00:26:07 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EA882182E4D; Thu, 10 Sep 2015 17:26:06 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ml01.01.org (Postfix) with ESMTP id ADD72182DD2 for ; Thu, 10 Sep 2015 17:26:05 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 10 Sep 2015 17:26:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,508,1437462000"; d="scan'208";a="642623794" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.137]) by orsmga003.jf.intel.com with ESMTP; 10 Sep 2015 17:26:04 -0700 Subject: [PATCH] ndctl: fix "skip" reporting when nfit_test modules are missing From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 10 Sep 2015 20:20:21 -0400 Message-ID: <20150911001936.12759.89538.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-8-g92dd MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 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-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the kernel headers report the kernel version is capable of running the tests, but the nfit_test infrastructure is not found, don't report "PASS". Add ndctl_test_skip() as an explicit skip for reasons outside of incompatible kernel version. Signed-off-by: Dan Williams Reviewed-by: Ross Zwisler --- lib/test-core.c | 7 +++++++ lib/test-core.h | 2 ++ lib/test-dpa-alloc.c | 1 + lib/test-libndctl.c | 1 + lib/test-parent-uuid.c | 1 + 5 files changed, 12 insertions(+) diff --git a/lib/test-core.c b/lib/test-core.c index 932c2dd246f5..4733e0fb424e 100644 --- a/lib/test-core.c +++ b/lib/test-core.c @@ -62,6 +62,13 @@ int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver, return 0; } +void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line) +{ + test->skip++; + test->attempt = test->skip; + fprintf(stderr, "%s: explicit skip %s:%d\n", __func__, caller, line); +} + int ndctl_test_get_attempted(struct ndctl_test *test) { return test->attempt; diff --git a/lib/test-core.h b/lib/test-core.h index 7f13bc28441b..9129871be43e 100644 --- a/lib/test-core.h +++ b/lib/test-core.h @@ -6,3 +6,5 @@ int ndctl_test_get_attempted(struct ndctl_test *test); int __ndctl_test_attempt(struct ndctl_test *test, unsigned int kver, const char *caller, int line); #define ndctl_test_attempt(t, v) __ndctl_test_attempt(t, v, __func__, __LINE__) +void __ndctl_test_skip(struct ndctl_test *test, const char *caller, int line); +#define ndctl_test_skip(t) __ndctl_test_skip(t, __func__, __LINE__) diff --git a/lib/test-dpa-alloc.c b/lib/test-dpa-alloc.c index 1eb278dcaf7e..dab3b882757e 100644 --- a/lib/test-dpa-alloc.c +++ b/lib/test-dpa-alloc.c @@ -319,6 +319,7 @@ int test_dpa_alloc(int loglevel, struct ndctl_test *test) NULL, NULL, NULL, NULL); if (err < 0) { result = 77; + ndctl_test_skip(test); fprintf(stderr, "%s unavailable skipping tests\n", NFIT_TEST_MODULE); goto err_module; diff --git a/lib/test-libndctl.c b/lib/test-libndctl.c index 54511994098c..b7c85371ee07 100644 --- a/lib/test-libndctl.c +++ b/lib/test-libndctl.c @@ -1583,6 +1583,7 @@ int test_libndctl(int loglevel, struct ndctl_test *test) NULL, NULL, NULL, NULL); if (err < 0) { result = 77; + ndctl_test_skip(test); fprintf(stderr, "%s unavailable skipping tests\n", NFIT_TEST_MODULE); goto err_module; diff --git a/lib/test-parent-uuid.c b/lib/test-parent-uuid.c index ed0e7f88863b..4f48717ca0f7 100644 --- a/lib/test-parent-uuid.c +++ b/lib/test-parent-uuid.c @@ -249,6 +249,7 @@ int test_parent_uuid(int loglevel, struct ndctl_test *test) NULL, NULL, NULL, NULL); if (err < 0) { result = 77; + ndctl_test_skip(test); fprintf(stderr, "%s unavailable skipping tests\n", NFIT_TEST_MODULE); goto err_module;