1*6a54128fSAndroid Build Coastguard Workertest_description="e2undo a non-undo file" 2*6a54128fSAndroid Build Coastguard Workerif test -x $E2UNDO_EXE; then 3*6a54128fSAndroid Build Coastguard Worker 4*6a54128fSAndroid Build Coastguard WorkerTDB_FILE=${TMPDIR:-/tmp}/tune2fs-$(basename $TMPFILE).e2undo 5*6a54128fSAndroid Build Coastguard WorkerOUT=$test_name.log 6*6a54128fSAndroid Build Coastguard Workerrm -f $TDB_FILE >/dev/null 2>&1 7*6a54128fSAndroid Build Coastguard Worker 8*6a54128fSAndroid Build Coastguard Workerdd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 9*6a54128fSAndroid Build Coastguard Workerdd if=/dev/zero of=$TDB_FILE bs=1k count=512 > /dev/null 2>&1 10*6a54128fSAndroid Build Coastguard Worker 11*6a54128fSAndroid Build Coastguard Workercrc0=`$CRCSUM $TMPFILE` 12*6a54128fSAndroid Build Coastguard Workerecho $CRCSUM before e2undo $crc0 > $OUT 13*6a54128fSAndroid Build Coastguard Worker 14*6a54128fSAndroid Build Coastguard Workerod -tx1 -Ad -c < $TDB_FILE >> $OUT 15*6a54128fSAndroid Build Coastguard Worker 16*6a54128fSAndroid Build Coastguard Worker$E2UNDO $TDB_FILE $TMPFILE >> $OUT 2>&1 17*6a54128fSAndroid Build Coastguard Workercrc3=`$CRCSUM $TMPFILE` 18*6a54128fSAndroid Build Coastguard Workerecho $CRCSUM after e2undo $crc3 >> $OUT 19*6a54128fSAndroid Build Coastguard Worker 20*6a54128fSAndroid Build Coastguard Workerif [ $crc3 = $crc0 ]; then 21*6a54128fSAndroid Build Coastguard Worker echo "$test_name: $test_description: ok" 22*6a54128fSAndroid Build Coastguard Worker touch $test_name.ok 23*6a54128fSAndroid Build Coastguard Workerelse 24*6a54128fSAndroid Build Coastguard Worker ln -f $test_name.log $test_name.failed 25*6a54128fSAndroid Build Coastguard Worker echo "$test_name: $test_description: failed" 26*6a54128fSAndroid Build Coastguard Workerfi 27*6a54128fSAndroid Build Coastguard Workerrm -f $TDB_FILE $TMPFILE 28*6a54128fSAndroid Build Coastguard Workerfi 29