1#!/bin/bash 2 3if test -x $DEBUGFS_EXE; then 4FSCK_OPT=-fy 5IMAGE=$test_dir/image.gz 6 7gzip -d < $IMAGE > $TMPFILE 8#e2label $TMPFILE test_filesys 9 10# Run fsck to fix things? 11EXP=$test_dir/expect 12OUT=$test_name.log 13rm -rf $test_name.failed $test_name.ok 14 15$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $OUT 16echo "Exit status is $?" >> $OUT 17 18echo "debugfs cat uninit file" >> $OUT 19echo "ex /a" > $TMPFILE.cmd 20echo "cat /a" >> $TMPFILE.cmd 21$DEBUGFS_EXE -w -f $TMPFILE.cmd $TMPFILE >> $OUT.new 2>&1 22echo >> $OUT.new 23sed -f $cmd_dir/filter.sed < $OUT.new >> $OUT 24rm -rf $OUT.new $TMPFILE $TMPFILE.cmd 25 26# Figure out what happened 27if cmp -s $EXP $OUT; then 28 echo "$test_name: $test_description: ok" 29 touch $test_name.ok 30else 31 echo "$test_name: $test_description: failed" 32 diff -u $EXP $OUT >> $test_name.failed 33fi 34unset EXP OUT FSCK_OPT IMAGE 35else #if test -a -x $DEBUGFS_EXE; then 36 echo "$test_name: $test_description: skipped" 37fi 38