From patchwork Thu Jan 28 22:52:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 8154791 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 D96779F38B for ; Thu, 28 Jan 2016 22:52:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6212220320 for ; Thu, 28 Jan 2016 22:52:48 +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 3C141202FE for ; Thu, 28 Jan 2016 22:52:47 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 318671A2395; Thu, 28 Jan 2016 14:52:47 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by ml01.01.org (Postfix) with ESMTP id B2FD21A2395 for ; Thu, 28 Jan 2016 14:52:45 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 28 Jan 2016 14:52:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,360,1449561600"; d="scan'208";a="871174586" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.136]) by orsmga001.jf.intel.com with ESMTP; 28 Jan 2016 14:52:32 -0800 Subject: [ndctl PATCH 02/13] ndctl: move tests to their own directory From: Dan Williams To: linux-nvdimm@lists.01.org Date: Thu, 28 Jan 2016 14:52:08 -0800 Message-ID: <20160128225208.17855.14038.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <20160128225157.17855.5190.stgit@dwillia2-desk3.amr.corp.intel.com> References: <20160128225157.17855.5190.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=-1.9 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 Make it easier to find all the test code since it is not apparent for some files. Cc: Ross Zwisler [ross: fix up some missed paths and O_CREAT] Signed-off-by: Dan Williams --- Makefile.am | 58 ++++++++++++++++++++++++------------------------ test/blk_namespaces.c | 0 test/core.c | 0 test/dax-dev.c | 2 +- test/dax-pmd.c | 3 ++ test/dax.sh | 6 ++--- test/dpa-alloc.c | 0 test/libndctl.c | 0 test/mmap.c | 0 test/mmap.sh | 4 ++- test/parent-uuid.c | 0 test/pcommit.c | 0 test/pmem_namespaces.c | 0 13 files changed, 37 insertions(+), 36 deletions(-) rename lib/blk_namespaces.c => test/blk_namespaces.c (100%) rename lib/test-core.c => test/core.c (100%) rename lib/test-dax-dev.c => test/dax-dev.c (97%) rename lib/test-dax-pmd.c => test/dax-pmd.c (97%) rename lib/test-dax.sh => test/dax.sh (82%) rename lib/test-dpa-alloc.c => test/dpa-alloc.c (100%) rename lib/test-libndctl.c => test/libndctl.c (100%) rename lib/test-mmap.c => test/mmap.c (100%) rename lib/test-mmap.sh => test/mmap.sh (97%) rename lib/test-parent-uuid.c => test/parent-uuid.c (100%) rename lib/test-pcommit.c => test/pcommit.c (100%) rename lib/pmem_namespaces.c => test/pmem_namespaces.c (100%) diff --git a/lib/test-parent-uuid.c b/test/parent-uuid.c similarity index 100% rename from lib/test-parent-uuid.c rename to test/parent-uuid.c diff --git a/lib/test-pcommit.c b/test/pcommit.c similarity index 100% rename from lib/test-pcommit.c rename to test/pcommit.c diff --git a/lib/pmem_namespaces.c b/test/pmem_namespaces.c similarity index 100% rename from lib/pmem_namespaces.c rename to test/pmem_namespaces.c diff --git a/Makefile.am b/Makefile.am index 7fee9c688c84..1a0d294dd34d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,16 +73,16 @@ ndctl_SOURCES = ndctl.c \ util/wrapper.c if ENABLE_TEST -ndctl_SOURCES += lib/test-libndctl.c \ - lib/test-dpa-alloc.c \ - lib/test-parent-uuid.c \ - lib/test-core.c +ndctl_SOURCES += test/libndctl.c \ + test/dpa-alloc.c \ + test/parent-uuid.c \ + test/core.c endif if ENABLE_DESTRUCTIVE -ndctl_SOURCES += lib/blk_namespaces.c \ - lib/pmem_namespaces.c \ - lib/test-pcommit.c +ndctl_SOURCES += test/blk_namespaces.c \ + test/pmem_namespaces.c \ + test/pcommit.c ndctl_SOURCES += builtin-bat.c endif @@ -116,37 +116,37 @@ pkgconfig_DATA = lib/libndctl.pc EXTRA_DIST += lib/libndctl.pc.in CLEANFILES += lib/libndctl.pc -TESTS = lib/test-libndctl lib/test-dpa-alloc lib/test-parent-uuid -check_PROGRAMS = lib/test-libndctl lib/test-dpa-alloc lib/test-parent-uuid +TESTS = test/libndctl test/dpa-alloc test/parent-uuid +check_PROGRAMS = test/libndctl test/dpa-alloc test/parent-uuid if ENABLE_DESTRUCTIVE -TESTS += lib/test-blk-ns lib/test-pmem-ns lib/test-pcommit -check_PROGRAMS += lib/test-blk-ns lib/test-pmem-ns lib/test-pcommit +TESTS += test/blk-ns test/pmem-ns test/pcommit +check_PROGRAMS += test/blk-ns test/pmem-ns test/pcommit -TESTS += lib/test-dax-dev lib/test-dax.sh lib/test-mmap.sh -check_PROGRAMS += lib/test-dax-dev lib/test-dax-pmd lib/test-mmap +TESTS += test/dax-dev test/dax.sh test/mmap.sh +check_PROGRAMS += test/dax-dev test/dax-pmd test/mmap endif -lib_test_libndctl_SOURCES = lib/test-libndctl.c lib/test-core.c -lib_test_libndctl_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) +test_libndctl_SOURCES = test/libndctl.c test/core.c +test_libndctl_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) -lib_test_pcommit_SOURCES = lib/test-pcommit.c -lib_test_pcommit_LDADD = lib/libndctl.la $(KMOD_LIBS) +test_pcommit_SOURCES = test/pcommit.c +test_pcommit_LDADD = lib/libndctl.la $(KMOD_LIBS) -lib_test_blk_ns_SOURCES = lib/blk_namespaces.c -lib_test_blk_ns_LDADD = lib/libndctl.la $(KMOD_LIBS) +test_blk_ns_SOURCES = test/blk_namespaces.c +test_blk_ns_LDADD = lib/libndctl.la $(KMOD_LIBS) -lib_test_pmem_ns_SOURCES = lib/pmem_namespaces.c -lib_test_pmem_ns_LDADD = lib/libndctl.la $(KMOD_LIBS) +test_pmem_ns_SOURCES = test/pmem_namespaces.c +test_pmem_ns_LDADD = lib/libndctl.la $(KMOD_LIBS) -lib_test_dpa_alloc_SOURCES = lib/test-dpa-alloc.c lib/test-core.c -lib_test_dpa_alloc_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) +test_dpa_alloc_SOURCES = test/dpa-alloc.c test/core.c +test_dpa_alloc_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) -lib_test_parent_uuid_SOURCES = lib/test-parent-uuid.c lib/test-core.c -lib_test_parent_uuid_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) +test_parent_uuid_SOURCES = test/parent-uuid.c test/core.c +test_parent_uuid_LDADD = lib/libndctl.la $(UUID_LIBS) $(KMOD_LIBS) -lib_test_dax_dev_SOURCES = lib/test-dax-dev.c lib/test-core.c -lib_test_dax_dev_LDADD = lib/libndctl.la +test_dax_dev_SOURCES = test/dax-dev.c test/core.c +test_dax_dev_LDADD = lib/libndctl.la -lib_test_dax_pmd_SOURCES = lib/test-dax-pmd.c -lib_test_mmap_SOURCES = lib/test-mmap.c +test_dax_pmd_SOURCES = test/dax-pmd.c +test_mmap_SOURCES = test/mmap.c diff --git a/lib/blk_namespaces.c b/test/blk_namespaces.c similarity index 100% rename from lib/blk_namespaces.c rename to test/blk_namespaces.c diff --git a/lib/test-core.c b/test/core.c similarity index 100% rename from lib/test-core.c rename to test/core.c diff --git a/lib/test-dax-dev.c b/test/dax-dev.c similarity index 97% rename from lib/test-dax-dev.c rename to test/dax-dev.c index 47d98ddd15a9..afc9e5211eb3 100755 --- a/lib/test-dax-dev.c +++ b/test/dax-dev.c @@ -70,7 +70,7 @@ static int emit_e820_device(int loglevel, struct ndctl_test *test) /* * Note, if the bdev goes active after this check we'll still - * clobber it in the following tests, see lib/test-dax.sh. + * clobber it in the following tests, see test/dax.sh. */ fd = open(path, O_RDWR | O_EXCL); if (fd < 0) diff --git a/lib/test-dax-pmd.c b/test/dax-pmd.c similarity index 97% rename from lib/test-dax-pmd.c rename to test/dax-pmd.c index bf21160016fd..ff0c70e9ea47 100644 --- a/lib/test-dax-pmd.c +++ b/test/dax-pmd.c @@ -89,7 +89,8 @@ static int test_pmd(int fd) break; } - fd2 = open(TEST_FILE, O_CREAT|O_TRUNC|O_DIRECT|O_RDWR); + fd2 = open(TEST_FILE, O_CREAT|O_TRUNC|O_DIRECT|O_RDWR, + DEFFILEMODE); if (fd2 < 0) { faili(i); munmap(addr, 2*HPAGE_SIZE); diff --git a/lib/test-dax.sh b/test/dax.sh similarity index 82% rename from lib/test-dax.sh rename to test/dax.sh index 048d82975d92..c5fce475afce 100755 --- a/lib/test-dax.sh +++ b/test/dax.sh @@ -19,16 +19,16 @@ set -e mkdir -p $MNT trap 'err $LINENO' ERR -DEV=$(lib/test-dax-dev) +DEV=$(test/dax-dev) mkfs.ext4 $DEV mount $DEV $MNT -o dax fallocate -l 1GiB $MNT/$FILE -lib/test-dax-pmd $MNT/$FILE +test/dax-pmd $MNT/$FILE umount $MNT mkfs.xfs -f $DEV mount $DEV $MNT -o dax fallocate -l 1GiB $MNT/$FILE -lib/test-dax-pmd $MNT/$FILE +test/dax-pmd $MNT/$FILE umount $MNT diff --git a/lib/test-dpa-alloc.c b/test/dpa-alloc.c similarity index 100% rename from lib/test-dpa-alloc.c rename to test/dpa-alloc.c diff --git a/lib/test-libndctl.c b/test/libndctl.c similarity index 100% rename from lib/test-libndctl.c rename to test/libndctl.c diff --git a/lib/test-mmap.c b/test/mmap.c similarity index 100% rename from lib/test-mmap.c rename to test/mmap.c diff --git a/lib/test-mmap.sh b/test/mmap.sh similarity index 97% rename from lib/test-mmap.sh rename to test/mmap.sh index f0e16b60240a..745962b0c059 100755 --- a/lib/test-mmap.sh +++ b/test/mmap.sh @@ -2,7 +2,7 @@ MNT=test_mmap_mnt FILE=image DEV="" -TEST=lib/test-mmap +TEST=test/mmap err() { rc=1 @@ -46,7 +46,7 @@ set -e mkdir -p $MNT trap 'err $LINENO' ERR -DEV=$(lib/test-dax-dev) +DEV=$(test/dax-dev) mkfs.ext4 $DEV mount $DEV $MNT -o dax