From patchwork Tue Aug 13 17:24:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Schmidt X-Patchwork-Id: 2843900 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58C71BF546 for ; Tue, 13 Aug 2013 17:24:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17C5920625 for ; Tue, 13 Aug 2013 17:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A598320622 for ; Tue, 13 Aug 2013 17:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758810Ab3HMRYh (ORCPT ); Tue, 13 Aug 2013 13:24:37 -0400 Received: from xp-ob.rzone.de ([81.169.146.137]:48958 "EHLO xp-ob.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757606Ab3HMRYg (ORCPT ); Tue, 13 Aug 2013 13:24:36 -0400 X-RZG-CLASS-ID: xp Received: from pizpot.store ([192.168.43.236]) by jored.store (RZmta 31.38 OK) with ESMTP id X015efp7DBVUzY ; Tue, 13 Aug 2013 19:24:32 +0200 (CEST) From: Jan Schmidt To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org, sbehrens@giantdisaster.de, sandeen@sandeen.net Subject: [PATCH v4 2/2] xfstests btrfs/316: test send / receive Date: Tue, 13 Aug 2013 19:24:18 +0200 Message-Id: <1376414658-4563-3-git-send-email-list.xfs@jan-o-sch.net> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1376414658-4563-1-git-send-email-list.xfs@jan-o-sch.net> References: <1376414658-4563-1-git-send-email-list.xfs@jan-o-sch.net> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Basic send / receive functionality test for btrfs. Requires current version of fsstress built (-x support). Relies on fssum tool but can skip the test if it failed to build. Signed-off-by: Jan Schmidt Reviewed-by: Josef Bacik --- tests/btrfs/316 | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/316.out | 4 ++ tests/btrfs/group | 1 + 3 files changed, 121 insertions(+), 0 deletions(-) create mode 100755 tests/btrfs/316 create mode 100644 tests/btrfs/316.out diff --git a/tests/btrfs/316 b/tests/btrfs/316 new file mode 100755 index 0000000..b3af7d9 --- /dev/null +++ b/tests/btrfs/316 @@ -0,0 +1,116 @@ +#! /bin/bash +# FSQA Test No. 316 +# +# Run fsstress to create a reasonably strange file system, make a +# snapshot (base) and run more fsstress. Then take another snapshot +# (incr) and send both snapshots to a temp file. Remake the file +# system and receive from the files. Check both states with fssum. +# +#----------------------------------------------------------------------- +# Copyright (C) 2013 STRATO. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +#----------------------------------------------------------------------- +# +# creator +owner=list.btrfs@jan-o-sch.net + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=`mktemp -d` +status=1 + +_cleanup() +{ + echo "*** unmount" + umount $SCRATCH_MNT 2>/dev/null + rm -f $tmp.* +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_need_to_be_root +_supported_fs btrfs +_supported_os Linux +_require_scratch +_require_seek_data_hole + +FSSUM_PROG=$here/src/fssum +[ -x $FSSUM_PROG ] || _notrun "fssum not built" + +rm -f $seqres.full + +workout() +{ + fsz=$1 + ops=$2 + + umount $SCRATCH_DEV >/dev/null 2>&1 + echo "*** mkfs -dsize=$fsz" >>$seqres.full + echo "" >>$seqres.full + _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \ + || _fail "size=$fsz mkfs failed" + run_check _scratch_mount "-o noatime" + + run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \ + "$BTRFS_UTIL_PROG subvol snap -r $SCRATCH_MNT $SCRATCH_MNT/base" + + run_check $BTRFS_UTIL_PROG subvol snap -r $SCRATCH_MNT $SCRATCH_MNT/incr + + echo "# $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $tmp/base.snap" \ + >> $seqres.full + $BTRFS_UTIL_PROG send $SCRATCH_MNT/base > $tmp/base.snap 2>> $seqres.full \ + || _fail "failed: '$@'" + echo "# $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base\ + $SCRATCH_MNT/incr > $tmp/incr.snap" >> $seqres.full + $BTRFS_UTIL_PROG send -p $SCRATCH_MNT/base \ + $SCRATCH_MNT/incr > $tmp/incr.snap 2>> $seqres.full \ + || _fail "failed: '$@'" + + run_check $FSSUM_PROG -A -f -w $tmp/base.fssum $SCRATCH_MNT/base + run_check $FSSUM_PROG -A -f -w $tmp/incr.fssum -x $SCRATCH_MNT/incr/base \ + $SCRATCH_MNT/incr + + umount $SCRATCH_DEV >/dev/null 2>&1 + echo "*** mkfs -dsize=$fsz" >>$seqres.full + echo "" >>$seqres.full + _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \ + || _fail "size=$fsz mkfs failed" + run_check _scratch_mount "-o noatime" + + run_check $BTRFS_UTIL_PROG receive $SCRATCH_MNT < $tmp/base.snap + run_check $FSSUM_PROG -r $tmp/base.fssum $SCRATCH_MNT/base + + run_check $BTRFS_UTIL_PROG receive $SCRATCH_MNT < $tmp/incr.snap + run_check $FSSUM_PROG -r $tmp/incr.fssum $SCRATCH_MNT/incr +} + +echo "*** test send / receive" + +fssize=`expr 2000 \* 1024 \* 1024` +ops=200 + +workout $fssize $ops + +echo "*** done" +status=0 +exit diff --git a/tests/btrfs/316.out b/tests/btrfs/316.out new file mode 100644 index 0000000..4564c85 --- /dev/null +++ b/tests/btrfs/316.out @@ -0,0 +1,4 @@ +QA output created by 316 +*** test send / receive +*** done +*** unmount diff --git a/tests/btrfs/group b/tests/btrfs/group index bc6c256..11d708a 100644 --- a/tests/btrfs/group +++ b/tests/btrfs/group @@ -9,3 +9,4 @@ 276 auto rw metadata 284 auto 307 auto quick +316 auto rw metadata