From patchwork Tue Feb 2 01:59:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8185491 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 97A069F3CD for ; Tue, 2 Feb 2016 01:59:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAB2A20295 for ; Tue, 2 Feb 2016 01:59:41 +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 CF92C2026D for ; Tue, 2 Feb 2016 01:59:40 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AF05C1A210C; Mon, 1 Feb 2016 17:59:40 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ml01.01.org (Postfix) with ESMTP id 0433E1A2109 for ; Mon, 1 Feb 2016 17:59:39 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 01 Feb 2016 17:59:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,383,1449561600"; d="scan'208";a="738743428" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.136]) by orsmga003.jf.intel.com with ESMTP; 01 Feb 2016 17:59:41 -0800 Subject: [ndctl PATCH] ndctl: fix 'make check' for common build environments From: Dan Williams To: linux-nvdimm@lists.01.org Date: Mon, 01 Feb 2016 17:59:15 -0800 Message-ID: <20160202015915.11424.48222.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.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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 Given some versions of rpmbuild run 'make check' by default, be sure to 'skip' rather than 'fail' tests that are dependent on root priveleges, kernel dependencies, or a specific hardware/firmware platform. Reported-by: Ross Zwisler Tested-by: Ross Zwisler Signed-off-by: Dan Williams --- test/create.sh | 11 +++++++++++ test/pcommit.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/test/create.sh b/test/create.sh index 61ffe5fcc424..b190eccfc243 100755 --- a/test/create.sh +++ b/test/create.sh @@ -4,15 +4,26 @@ NDCTL="./ndctl" BUS="-b nfit_test.0" json2var="s/[{}\",]//g; s/:/=/g" SECTOR_SIZE="4096" +rc=77 set -e +err() { + echo "test/create: failed at line $1" + exit $rc +} + +set -e +trap 'err $LINENO' ERR + # setup (reset nfit_test dimms) modprobe nfit_test $NDCTL disable-region $BUS all $NDCTL zero-labels $BUS all $NDCTL enable-region $BUS all +rc=1 + # create pmem dev="x" json=$($NDCTL create-namespace $BUS -t pmem -m raw) diff --git a/test/pcommit.c b/test/pcommit.c index afe4fde44d22..3ef09a5074a4 100644 --- a/test/pcommit.c +++ b/test/pcommit.c @@ -54,7 +54,7 @@ int test_pcommit(void) } fclose(cpuinfo); - return ENOTSUP; + return 77; } int __attribute__((weak)) main(int argc, char *argv[])