~daniel-mehrmann/e2fsprogs/master

« back to all changes in this revision

Viewing changes to tests/f_create_symlinks/script

  • Committer: Daniel Mehrmann
  • Date: 2014-12-16 09:16:59 UTC
  • mfrom: (1.2.25)
  • Revision ID: daniel.mehrmann@gmx.de-20141216091659-ymhbl4ualba43vuc
Tags: 1.43-SN-2014-12-16-0ubuntu1
* Merge in snapshot from the maint branch 

Show diffs side-by-side

added added

removed removed

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