From patchwork Sat Feb 3 10:54:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gu Jinxiang X-Patchwork-Id: 10198487 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 49F1C603ED for ; Sat, 3 Feb 2018 10:54:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CEB428FB5 for ; Sat, 3 Feb 2018 10:54:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31A5728FBB; Sat, 3 Feb 2018 10:54:35 +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=-5.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8915628FB5 for ; Sat, 3 Feb 2018 10:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752071AbeBCKyd (ORCPT ); Sat, 3 Feb 2018 05:54:33 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:51489 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750967AbeBCKya (ORCPT ); Sat, 3 Feb 2018 05:54:30 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="36697387" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Feb 2018 18:54:26 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 92DD949F19B7; Sat, 3 Feb 2018 18:54:24 +0800 (CST) Received: from ubuntu.g08.fujitsu.local (10.167.226.132) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Sat, 3 Feb 2018 18:54:23 +0800 From: Gu Jinxiang To: CC: Subject: [PATCH v3 1/3] btrfs-progs: Add make testsuite command for export tests Date: Sat, 3 Feb 2018 18:54:07 +0800 Message-ID: <1517655249-21410-2-git-send-email-gujx@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1517655249-21410-1-git-send-email-gujx@cn.fujitsu.com> References: <1517655249-21410-1-git-send-email-gujx@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.132] X-yoursite-MailScanner-ID: 92DD949F19B7.A78BB X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: gujx@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Export the testsuite files to a separate tar. Since fsck tests depend on btrfs-corrupt-block, and misc tests depends on both btrfs-corrupt-block and fssum, so set it as prerequisites for package commad. Because, althougth fssum can be generated by source that are all in tests directory, and has no rely on the btrfs's structure. But btrfs-corrupt-block deeply relys on btrfs's structure. For consistency, at the present stage, generete the two when create test tar. Signed-off-by: Gu Jinxiang --- .gitignore | 1 + Makefile | 4 ++++ tests/export-tests.sh | 37 +++++++++++++++++++++++++++++++++++++ testsuites-list | 22 ++++++++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100755 tests/export-tests.sh create mode 100644 testsuites-list diff --git a/.gitignore b/.gitignore index 8e607f6e..a41ad8ce 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ libbtrfs.so.0.1 library-test library-test-static /fssum +testsuites-id /tests/*-tests-results.txt /tests/test-console.txt diff --git a/Makefile b/Makefile index 6369e8f4..7eab0f4f 100644 --- a/Makefile +++ b/Makefile @@ -333,6 +333,10 @@ test-inst: all test: test-fsck test-mkfs test-convert test-misc test-fuzz test-cli +testsuite: btrfs-corrupt-block fssum + @echo "Export tests as a package" + $(Q)bash tests/export-tests.sh + # # NOTE: For static compiles, you need to have all the required libs # static equivalent available diff --git a/tests/export-tests.sh b/tests/export-tests.sh new file mode 100755 index 00000000..0ed7dd99 --- /dev/null +++ b/tests/export-tests.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# export the testsuite files to a separate tar + +TESTSUITES_LIST_FILE=$PWD/testsuites-list +if ! [ -f $TESTSUITES_LIST_FILE ];then + echo "testsuites list file is not exsit." + exit 1 +fi + +TESTSUITES_LIST=$(cat $TESTSUITES_LIST_FILE) +if [ -z "$TESTSUITES_LIST" ]; then + echo "no file be list in testsuites-list" + exit 1 +fi + +DEST="btrfs-progs-tests.tar.gz" +if [ -f $DEST ];then + echo "remove exsit package: " $DEST + rm $DEST +fi + +TEST_ID=$PWD/testsuites-id +if [ -f $TEST_ID ];then + rm $TEST_ID +fi +VERSION=`./version.sh` +TIMESTAMP=`date -u "+%Y-%m-%d %T %Z"` + +echo "git version: " $VERSION > $TEST_ID +echo "this tar is created in: " $TIMESTAMP >> $TEST_ID + +echo "begin create tar: " $DEST +tar --exclude-vcs-ignores -zScf $DEST -C ../ $TESTSUITES_LIST +if [ $? -eq 0 ]; then + echo "create tar successfully." +fi +rm $TEST_ID diff --git a/testsuites-list b/testsuites-list new file mode 100644 index 00000000..a24591f5 --- /dev/null +++ b/testsuites-list @@ -0,0 +1,22 @@ +btrfs-progs/testsuites-id +btrfs-progs/fssum +btrfs-progs/btrfs-corrupt-block +btrfs-progs/Documentation/ +btrfs-progs/tests/cli-tests +btrfs-progs/tests/cli-tests.sh +btrfs-progs/tests/common +btrfs-progs/tests/common.convert +btrfs-progs/tests/common.local +btrfs-progs/tests/convert-tests +btrfs-progs/tests/convert-tests.sh +btrfs-progs/tests/fsck-tests +btrfs-progs/tests/fsck-tests.sh +btrfs-progs/tests/fuzz-tests/ +btrfs-progs/tests/fuzz-tests.sh +btrfs-progs/tests/misc-tests/ +btrfs-progs/tests/misc-tests.sh +btrfs-progs/tests/mkfs-tests/ +btrfs-progs/tests/mkfs-tests.sh +btrfs-progs/tests/README.md +btrfs-progs/tests/scan-results.sh +btrfs-progs/tests/test-console.sh