Whamcloud - gitweb
e2fsck: track errors/badness found for each inode
[tools/e2fsprogs.git] / tests / f_create_symlinks / script
1 if ! test -x $DEBUGFS_EXE; then
2         echo "$test_name: $test_description: skipped (no debugfs)"
3         return 0
4 fi
5
6 FSCK_OPT=-yf
7 OUT=$test_name.log
8 if [ -f $test_dir/expect.gz ]; then
9         EXP=$test_name.tmp
10         gunzip < $test_dir/expect.gz > $EXP1
11 else
12         EXP=$test_dir/expect
13 fi
14
15 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
16
17 echo mke2fs -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 test.img 1024 > $OUT.new
18 $MKE2FS -q -F -o Linux -b 1024 -g 256 -O inline_data,extents -I 256 $TMPFILE 1024 >> $OUT 2>&1
19
20 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT.new 2>&1
21 status=$?
22 echo Exit status is $status >> $OUT.new
23
24 for i in 30 60 70 500 1023 1024 1500; do
25         echo "debugfs -R \"symlink /l_$i $(perl -e "print 'x' x $i;")\" test.img" >> $OUT.new
26         $DEBUGFS -w -R "symlink /l_$i $(perl -e "print 'x' x $i;")" $TMPFILE \
27                  2>&1 | sed -f $cmd_dir/filter.sed >> $OUT.new
28 done
29
30 for i in 30 60 70 500 1023 1024 1500; do
31         echo "debugfs -R \"stat /l_$i\" test.img" >> $OUT.new
32         $DEBUGFS -R "stat /l_$i" $TMPFILE 2>&1 | \
33                  grep -v "time: " >> $OUT.new
34 done
35
36 $FSCK $FSCK_OPT  -N test_filesys $TMPFILE >> $OUT.new 2>&1
37 status=$?
38 echo Exit status is $status >> $OUT.new
39 sed -f $cmd_dir/filter.sed $OUT.new >> $OUT
40 rm -f $OUT.new $TMPFILE
41
42 cmp -s $OUT $EXP
43 status=$?
44
45 if [ "$status" = 0 ] ; then
46         echo "$test_name: $test_description: ok"
47         touch $test_name.ok
48 else
49         echo "$test_name: $test_description: failed"
50         diff $DIFF_OPTS $EXP $OUT > $test_name.failed
51         rm -f $test_name.tmp
52 fi
53
54 unset IMAGE FSCK_OPT OUT EXP