diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-12-03 14:00:33 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-12-03 14:00:33 +0000 |
commit | f6cb6163b9a9ad60e358755427d8c443804fcb3c (patch) | |
tree | 8c1688e2c7ab91167542c80f3eb7d7ddf421cb8d /firmware/test/fat/test.sh | |
parent | c032e65034c23d3c48bc60bb76e120898b26efd3 (diff) | |
download | rockbox-f6cb6163b9a9ad60e358755427d8c443804fcb3c.tar.gz rockbox-f6cb6163b9a9ad60e358755427d8c443804fcb3c.zip |
Fat test code, for the archives.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2911 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/test/fat/test.sh')
-rw-r--r-- | firmware/test/fat/test.sh | 77 |
1 files changed, 46 insertions, 31 deletions
diff --git a/firmware/test/fat/test.sh b/firmware/test/fat/test.sh index 7d9435b85d..6a26e7ff59 100644 --- a/firmware/test/fat/test.sh +++ b/firmware/test/fat/test.sh | |||
@@ -15,8 +15,9 @@ check() { | |||
15 | } | 15 | } |
16 | 16 | ||
17 | try() { | 17 | try() { |
18 | echo COMMAND: fat $1 $2 $3 >> $RESULT | 18 | echo COMMAND: fat $1 "$2" "$3" |
19 | ./fat $1 $2 $3 2>> $RESULT | 19 | echo COMMAND: fat $1 "$2" "$3" >> $RESULT |
20 | ./fat $1 "$2" "$3" 2>> $RESULT | ||
20 | RETVAL=$? | 21 | RETVAL=$? |
21 | [ $RETVAL -ne 0 ] && fail | 22 | [ $RETVAL -ne 0 ] && fail |
22 | } | 23 | } |
@@ -26,6 +27,10 @@ buildimage() { | |||
26 | mount -o loop $IMAGE $MOUNT | 27 | mount -o loop $IMAGE $MOUNT |
27 | echo "Filling it with /etc files" | 28 | echo "Filling it with /etc files" |
28 | find /etc -type f -maxdepth 1 -exec cp {} $MOUNT \; | 29 | find /etc -type f -maxdepth 1 -exec cp {} $MOUNT \; |
30 | for i in `seq 1 120`; | ||
31 | do | ||
32 | echo apa > "$MOUNT/very $i long test filename so we can make sure they.work" | ||
33 | done | ||
29 | mkdir $MOUNT/dir | 34 | mkdir $MOUNT/dir |
30 | umount $MOUNT | 35 | umount $MOUNT |
31 | } | 36 | } |
@@ -34,53 +39,63 @@ runtests() { | |||
34 | rm $RESULT | 39 | rm $RESULT |
35 | 40 | ||
36 | echo ---Test: create a 10K file | 41 | echo ---Test: create a 10K file |
37 | try mkfile /apa.txt 10 | 42 | try mkfile "/really long filenames rock" 10 |
38 | try mkfile /dir/apa.txt 10 | 43 | check |
44 | try mkfile /dir/apa.monkey.me.now 10 | ||
39 | check | 45 | check |
40 | try chkfile /apa.txt 10 | 46 | try chkfile "/really long filenames rock" 10 |
41 | try chkfile /dir/apa.txt 8 | 47 | try chkfile /dir/apa.monkey.me.now 8 |
42 | 48 | ||
43 | echo ---Test: create a 1K file | 49 | echo ---Test: create a 1K file |
44 | try mkfile /bpa.txt 1 | 50 | try mkfile /bpa.rock 1 |
45 | check | 51 | check |
46 | try chkfile /bpa.txt 1 | 52 | try chkfile /bpa.rock 1 |
47 | 53 | ||
48 | echo ---Test: create a 40K file | 54 | echo ---Test: create a 40K file |
49 | try mkfile /cpa.txt 40 | 55 | try mkfile /cpa.rock 40 |
50 | check | 56 | check |
51 | try chkfile /cpa.txt 40 | 57 | try chkfile /cpa.rock 40 |
52 | 58 | ||
53 | echo ---Test: create a 400K file | 59 | echo ---Test: create a 400K file |
54 | try mkfile /dpa.txt 400 | 60 | try mkfile /dpa.rock 400 |
61 | check | ||
62 | try chkfile /dpa.rock 400 | ||
63 | |||
64 | echo ---Test: create a 1200K file | ||
65 | try mkfile /epa.rock 1200 | ||
55 | check | 66 | check |
56 | try chkfile /dpa.txt 400 | 67 | try chkfile /epa.rock 1200 |
57 | 68 | ||
58 | echo ---Test: truncate previous 40K file to 20K | 69 | echo ---Test: rewrite first 20K of a 40K file |
59 | try mkfile /cpa.txt 20 | 70 | try mkfile /cpa.rock 20 |
60 | check | 71 | check |
61 | try chkfile /cpa.txt 20 | 72 | try chkfile /cpa.rock 20 |
62 | 73 | ||
63 | echo ---Test: truncate previous 20K file to 0K | 74 | echo ---Test: rewrite first sector of 40K file |
64 | try mkfile /cpa.txt 0 | 75 | try mkfile /cpa.rock 0 |
65 | check | 76 | check |
66 | try chkfile /cpa.txt | 77 | try chkfile /cpa.rock |
67 | try chkfile /apa.txt | 78 | try chkfile /apa.rock |
68 | try chkfile /bpa.txt | 79 | try chkfile /bpa.rock |
69 | 80 | ||
70 | LOOP=50 | 81 | LOOP=50 |
71 | SIZE=70 | 82 | SIZE=700 |
83 | |||
84 | try del "/really long filenames rock" | ||
72 | 85 | ||
73 | echo ---Test: create $LOOP $SIZE k files | 86 | echo ---Test: create $LOOP $SIZE k files |
74 | for i in `seq 1 $LOOP`; | 87 | for i in `seq 1 $LOOP`; |
75 | do | 88 | do |
76 | echo ---Test: $i/$LOOP --- | 89 | echo ---Test: $i/$LOOP --- |
77 | try mkfile /rockbox.$i $SIZE | 90 | try mkfile "/rockbox rocks.$i" $SIZE |
91 | check | ||
92 | try chkfile "/rockbox rocks.$i" $SIZE | ||
78 | check | 93 | check |
79 | try chkfile /rockbox.$i $SIZE | 94 | try del "/rockbox rocks.$i" |
80 | check | 95 | check |
81 | try del /rockbox.$i | 96 | try mkfile "/rockbox rocks.$i" $SIZE |
82 | check | 97 | check |
83 | try mkfile /rockbox.$i $SIZE | 98 | try ren "/rockbox rocks.$i" "$i is a new long filename!" |
84 | check | 99 | check |
85 | done | 100 | done |
86 | 101 | ||
@@ -90,20 +105,20 @@ echo "Building test image (4 sector/cluster)" | |||
90 | buildimage 4 | 105 | buildimage 4 |
91 | runtests | 106 | runtests |
92 | 107 | ||
93 | echo "Building test image (128 sectors/cluster)" | ||
94 | buildimage 128 | ||
95 | runtests | ||
96 | |||
97 | echo "Building test image (32 sectors/cluster)" | 108 | echo "Building test image (32 sectors/cluster)" |
98 | buildimage 32 | 109 | buildimage 32 |
99 | runtests | 110 | runtests |
100 | 111 | ||
112 | echo "Building test image (1 sector/cluster)" | ||
113 | buildimage 1 | ||
114 | runtests | ||
115 | |||
101 | echo "Building test image (8 sectors/cluster)" | 116 | echo "Building test image (8 sectors/cluster)" |
102 | buildimage 8 | 117 | buildimage 8 |
103 | runtests | 118 | runtests |
104 | 119 | ||
105 | echo "Building test image (1 sector/cluster)" | 120 | echo "Building test image (128 sectors/cluster)" |
106 | buildimage 1 | 121 | buildimage 128 |
107 | runtests | 122 | runtests |
108 | 123 | ||
109 | echo "== Test completed sucessfully ==" | 124 | echo "== Test completed sucessfully ==" |