From patchwork Sun Mar 24 06:48:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10867345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E323A139A for ; Sun, 24 Mar 2019 06:48:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF3DC2973B for ; Sun, 24 Mar 2019 06:48:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE9D52973F; Sun, 24 Mar 2019 06:48:31 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 458042971F for ; Sun, 24 Mar 2019 06:48:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728015AbfCXGsa (ORCPT ); Sun, 24 Mar 2019 02:48:30 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:49262 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbfCXGsa (ORCPT ); Sun, 24 Mar 2019 02:48:30 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2O6ihkp046897; Sun, 24 Mar 2019 06:48:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=fzGb70zy+5c8HCiHFFF6uNVFprIQqq3QkOZ0LN4w7JA=; b=c0AAnVI3MlK7Zj0VGlfCdB7RuaIQHYGZmI++FY97FpvtEX2PTA68spbxdGFoy6pwfAMP Fo8XhhbvBd/pK2Py/qXrMVaSdY79v6q7fDKC1TnLRC5McovbH4uMRFJIkJdi/pwQtplS Lb+KWtCigAFj1Iuu4h7UT0huPi2bdkZQEUgXu2FJoya1QQ3BB9BskuJJk13Tmsu1fTeT kF4QNZe4FrQPsl5gtIgHkEcQ+dm0g6QaqEnXZ8yTuFdhDIU2InADI4IQHYZEOOG7XS/N Wc+5byS6o7I/ltTHMNZxPFqbaktp91LULC6WdsDshXjytE2Lxl00rKsWKzMJLBNj6ipE eg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2rdp1k13ba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 24 Mar 2019 06:48:27 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2O6mRpx008795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 24 Mar 2019 06:48:27 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2O6mRlX006829; Sun, 24 Mar 2019 06:48:27 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 24 Mar 2019 06:48:26 +0000 Date: Sat, 23 Mar 2019 23:48:24 -0700 From: "Darrick J. Wong" To: guaneryu@gmail.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH v2 10/12] xfs: test xfs_copy and xfs_mdrestore on the populate images Message-ID: <20190324064824.GS1183@magnolia> References: <155304267647.31707.14180452399822113095.stgit@magnolia> <155304274924.31707.623436868976936668.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <155304274924.31707.623436868976936668.stgit@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9204 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903240052 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Make sure that copy, metadump, and mdrestore work on a filesystem with all known metadata types. Signed-off-by: Darrick J. Wong --- tests/xfs/740 | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/740.out | 12 +++++++ tests/xfs/group | 1 + 3 files changed, 110 insertions(+) create mode 100755 tests/xfs/740 create mode 100644 tests/xfs/740.out diff --git a/tests/xfs/740 b/tests/xfs/740 new file mode 100755 index 00000000..bd0a4577 --- /dev/null +++ b/tests/xfs/740 @@ -0,0 +1,97 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2019 Oracle, Inc. All Rights Reserved. +# +# FS QA Test No. 740 +# +# Populate a XFS filesystem and ensure that metadump, mdrestore, and copy +# all work properly. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 7 15 + +_cleanup() +{ + cd / + rm -rf $tmp.* $testdir +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/populate + +testdir=$TEST_DIR/test-$seq + +# real QA test starts here +_supported_os Linux +_supported_fs xfs + +_require_scratch_nocheck +_require_populate_commands + +echo "Format and populate" +_scratch_populate_cached nofill > $seqres.full 2>&1 + +mkdir -p $testdir +metadump_file=$testdir/scratch.md +metadump_file_a=${metadump_file}.a +metadump_file_g=${metadump_file}.g +metadump_file_ag=${metadump_file}.ag +copy_file=$testdir/copy.img + +echo metadump +_scratch_metadump $metadump_file >> $seqres.full + +echo metadump a +_scratch_metadump $metadump_file_a -a >> $seqres.full + +echo metadump g +_scratch_metadump $metadump_file_g -g >> $seqres.full + +echo metadump ag +_scratch_metadump $metadump_file_ag -a -g >> $seqres.full + +echo copy +$XFS_COPY_PROG $SCRATCH_DEV $copy_file >> $seqres.full +_check_scratch_fs $copy_file + +echo recopy +$XFS_COPY_PROG $copy_file $SCRATCH_DEV >> $seqres.full +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore +xfs_mdrestore $metadump_file $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore a +xfs_mdrestore $metadump_file_a $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore g +xfs_mdrestore $metadump_file_g $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +echo mdrestore ag +xfs_mdrestore $metadump_file_ag $SCRATCH_DEV +_scratch_mount +_check_scratch_fs +_scratch_unmount + +# success, all done +status=0 +exit diff --git a/tests/xfs/740.out b/tests/xfs/740.out new file mode 100644 index 00000000..0c979dc4 --- /dev/null +++ b/tests/xfs/740.out @@ -0,0 +1,12 @@ +QA output created by 740 +Format and populate +metadump +metadump a +metadump g +metadump ag +copy +recopy +mdrestore +mdrestore a +mdrestore g +mdrestore ag diff --git a/tests/xfs/group b/tests/xfs/group index 9d9458b8..b8bd1012 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -500,3 +500,4 @@ 500 auto quick mkfs prealloc mkfs 501 auto quick unlink 502 auto quick unlink +740 auto copy metadump