Darrick J. Wong | 7ba5cc7 | 2014-07-22 18:01:53 -0400 | [diff] [blame^] | 1 | if ! test -x $DEBUGFS_EXE; then |
| 2 | echo "$test_name: $test_description: skipped" |
| 3 | exit 0 |
| 4 | fi |
| 5 | |
| 6 | OUT=$test_name.log |
| 7 | EXP=$test_dir/expect |
| 8 | VERIFY_FSCK_OPT=-yf |
| 9 | |
| 10 | ZIMAGE=$test_dir/image.gz |
| 11 | gzip -d < $ZIMAGE > $TMPFILE |
| 12 | |
| 13 | echo "*** long file" > $OUT |
| 14 | $DEBUGFS -R 'stat /file' $TMPFILE >> $OUT 2>&1 |
| 15 | echo "*** short file" >> $OUT |
| 16 | $DEBUGFS -R 'stat /shortfile' $TMPFILE >> $OUT 2>&1 |
| 17 | echo >> $OUT |
| 18 | |
| 19 | echo "*** long dir" >> $OUT |
| 20 | $DEBUGFS -R 'stat /dir' $TMPFILE >> $OUT 2>&1 |
| 21 | echo "*** short dir" >> $OUT |
| 22 | $DEBUGFS -R 'stat /shortdir' $TMPFILE >> $OUT 2>&1 |
| 23 | echo >> $OUT |
| 24 | |
| 25 | echo "*** long link" >> $OUT |
| 26 | $DEBUGFS -R 'stat /link' $TMPFILE >> $OUT 2>&1 |
| 27 | echo "*** short link" >> $OUT |
| 28 | $DEBUGFS -R 'stat /shortlink' $TMPFILE >> $OUT 2>&1 |
| 29 | |
| 30 | echo "*** end test" >> $OUT |
| 31 | |
| 32 | cmp -s $OUT $EXP |
| 33 | status=$? |
| 34 | |
| 35 | if [ "$status" = 0 ] ; then |
| 36 | echo "$test_name: $test_description: ok" |
| 37 | touch $test_name.ok |
| 38 | else |
| 39 | echo "$test_name: $test_description: failed" |
| 40 | diff $DIFF_OPTS $EXP $OUT > $test_name.failed |
| 41 | fi |
| 42 | |
| 43 | unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA ZIMAGE |