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