btrfs-progs: test: Add test image for btrfsck qgroup rescan detection
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 7 Oct 2016 07:22:59 +0000 (15:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Oct 2016 13:03:04 +0000 (15:03 +0200)
Fixed by commit 7c646c538e74 btrfs-progs: qgroup: Fix regression leads
to corrupted qgroup status.

Add minimal test image for that fix.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ minor cleanups in test.sh ]
Signed-off-by: David Sterba <dsterba@suse.com>
tests/fsck-tests/022-qgroup-rescan-halfway/qgroup_rescan_halfway.raw.xz [new file with mode: 0644]
tests/fsck-tests/022-qgroup-rescan-halfway/test.sh [new file with mode: 0755]

diff --git a/tests/fsck-tests/022-qgroup-rescan-halfway/qgroup_rescan_halfway.raw.xz b/tests/fsck-tests/022-qgroup-rescan-halfway/qgroup_rescan_halfway.raw.xz
new file mode 100644 (file)
index 0000000..8cb620f
Binary files /dev/null and b/tests/fsck-tests/022-qgroup-rescan-halfway/qgroup_rescan_halfway.raw.xz differ
diff --git a/tests/fsck-tests/022-qgroup-rescan-halfway/test.sh b/tests/fsck-tests/022-qgroup-rescan-halfway/test.sh
new file mode 100755 (executable)
index 0000000..5b114ee
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+# check whether btrfsck can detect running qgroup rescan
+
+source $TOP/tests/common
+
+check_prereq btrfs
+
+check_image() {
+       local image
+
+       image=$1
+       run_check_stdout $TOP/btrfs check "$image" 2>&1 | \
+               grep -q "Counts for qgroup id"
+       if [ $? -eq 0 ]; then
+               _fail "Btrfs check doesn't detect rescan correctly"
+       fi
+}
+
+check_all_images "."