From patchwork Sat Feb 1 02:05:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 3564171 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 56F83C02DC for ; Sat, 1 Feb 2014 02:05:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6814E2022F for ; Sat, 1 Feb 2014 02:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B8DA2022D for ; Sat, 1 Feb 2014 02:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932409AbaBACFq (ORCPT ); Fri, 31 Jan 2014 21:05:46 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:58084 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754220AbaBACFp (ORCPT ); Fri, 31 Jan 2014 21:05:45 -0500 Received: by mail-we0-f172.google.com with SMTP id p61so288374wes.3 for ; Fri, 31 Jan 2014 18:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=/eBzUlLuGII/EMC2iRZ1gP+ZcqTVAG62lWx2Abb8MwA=; b=fxOHaj2/WEyVBZ7798zYj3mXCFwxLSWrxj2/KDwPojBUwLplb4/h2ZwnPLXA44lhp3 lQG2wB7eU2rOQS5SrSez6PNmv71bHDPKQH+XYtSHS2FrdpLegwlJ8RH3UNmvxE9u0M2H zSGWJP4vSkNT9dqMt89zKPRhDwyq2N2tXuRXMdg0F73aVS8BiOSjb8zLo1eWzNnFbf23 ZIEQZatBxLG2hgVRjBIHzbeRZH28fDgV93KMOqUeADhMcKqNU6nx+lT7tbLUsTBCzDXS VtUT/jTpD5KUr5XUB6QN19uFPRnjqghq7Bsbp3EJ9ahXPjWsv1gHk95H3tSJip096e/z 8XtQ== X-Received: by 10.180.77.200 with SMTP id u8mr931863wiw.48.1391220344493; Fri, 31 Jan 2014 18:05:44 -0800 (PST) Received: from storm-desktop.lan (bl10-140-184.dsl.telepac.pt. [85.243.140.184]) by mx.google.com with ESMTPSA id bj3sm23742604wjb.14.2014.01.31.18.05.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 18:05:44 -0800 (PST) From: Filipe David Borba Manana To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org, jbacik@fb.com, Filipe David Borba Manana Subject: [PATCH] xfstests: more tests for test case btrfs/030 Date: Sat, 1 Feb 2014 02:05:32 +0000 Message-Id: <1391220332-22118-1-git-send-email-fdmanana@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This change adds some new tests for btrfs' incremental send feature. These are all related with inverting the parent-child relationship of directories, and cover the cases: * when the new parent didn't get renamed (just moved) * when a child file of the former parent gets renamed too These new cases are fixed by the following btrfs linux kernel patches: * "Btrfs: more send support for parent/child dir relationship inversion" * "Btrfs: fix send dealing with file renames and directory moves" Signed-off-by: Filipe David Borba Manana --- tests/btrfs/030 | 86 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 65 insertions(+), 21 deletions(-) diff --git a/tests/btrfs/030 b/tests/btrfs/030 index 6678ed8..6b52a0d 100755 --- a/tests/btrfs/030 +++ b/tests/btrfs/030 @@ -73,22 +73,41 @@ mkdir $SCRATCH_MNT/a/b/www echo "hey" > $SCRATCH_MNT/a/b/foobar.txt mkdir -p $SCRATCH_MNT/a/b/c3/x/y +mkdir -p $SCRATCH_MNT/a/b/foo1/foo2 +echo "hey" > $SCRATCH_MNT/a/b/foo1/foo2/f.txt +mkdir $SCRATCH_MNT/a/b/foo3 + +mkdir -p $SCRATCH_MNT/a/b/bar1/bar2/bar3/bar4 +echo "ola" > $SCRATCH_MNT/a/b/bar1/bar2/bar3/bar4/hello.txt + # Directory tree looks like: # -# . (ino 256) -# |-- a/ (ino 257) -# |-- b/ (ino 258) -# |-- c/ (ino 259) -# | |-- file.txt (ino 260) -# | |-- d/ (ino 261) +# . (ino 256) +# |-- a/ (ino 257) +# |-- b/ (ino 258) +# |-- c/ (ino 259) +# | |-- file.txt (ino 260) +# | |-- d/ (ino 261) +# | +# |-- c2/ (ino 262) +# |-- www/ (ino 263) +# |-- foobar.txt (ino 264) +# | +# |-- c3/ (ino 265) +# | |-- x/ (ino 266) +# | |-- y/ (ino 267) +# | +# |-- foo1/ (ino 268) +# | |---foo2/ (ino 269) +# | |---f.txt (ino 270) # | -# |-- c2/ (ino 262) -# |-- www/ (ino 263) -# |-- foobar.txt (ino 264) +# |-- foo3/ (ino 271) # | -# |-- c3/ (ino 265) -# |-- x/ (ino 266) -# |-- y/ (ino 267) +# |-- bar1/ (ino 272) +# |-- bar2/ (ino 273) +# |-- bar3/ (ino 274) +# |-- bar4 (ino 275) +# |--hello.txt (ino 276) run_check $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT \ $SCRATCH_MNT/mysnap1 @@ -104,21 +123,46 @@ mv $SCRATCH_MNT/a/b/foobar.txt $SCRATCH_MNT/a/b/c2/y2/x2/qwerty.txt ln $SCRATCH_MNT/a/b/c2/d2/cc/file.txt $SCRATCH_MNT/a/b/c2/y2/x2/Z/file_link.txt mv $SCRATCH_MNT/a/b/c2/d2/cc/file.txt $SCRATCH_MNT/a/b/c2/y2/x2 +mv $SCRATCH_MNT/a/b/foo3 $SCRATCH_MNT/a/b/foo1/foo33 +mv $SCRATCH_MNT/a/b/foo1/foo2 $SCRATCH_MNT/a/b/foo1/foo33/foo22 +mv $SCRATCH_MNT/a/b/foo1/foo33/foo22/f.txt \ + $SCRATCH_MNT/a/b/foo1/foo33/foo22/fff.txt + +echo " hello" >> $SCRATCH_MNT/a/b/bar1/bar2/bar3/bar4/hello.txt +mv $SCRATCH_MNT/a/b/bar1/bar2/bar3/bar4/hello.txt \ + $SCRATCH_MNT/a/b/bar1/bar2/bar3/bar4/hello2.txt +mv $SCRATCH_MNT/a/b/bar1/bar2/bar3/bar4 $SCRATCH_MNT/a/b/k44 +mv $SCRATCH_MNT/a/b/bar1/bar2/bar3 $SCRATCH_MNT/a/b/k44 +mv $SCRATCH_MNT/a/b/bar1/bar2 $SCRATCH_MNT/a/b/k44/bar3 +mv $SCRATCH_MNT/a/b/bar1 $SCRATCH_MNT/a/b/k44/bar3/bar2/k11 + # Directory tree now looks like: # # . (ino 256) # |-- a/ (ino 257) # |-- b/ (ino 258) # |-- c2/ (ino 262) -# |-- d2/ (ino 261) -# | |-- cc/ (ino 259) -# | |-- file.txt (ino 260) -# |-- y2/ (ino 267) -# |-- x2/ (ino 266) -# |-- qwerty.txt (ino 264) -# |-- WWW/ (ino 263) -# |-- Z/ (ino 265) -# |-- file_link.txt +# | |-- d2/ (ino 261) +# | | |-- cc/ (ino 259) +# | | +# | |-- y2/ (ino 267) +# | |-- x2/ (ino 266) +# | |-- file.txt (ino 260) +# | |-- qwerty.txt (ino 264) +# | |-- WWW/ (ino 263) +# | |-- Z/ (ino 265) +# | |-- file_link.txt +# | +# |-- foo1/ (ino 268) +# | |---foo33/ (ino 271) +# | |---foo22/ (ino 269) +# | |---fff.txt (ino 270) +# | +# |-- k44/ (ino 275) +# |-- hello2.txt (ino 276) +# |-- bar3/ (ino 274) +# |-- bar2/ (ino 273) +# |-- k11/ (ino 272) run_check $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT \ $SCRATCH_MNT/mysnap2