linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Btrfs: add serval test case for incremental send
@ 2016-10-13 11:04 robbieko
  2016-10-13 11:04 ` [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256 robbieko
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: robbieko @ 2016-10-13 11:04 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Robbie Ko

From: Robbie Ko <robbieko@synology.com>

Patch for test btrfs incremental send. 

Robbie Ko (4):
  btrfs: add test for an incremental send don't skip overwrite ref for
    inode 256
  btrfs: add test for an incremental send add gen for is_waiting_for_rm
    when some corner case
  btrfs: add test for an incremental send add gen check in
    did_overwrite_ref
  btrfs: add test for an incremental send add gen check in
    will_overwrite_ref

 tests/btrfs/131     | 110 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/131.out |   2 +
 tests/btrfs/132     | 116 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/132.out |   2 +
 tests/btrfs/133     | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/133.out |   2 +
 tests/btrfs/134     | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/134.out |   2 +
 tests/btrfs/group   |   4 ++
 9 files changed, 479 insertions(+)
 create mode 100755 tests/btrfs/131
 create mode 100644 tests/btrfs/131.out
 create mode 100755 tests/btrfs/132
 create mode 100644 tests/btrfs/132.out
 create mode 100755 tests/btrfs/133
 create mode 100644 tests/btrfs/133.out
 create mode 100755 tests/btrfs/134
 create mode 100644 tests/btrfs/134.out

-- 
1.9.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256
  2016-10-13 11:04 [PATCH 0/4] Btrfs: add serval test case for incremental send robbieko
@ 2016-10-13 11:04 ` robbieko
  2016-10-13 11:42   ` Filipe Manana
  2016-10-13 11:04 ` [PATCH 2/4] btrfs: add test for an incremental send add gen for is_waiting_for_rm when some corner case robbieko
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: robbieko @ 2016-10-13 11:04 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Robbie Ko

From: Robbie Ko <robbieko@synology.com>

Test that an incremental send operation does not skip overwrite ref
for inode 256, it's always exist.

This test exercises scenarios used to fail in btrfs and are fixed by
the following patches for the linux kernel:

"Btrfs: incremental send, fix don't skip inode 256 in overwrite_ref"

Signed-off-by: Robbie Ko <robbieko@synology.com>
---
 tests/btrfs/131     | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/131.out |   2 +
 tests/btrfs/group   |   1 +
 3 files changed, 113 insertions(+)
 create mode 100755 tests/btrfs/131
 create mode 100644 tests/btrfs/131.out

diff --git a/tests/btrfs/131 b/tests/btrfs/131
new file mode 100755
index 0000000..2359841
--- /dev/null
+++ b/tests/btrfs/131
@@ -0,0 +1,110 @@
+#! /bin/bash
+# FS QA Test No. btrfs/131
+#
+# Test that an incremental send operation does not skip inode 256 check
+# overwrite ref, because inode 256 always exist.
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
+# Author: Filipe Manana <fdmanana@suse.com>
+#
+# 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
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -fr $send_files_dir
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+_require_test
+_require_scratch
+_require_fssum
+
+send_files_dir=$TEST_DIR/btrfs-test-$seq
+
+rm -f $seqres.full
+rm -fr $send_files_dir
+mkdir $send_files_dir
+
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+mkdir $SCRATCH_MNT/a1
+mkdir $SCRATCH_MNT/a2
+
+# Filesystem looks like:
+#
+# .                                                             (ino 256)
+# |--- a1/                                                      (ino 257)
+# |
+# |--- a2/                                                      (ino 258)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+touch $SCRATCH_MNT/a2
+
+# Filesystem now looks like:
+#
+# .                                                             (ino 256)
+# |--- a2                                                       (ino 257)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+rm $send_files_dir/1.snap
+
+run_check $FSSUM_PROG -A -f -w $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+run_check $FSSUM_PROG -A -f -w $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
+	-f $send_files_dir/2.snap
+
+# Now recreate the filesystem by receiving both send streams and verify we get
+# the same content that the original filesystem had.
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
+run_check $FSSUM_PROG -r $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/131.out b/tests/btrfs/131.out
new file mode 100644
index 0000000..d118ca9
--- /dev/null
+++ b/tests/btrfs/131.out
@@ -0,0 +1,2 @@
+QA output created by 131
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index f3a7a4f..a7a070a 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -133,3 +133,4 @@
 128 auto quick send
 129 auto quick send
 130 auto clone send
+131 auto quick send
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] btrfs: add test for an incremental send add gen for is_waiting_for_rm when some corner case
  2016-10-13 11:04 [PATCH 0/4] Btrfs: add serval test case for incremental send robbieko
  2016-10-13 11:04 ` [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256 robbieko
@ 2016-10-13 11:04 ` robbieko
  2016-10-13 11:04 ` [PATCH 3/4] btrfs: add test for an incremental send add gen check in did_overwrite_ref robbieko
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: robbieko @ 2016-10-13 11:04 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Robbie Ko

From: Robbie Ko <robbieko@synology.com>

There a one case for old_gen waiting_for_rm,
but new_gen use get_cur_path with the same inode.

This test exercises scenarios used to fail in btrfs and are fixed by
the following patches for the linux kernel:

"Btrfs: incremental send, add gen for is_waiting_for_rm when some corner case"
"Btrfs: incremental send, add gen for send_utimes in apply_dir_move"

Signed-off-by: Robbie Ko <robbieko@synology.com>
---
 tests/btrfs/132     | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/132.out |   2 +
 tests/btrfs/group   |   1 +
 3 files changed, 119 insertions(+)
 create mode 100755 tests/btrfs/132
 create mode 100644 tests/btrfs/132.out

diff --git a/tests/btrfs/132 b/tests/btrfs/132
new file mode 100755
index 0000000..1ecd3b5
--- /dev/null
+++ b/tests/btrfs/132
@@ -0,0 +1,116 @@
+#! /bin/bash
+# FS QA Test No. btrfs/132
+#
+# Test that an incremental send operation,
+# add gen for is_waiting_for_rm when some corner case.
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
+# Author: Filipe Manana <fdmanana@suse.com>
+#
+# 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
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -fr $send_files_dir
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+_require_test
+_require_scratch
+_require_fssum
+
+send_files_dir=$TEST_DIR/btrfs-test-$seq
+
+rm -f $seqres.full
+rm -fr $send_files_dir
+mkdir $send_files_dir
+
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+mkdir $SCRATCH_MNT/dir257
+mkdir $SCRATCH_MNT/dir258
+mkdir $SCRATCH_MNT/dir259
+mv $SCRATCH_MNT/dir257 $SCRATCH_MNT/dir258/dir257
+
+# Filesystem looks like:
+#
+# .                                                             (ino 256)
+# |--- dir258/                                                  (ino 258)
+# |    |--- dir257/                                             (ino 257)
+# |
+# |--- dir259/                                                  (ino 259)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
+
+mv $SCRATCH_MNT/dir258/dir257 $SCRATCH_MNT/dir257
+rmdir $SCRATCH_MNT/dir258
+rmdir $SCRATCH_MNT/dir259
+_scratch_unmount
+_scratch_mount
+touch $SCRATCH_MNT/file258
+mkdir $SCRATCH_MNT/new_dir259
+mv $SCRATCH_MNT/dir257 $SCRATCH_MNT/new_dir259/dir257
+
+# Filesystem now looks like:
+#
+# .                                                             (ino 256)
+# |--- file258                                                  (ino 258)
+# |
+# |--- new_dir259/                                              (ino 259)
+# |    |--- dir257/                                             (ino 257)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
+
+run_check $FSSUM_PROG -A -f -w $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+run_check $FSSUM_PROG -A -f -w $send_files_dir/2.fssum \
+        -x $SCRATCH_MNT/mysnap2/mysnap1 $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
+	-f $send_files_dir/2.snap
+
+# Now recreate the filesystem by receiving both send streams and verify we get
+# the same content that the original filesystem had.
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
+run_check $FSSUM_PROG -r $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/132.out b/tests/btrfs/132.out
new file mode 100644
index 0000000..b096312
--- /dev/null
+++ b/tests/btrfs/132.out
@@ -0,0 +1,2 @@
+QA output created by 132
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index a7a070a..1b12382 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -134,3 +134,4 @@
 129 auto quick send
 130 auto clone send
 131 auto quick send
+132 auto quick send
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] btrfs: add test for an incremental send add gen check in did_overwrite_ref
  2016-10-13 11:04 [PATCH 0/4] Btrfs: add serval test case for incremental send robbieko
  2016-10-13 11:04 ` [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256 robbieko
  2016-10-13 11:04 ` [PATCH 2/4] btrfs: add test for an incremental send add gen for is_waiting_for_rm when some corner case robbieko
@ 2016-10-13 11:04 ` robbieko
  2016-10-13 11:04 ` [PATCH 4/4] btrfs: add test for an incremental send add gen check in will_overwrite_ref robbieko
  2016-10-13 11:49 ` [PATCH 0/4] Btrfs: add serval test case for incremental send Filipe Manana
  4 siblings, 0 replies; 7+ messages in thread
From: robbieko @ 2016-10-13 11:04 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Robbie Ko

From: Robbie Ko <robbieko@synology.com>

There a some case, the old gen directory can not have new
data to write, can not cause overwitre ref, except inode 256.

This test exercises scenarios used to fail in btrfs and are fixed by
the following patches for the linux kernel:

"Btrfs: incremental send, add gen check in did_overwrite_ref"

Signed-off-by: Robbie Ko <robbieko@synology.com>
---
 tests/btrfs/133     | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/133.out |   2 +
 tests/btrfs/group   |   1 +
 3 files changed, 123 insertions(+)
 create mode 100755 tests/btrfs/133
 create mode 100644 tests/btrfs/133.out

diff --git a/tests/btrfs/133 b/tests/btrfs/133
new file mode 100755
index 0000000..e292c00
--- /dev/null
+++ b/tests/btrfs/133
@@ -0,0 +1,120 @@
+#! /bin/bash
+# FS QA Test No. btrfs/133
+#
+# Test that an incremental send operation,
+# the old gen directory can not have new
+# data to write, can not cause overwitre ref, except inode 256.
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
+# Author: Filipe Manana <fdmanana@suse.com>
+#
+# 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
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -fr $send_files_dir
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+_require_test
+_require_scratch
+_require_fssum
+
+send_files_dir=$TEST_DIR/btrfs-test-$seq
+
+rm -f $seqres.full
+rm -fr $send_files_dir
+mkdir $send_files_dir
+
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+touch $SCRATCH_MNT/f
+mkdir $SCRATCH_MNT/d1
+mkdir $SCRATCH_MNT/d259_old
+mv $SCRATCH_MNT/d1 $SCRATCH_MNT/d259_old/d1
+
+# Filesystem looks like:
+#
+# .                                                             (ino 256)
+# |--- f                                                        (ino 257)
+# |
+# |--- d259_old/                                                (ino 259)
+# |    |--- d1/                                                 (ino 258)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+mkdir $SCRATCH_MNT/d1
+mkdir $SCRATCH_MNT/dir258
+mkdir $SCRATCH_MNT/dir259
+mv $SCRATCH_MNT/d1 $SCRATCH_MNT/dir259/d1
+
+# Filesystem now looks like:
+#
+# .                                                             (ino 256)
+# |--- dir258                                                   (ino 258)
+# |
+# |--- dir259/                                                  (ino 259)
+# |    |--- d1/                                                 (ino 257)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+rm $send_files_dir/1.snap
+
+run_check $FSSUM_PROG -A -f -w $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+run_check $FSSUM_PROG -A -f -w $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
+	-f $send_files_dir/2.snap
+
+# Now recreate the filesystem by receiving both send streams and verify we get
+# the same content that the original filesystem had.
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
+run_check $FSSUM_PROG -r $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/133.out b/tests/btrfs/133.out
new file mode 100644
index 0000000..e914d62
--- /dev/null
+++ b/tests/btrfs/133.out
@@ -0,0 +1,2 @@
+QA output created by 133
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index 1b12382..779caec 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -135,3 +135,4 @@
 130 auto clone send
 131 auto quick send
 132 auto quick send
+133 auto quick send
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] btrfs: add test for an incremental send add gen check in will_overwrite_ref
  2016-10-13 11:04 [PATCH 0/4] Btrfs: add serval test case for incremental send robbieko
                   ` (2 preceding siblings ...)
  2016-10-13 11:04 ` [PATCH 3/4] btrfs: add test for an incremental send add gen check in did_overwrite_ref robbieko
@ 2016-10-13 11:04 ` robbieko
  2016-10-13 11:49 ` [PATCH 0/4] Btrfs: add serval test case for incremental send Filipe Manana
  4 siblings, 0 replies; 7+ messages in thread
From: robbieko @ 2016-10-13 11:04 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Robbie Ko

From: Robbie Ko <robbieko@synology.com>

There a some case for overwrite ref,
because when new gen is waiting, and old name conflict,
but old name has been deleted.

This test exercises scenarios used to fail in btrfs and are fixed by
the following patches for the linux kernel:

"Btrfs: incremental send, add gen check if has waiting_dir_move in the will_overwrite_ref"

Signed-off-by: Robbie Ko <robbieko@synology.com>
---
 tests/btrfs/134     | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/134.out |   2 +
 tests/btrfs/group   |   1 +
 3 files changed, 124 insertions(+)
 create mode 100755 tests/btrfs/134
 create mode 100644 tests/btrfs/134.out

diff --git a/tests/btrfs/134 b/tests/btrfs/134
new file mode 100755
index 0000000..0bde622
--- /dev/null
+++ b/tests/btrfs/134
@@ -0,0 +1,121 @@
+#! /bin/bash
+# FS QA Test No. btrfs/134
+#
+# Test that an incremental send operation,
+# when new gen is waiting, and old name conflict,
+# but old name has been deleted.
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
+# Author: Filipe Manana <fdmanana@suse.com>
+#
+# 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
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -fr $send_files_dir
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+_require_test
+_require_scratch
+_require_fssum
+
+send_files_dir=$TEST_DIR/btrfs-test-$seq
+
+rm -f $seqres.full
+rm -fr $send_files_dir
+mkdir $send_files_dir
+
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+mkdir $SCRATCH_MNT/d1
+mkdir $SCRATCH_MNT/d4
+mkdir $SCRATCH_MNT/d3
+
+# Filesystem looks like:
+#
+# .                                                             (ino 256)
+# |--- d1                                                       (ino 257)
+# |--- d4                                                       (ino 258)
+# |--- d3                                                       (ino 259)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+mkdir $SCRATCH_MNT/d1
+mkdir $SCRATCH_MNT/d2
+mkdir $SCRATCH_MNT/d3
+mkdir $SCRATCH_MNT/d4
+mv $SCRATCH_MNT/d1 $SCRATCH_MNT/d3/d1
+mv $SCRATCH_MNT/d3 $SCRATCH_MNT/d4/d3
+mv $SCRATCH_MNT/d2 $SCRATCH_MNT/d1
+
+# Filesystem now looks like:
+#
+# .                                                             (ino 256)
+# |--- d1                                                       (ino 258)
+# |--- d4                                                       (ino 260)
+# |    |--- d3/                                                 (ino 259)
+# |    |    |--- d1/                                            (ino 257)
+#
+_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+rm $send_files_dir/1.snap
+
+run_check $FSSUM_PROG -A -f -w $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+run_check $FSSUM_PROG -A -f -w $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
+_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
+	-f $send_files_dir/2.snap
+
+# Now recreate the filesystem by receiving both send streams and verify we get
+# the same content that the original filesystem had.
+_scratch_unmount
+_scratch_mkfs >>$seqres.full 2>&1
+_scratch_mount
+
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
+run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
+_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
+run_check $FSSUM_PROG -r $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
+
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/134.out b/tests/btrfs/134.out
new file mode 100644
index 0000000..829c30e
--- /dev/null
+++ b/tests/btrfs/134.out
@@ -0,0 +1,2 @@
+QA output created by 134
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index 779caec..831283e 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -136,3 +136,4 @@
 131 auto quick send
 132 auto quick send
 133 auto quick send
+134 auto quick send
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256
  2016-10-13 11:04 ` [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256 robbieko
@ 2016-10-13 11:42   ` Filipe Manana
  0 siblings, 0 replies; 7+ messages in thread
From: Filipe Manana @ 2016-10-13 11:42 UTC (permalink / raw)
  To: robbieko; +Cc: linux-btrfs@vger.kernel.org

On Thu, Oct 13, 2016 at 12:04 PM, robbieko <robbieko@synology.com> wrote:
> From: Robbie Ko <robbieko@synology.com>
>
> Test that an incremental send operation does not skip overwrite ref
> for inode 256, it's always exist.

Tests should have a description that non-developers can understand
(like QA people for e.g.).
I doubt most QA people know how send works internally.

>
> This test exercises scenarios used to fail in btrfs and are fixed by
> the following patches for the linux kernel:

patches -> path

>
> "Btrfs: incremental send, fix don't skip inode 256 in overwrite_ref"
>
> Signed-off-by: Robbie Ko <robbieko@synology.com>
> ---
>  tests/btrfs/131     | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/131.out |   2 +
>  tests/btrfs/group   |   1 +
>  3 files changed, 113 insertions(+)
>  create mode 100755 tests/btrfs/131
>  create mode 100644 tests/btrfs/131.out
>
> diff --git a/tests/btrfs/131 b/tests/btrfs/131
> new file mode 100755
> index 0000000..2359841
> --- /dev/null
> +++ b/tests/btrfs/131
> @@ -0,0 +1,110 @@
> +#! /bin/bash
> +# FS QA Test No. btrfs/131
> +#
> +# Test that an incremental send operation does not skip inode 256 check
> +# overwrite ref, because inode 256 always exist.
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
> +# Author: Filipe Manana <fdmanana@suse.com>

No, I'm not the author of this test.

> +#
> +# 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
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +tmp=/tmp/$$
> +status=1       # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +       cd /
> +       rm -fr $send_files_dir
> +       rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs btrfs
> +_supported_os Linux
> +_require_test
> +_require_scratch
> +_require_fssum
> +
> +send_files_dir=$TEST_DIR/btrfs-test-$seq
> +
> +rm -f $seqres.full
> +rm -fr $send_files_dir
> +mkdir $send_files_dir
> +
> +_scratch_mkfs >>$seqres.full 2>&1
> +_scratch_mount
> +
> +mkdir $SCRATCH_MNT/a1
> +mkdir $SCRATCH_MNT/a2
> +
> +# Filesystem looks like:
> +#
> +# .                                                             (ino 256)
> +# |--- a1/                                                      (ino 257)
> +# |
> +# |--- a2/                                                      (ino 258)
> +#
> +_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1
> +
> +_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
> +
> +_scratch_unmount
> +_scratch_mkfs >>$seqres.full 2>&1
> +_scratch_mount
> +touch $SCRATCH_MNT/a2
> +
> +# Filesystem now looks like:
> +#
> +# .                                                             (ino 256)
> +# |--- a2                                                       (ino 257)
> +#
> +_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap2
> +
> +_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
> +rm $send_files_dir/1.snap
> +
> +run_check $FSSUM_PROG -A -f -w $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
> +run_check $FSSUM_PROG -A -f -w $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
> +
> +_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap
> +_run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 $SCRATCH_MNT/mysnap2 \
> +       -f $send_files_dir/2.snap
> +
> +# Now recreate the filesystem by receiving both send streams and verify we get
> +# the same content that the original filesystem had.
> +_scratch_unmount
> +_scratch_mkfs >>$seqres.full 2>&1
> +_scratch_mount
> +
> +_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap
> +run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1
> +_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/2.snap
> +run_check $FSSUM_PROG -r $send_files_dir/2.fssum $SCRATCH_MNT/mysnap2
> +
> +echo "Silence is golden"
> +status=0
> +exit
> diff --git a/tests/btrfs/131.out b/tests/btrfs/131.out
> new file mode 100644
> index 0000000..d118ca9
> --- /dev/null
> +++ b/tests/btrfs/131.out
> @@ -0,0 +1,2 @@
> +QA output created by 131
> +Silence is golden
> diff --git a/tests/btrfs/group b/tests/btrfs/group
> index f3a7a4f..a7a070a 100644
> --- a/tests/btrfs/group
> +++ b/tests/btrfs/group
> @@ -133,3 +133,4 @@
>  128 auto quick send
>  129 auto quick send
>  130 auto clone send
> +131 auto quick send
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Filipe David Manana,

"People will forget what you said,
 people will forget what you did,
 but people will never forget how you made them feel."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] Btrfs: add serval test case for incremental send
  2016-10-13 11:04 [PATCH 0/4] Btrfs: add serval test case for incremental send robbieko
                   ` (3 preceding siblings ...)
  2016-10-13 11:04 ` [PATCH 4/4] btrfs: add test for an incremental send add gen check in will_overwrite_ref robbieko
@ 2016-10-13 11:49 ` Filipe Manana
  4 siblings, 0 replies; 7+ messages in thread
From: Filipe Manana @ 2016-10-13 11:49 UTC (permalink / raw)
  To: robbieko; +Cc: linux-btrfs@vger.kernel.org

On Thu, Oct 13, 2016 at 12:04 PM, robbieko <robbieko@synology.com> wrote:
> From: Robbie Ko <robbieko@synology.com>
>
> Patch for test btrfs incremental send.
>
> Robbie Ko (4):
>   btrfs: add test for an incremental send don't skip overwrite ref for
>     inode 256
>   btrfs: add test for an incremental send add gen for is_waiting_for_rm
>     when some corner case
>   btrfs: add test for an incremental send add gen check in
>     did_overwrite_ref
>   btrfs: add test for an incremental send add gen check in
>     will_overwrite_ref

These should go to fstests@vger.kernel.org with
linux-btrfs@vger.kernel.org in cc.

Those patch subjects and change logs are too implementation specific.
They should be understandable by non developers (like QA people for
e.g.), think about it.
Do you think such people know what is is_waiting_for_rm,
did_overwrite_ref, "gen", etc?

You should take a look at git history and see subjects and change logs.
Both should say what is being tested, not the problems with code
functions and how you solved them.

Also please, if you are copy-pasting tests, don't leave me as the
author there nor the SUSE copyright.

>
>  tests/btrfs/131     | 110 +++++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/131.out |   2 +
>  tests/btrfs/132     | 116 +++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/132.out |   2 +
>  tests/btrfs/133     | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/133.out |   2 +
>  tests/btrfs/134     | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/134.out |   2 +
>  tests/btrfs/group   |   4 ++
>  9 files changed, 479 insertions(+)
>  create mode 100755 tests/btrfs/131
>  create mode 100644 tests/btrfs/131.out
>  create mode 100755 tests/btrfs/132
>  create mode 100644 tests/btrfs/132.out
>  create mode 100755 tests/btrfs/133
>  create mode 100644 tests/btrfs/133.out
>  create mode 100755 tests/btrfs/134
>  create mode 100644 tests/btrfs/134.out
>
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Filipe David Manana,

"People will forget what you said,
 people will forget what you did,
 but people will never forget how you made them feel."

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-13 13:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 11:04 [PATCH 0/4] Btrfs: add serval test case for incremental send robbieko
2016-10-13 11:04 ` [PATCH 1/4] btrfs: add test for an incremental send don't skip overwrite ref for inode 256 robbieko
2016-10-13 11:42   ` Filipe Manana
2016-10-13 11:04 ` [PATCH 2/4] btrfs: add test for an incremental send add gen for is_waiting_for_rm when some corner case robbieko
2016-10-13 11:04 ` [PATCH 3/4] btrfs: add test for an incremental send add gen check in did_overwrite_ref robbieko
2016-10-13 11:04 ` [PATCH 4/4] btrfs: add test for an incremental send add gen check in will_overwrite_ref robbieko
2016-10-13 11:49 ` [PATCH 0/4] Btrfs: add serval test case for incremental send Filipe Manana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).