diff mbox

[4/6] btrfs-progs: fsck-tests: Add fallback TEST_DEV for test case 013

Message ID 1428044477-18485-5-git-send-email-quwenruo@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Qu Wenruo April 3, 2015, 7:01 a.m. UTC
Add fallback TEST_DEV for test case 013.
Fallback to $TOP/tests/test.img.

Now all test cases of btrfs-progs need no extra setting except sudo.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 tests/fsck-tests/013-extent-tree-rebuild/test.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/tests/fsck-tests/013-extent-tree-rebuild/test.sh b/tests/fsck-tests/013-extent-tree-rebuild/test.sh
index 7453ed7..e05a035 100755
--- a/tests/fsck-tests/013-extent-tree-rebuild/test.sh
+++ b/tests/fsck-tests/013-extent-tree-rebuild/test.sh
@@ -6,8 +6,13 @@  check_prereq btrfs-debug-tree
 setup_root_helper
 
 if [ -z $TEST_DEV ]; then
-	echo "    [NOTRUN] extent tree rebuild, need TEST_DEV variant"
-	exit 0
+	echo "\$TEST_DEV not given, use $TOP/test/test.img as fallback" >> \
+		$RESULTS
+	TEST_DEV="$TOP/tests/test.img"
+
+	# Need at least 1G to avoid mixed block group, which extent tree
+	# rebuild doesn't support.
+	run_check truncate -s 1G $TEST_DEV
 fi
 
 if [ -z $TEST_MNT ];then