9 echo "!! Test failed $RETVAL. Look in $RESULT for test logs."
15 /sbin
/dosfsck
-r $IMAGE |
tee -a $RESULT
16 [ $RETVAL -ne 0 ] && fail
20 echo COMMAND
: fat
$1 "$2" "$3"
21 echo COMMAND
: fat
$1 "$2" "$3" >> $RESULT
22 .
/fat
$1 "$2" "$3" 2>> $RESULT
24 [ $RETVAL -ne 0 ] && fail
28 /sbin
/mkdosfs
-F 16 -s $1 $IMAGE > /dev
/null
;
29 mount
-o loop
,fat
=16 $IMAGE $MOUNT;
30 echo "Filling it with /etc files";
32 find /etc
-type f
-maxdepth 1 -exec cp {} $DIR \
;
35 echo apa
> "$DIR/very $i long test filename so we can make sure they.work";
43 echo ---Test: create a long name directory
in the root
44 try mkdir
"/very long subdir name"
46 try mkdir
"/very long subdir name/apa.monkey.me.now"
49 echo ---Test: create a directory called
"dir"
53 echo ---Test: create a
10K
file
54 try mkfile
"/really long filenames rock" 10
57 try mkfile
/dir
/apa.monkey.me.now
10
59 try chkfile
"/really long filenames rock" 10
60 try chkfile
/dir
/apa.monkey.me.now
8
62 echo ---Test: create a
1K
file
63 try mkfile
/bpa.rock
1
65 try chkfile
/bpa.rock
1
67 echo ---Test: create a
40K
file
68 try mkfile
/cpa.rock
40
70 try chkfile
/cpa.rock
40
72 echo ---Test: create a
400K
file
73 try mkfile
/dpa.rock
400
75 try chkfile
/dpa.rock
400
77 echo ---Test: create a
1200K
file
78 try mkfile
/epa.rock
1200
80 try chkfile
/epa.rock
1200
82 echo ---Test: rewrite first
20K of a
40K
file
83 try mkfile
/cpa.rock
20
85 try chkfile
/cpa.rock
20
87 echo ---Test: rewrite first sector of
40K
file
88 try mkfile
/cpa.rock
0
96 try del
"/really long filenames rock"
98 echo ---Test: create
$LOOP $SIZE k files
99 for i
in `seq 1 $LOOP`;
101 echo ---Test: $i/$LOOP ---
102 try mkfile
"/q/rockbox rocks.$i" $SIZE
104 try chkfile
"/q/rockbox rocks.$i" $SIZE
106 try del
"/q/rockbox rocks.$i"
108 try mkfile
"/q/rockbox rocks.$i" $SIZE
110 try ren
"/q/rockbox rocks.$i" "/q/$i is a new long filename!"
116 echo "--------------------------------------"
117 echo "Building test image (4 sector/cluster)"
118 echo "--------------------------------------"
122 echo "--------------------------------------"
123 echo "Building test image (8 sectors/cluster)"
124 echo "--------------------------------------"
128 echo "----------------------------------------"
129 echo "Building test image (64 sectors/cluster)"
130 echo "----------------------------------------"
134 echo "== Test completed successfully =="