Whamcloud - gitweb
e2fsck: check and fix tails of all bitmap blocks
[tools/e2fsprogs.git] / tests / u_mke2fs_opt_oddsize / script
1 test_description="e2undo with mke2fs -z and non-32k-aligned bdev size"
2 if test -x $E2UNDO_EXE; then
3
4 TDB_FILE=${TMPDIR:-/tmp}/mke2fs-$(basename $TMPFILE).e2undo
5 OUT=$test_name.log
6 rm -f $TDB_FILE >/dev/null 2>&1
7
8 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
9 yes "abc123abc123abc" | dd bs=1k count=8 >> $TMPFILE 2> /dev/null
10
11 crc0=`$CRCSUM $TMPFILE`
12 echo $CRCSUM before mke2fs $crc0 > $OUT
13
14 echo using mke2fs to test e2undo >> $OUT
15 $MKE2FS -q -F -o Linux -T ext4 -E lazy_itable_init=1 -b 1024 -z $TDB_FILE $TMPFILE  >> $OUT 2>&1
16 crc1=`$CRCSUM $TMPFILE`
17 echo $CRCSUM after mke2fs $crc1 >> $OUT
18
19 $E2UNDO  $TDB_FILE $TMPFILE  >> $OUT 2>&1
20 crc2=`$CRCSUM $TMPFILE`
21 echo $CRCSUM after e2undo $crc2 >> $OUT
22
23 if [ $crc0 = $crc2 ] && [ $crc1 != $crc2 ]; then
24         echo "$test_name: $test_description: ok"
25         touch $test_name.ok
26 else
27         ln -f $test_name.log $test_name.failed
28         echo "$test_name: $test_description: failed"
29 fi
30 rm -f $TDB_FILE $TMPFILE
31 fi