Whamcloud - gitweb
tests, mke2fs: add option to suppress xattr copying to fix f_extent_htree
[tools/e2fsprogs.git] / tests / u_not_undo / script
1 test_description="e2undo a non-undo file"
2 if test -x $E2UNDO_EXE; then
3
4 TDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(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 dd if=/dev/zero of=$TDB_FILE bs=1k count=512 > /dev/null 2>&1
10
11 crc0=`$CRCSUM $TMPFILE`
12 echo $CRCSUM before e2undo $crc0 > $OUT
13
14 od -tx1 -Ad -c < $TDB_FILE >> $OUT
15
16 $E2UNDO $TDB_FILE $TMPFILE  >> $OUT 2>&1
17 crc3=`$CRCSUM $TMPFILE`
18 echo $CRCSUM after e2undo $crc3 >> $OUT
19
20 if [ $crc3 = $crc0 ]; then
21         echo "$test_name: $test_description: ok"
22         touch $test_name.ok
23 else
24         ln -f $test_name.log $test_name.failed
25         echo "$test_name: $test_description: failed"
26 fi
27 rm -f $TDB_FILE $TMPFILE
28 fi