Blame SOURCES/e2fsprogs-1.45.6-tests-add-the-r_meta_bg_shrink-test.patch

3b974a
From c4e61a30629918fded02c728a2000d195db7ebe6 Mon Sep 17 00:00:00 2001
3b974a
From: Theodore Ts'o <tytso@mit.edu>
3b974a
Date: Sat, 9 Aug 2014 13:05:21 -0400
3b974a
Subject: [PATCH 5/5] tests: add the r_meta_bg_shrink test
3b974a
3b974a
This test checks to make sure resize2fs can properly handle a file
3b974a
system which started life as a normal ext4 file system and then was
3b974a
grown to a size where meta_bg was enabled, and then shrunk back below
3b974a
the point where the meta_bg format is still needed.
3b974a
3b974a
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
3b974a
---
3b974a
 tests/r_meta_bg_shrink/script | 34 ++++++++++++++++++++++++++++++++++
3b974a
 1 file changed, 34 insertions(+)
3b974a
 create mode 100644 tests/r_meta_bg_shrink/script
3b974a
3b974a
diff --git a/tests/r_meta_bg_shrink/script b/tests/r_meta_bg_shrink/script
3b974a
new file mode 100644
3b974a
index 00000000..de777775
3b974a
--- /dev/null
3b974a
+++ b/tests/r_meta_bg_shrink/script
3b974a
@@ -0,0 +1,34 @@
3b974a
+if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
3b974a
+
3b974a
+test_description="meta_bg shrink"
3b974a
+FEATURES="-t ext4 -O 64bit,meta_bg,^resize_inode -b 1024"
3b974a
+SIZE_1=1G
3b974a
+SIZE_2=48M
3b974a
+LOG=$test_name.log
3b974a
+E2FSCK=../e2fsck/e2fsck
3b974a
+RESIZE2FS_OPTS=-f
3b974a
+
3b974a
+. $cmd_dir/scripts/resize_test
3b974a
+
3b974a
+export MKE2FS_FIRST_META_BG=2
3b974a
+resize_test
3b974a
+unset MKE2FS_FIRST_META_BG
3b974a
+
3b974a
+RC=$?
3b974a
+if [ $RC -eq 0 ]; then
3b974a
+	echo "$test_name: $test_description: ok"
3b974a
+	touch $test_name.ok
3b974a
+elif [ $RC -eq 111 ]; then
3b974a
+	echo "$test_name: $test_description: skipped"
3b974a
+	touch $test_name.ok
3b974a
+else
3b974a
+	echo "$test_name: $test_description: failed"
3b974a
+	ln $LOG $test_name.failed
3b974a
+fi
3b974a
+
3b974a
+unset FEATURES SIZE_1 SIZE_2 LOG E2FSCK
3b974a
+
3b974a
+else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then
3b974a
+	echo "$test_name: $test_description: skipped"
3b974a
+fi
3b974a
+
3b974a
-- 
3b974a
2.21.3
3b974a