[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1187000808916-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Date: Mon, 13 Aug 2007 15:56:26 +0530
From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To: tytso@....edu
Cc: linux-ext4@...r.kernel.org,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH 6/6] e2fsprogs: Add test case for undoe2fs
This adds two test case for undoe2fs.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
---
tests/test_config | 1 +
tests/u_undoe2fs_mke2fs/script | 31 +++++++++++++++++++++++++++++++
tests/u_undoe2fs_tune2fs/script | 31 +++++++++++++++++++++++++++++++
3 files changed, 63 insertions(+), 0 deletions(-)
create mode 100644 tests/u_undoe2fs_mke2fs/script
create mode 100644 tests/u_undoe2fs_tune2fs/script
diff --git a/tests/test_config b/tests/test_config
index f5ae0fe..f79ec79 100644
--- a/tests/test_config
+++ b/tests/test_config
@@ -13,6 +13,7 @@ DEBUGFS="$USE_VALGRIND ../debugfs/debugfs"
TEST_BITS="../debugfs/debugfs"
RESIZE2FS_EXE="../resize/resize2fs"
RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE"
+UNDOE2FS_EXE="../misc/undoe2fs"
TEST_REL=../tests/progs/test_rel
TEST_ICOUNT=../tests/progs/test_icount
LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss
diff --git a/tests/u_undoe2fs_mke2fs/script b/tests/u_undoe2fs_mke2fs/script
new file mode 100644
index 0000000..82ee6b3
--- /dev/null
+++ b/tests/u_undoe2fs_mke2fs/script
@@ -0,0 +1,31 @@
+printf "undoe2fs with mke2fs: "
+if test -x $UNDOE2FS_EXE; then
+
+export MKE2FS_SCRATCH_DIR=./
+TDB_FILE=./mke2fs-test.img
+OUT=$test_name.log
+rm -f $TDB_FILE >/dev/null 2>&1
+
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+
+echo mke2fs -q -F -o Linux -b 1024 test.img > $OUT
+$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >/dev/null 2>&1
+md5=$(md5sum $TMPFILE | cut -d " " -f 1)
+echo md5sum before mke2fs $md5 >> $OUT
+
+echo using mke2fs to test undoe2fs >> $OUT
+$MKE2FS -q -F -o Linux -I 256 -b 1024 $TMPFILE >/dev/null 2>&1
+new_md5=$(md5sum $TMPFILE | cut -d " " -f 1)
+echo md5sum after mke2fs $new_md5 >> $OUT
+
+$UNDOE2FS_EXE $TDB_FILE $TMPFILE >/dev/null 2>&1
+new_md5=$(md5sum $TMPFILE | cut -d " " -f 1)
+echo md5sum after undoe2fs $new_md5 >> $OUT
+
+if [ $md5 = $new_md5 ]; then
+ echo "ok"
+ touch $test_name.ok
+else
+ echo "failed"
+fi
+fi
diff --git a/tests/u_undoe2fs_tune2fs/script b/tests/u_undoe2fs_tune2fs/script
new file mode 100644
index 0000000..d01628d
--- /dev/null
+++ b/tests/u_undoe2fs_tune2fs/script
@@ -0,0 +1,31 @@
+printf "undoe2fs with tune2fs: "
+if test -x $UNDOE2FS_EXE; then
+
+export TUNE2FS_SCRATCH_DIR=./
+TDB_FILE=./tune2fs-test.img
+OUT=$test_name.log
+rm -f $TDB_FILE >/dev/null 2>&1
+
+dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
+
+echo mke2fs -q -F -o Linux -b 1024 test.img >> $OUT
+$MKE2FS -q -F -o Linux -I 128 -b 1024 $TMPFILE >/dev/null 2>&1
+md5=$(md5sum $TMPFILE | cut -d " " -f 1)
+echo md5sum before tune2fs $md5 >> $OUT
+
+echo using tune2fs to test undoe2fs >> $OUT
+$TUNE2FS -I 256 $TMPFILE >/dev/null 2>&1
+new_md5=$(md5sum $TMPFILE | cut -d " " -f 1)
+echo md5sum after tune2fs $new_md5 >> $OUT
+
+$UNDOE2FS_EXE $TDB_FILE $TMPFILE >/dev/null 2>&1
+new_md5=$(md5sum $TMPFILE | cut -d " " -f 1)
+echo md5sum after undoe2fs $new_md5 >> $OUT
+
+if [ $md5 = $new_md5 ]; then
+ echo "ok"
+ touch $test_name.ok
+else
+ echo "failed"
+fi
+fi
--
1.5.3.rc4.67.gf9286-dirty
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists