diff options
Diffstat (limited to 'firmware/test')
-rw-r--r-- | firmware/test/fat/main.c | 22 | ||||
-rw-r--r-- | firmware/test/fat/test.sh | 23 |
2 files changed, 44 insertions, 1 deletions
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c index 9c1b983925..37ea2f49be 100644 --- a/firmware/test/fat/main.c +++ b/firmware/test/fat/main.c | |||
@@ -486,6 +486,21 @@ int dbg_trunc(char* name, int size) | |||
486 | return close(fd); | 486 | return close(fd); |
487 | } | 487 | } |
488 | 488 | ||
489 | int dbg_mkdir(char* name) | ||
490 | { | ||
491 | char text[BUFSIZE+1]; | ||
492 | int i; | ||
493 | int fd; | ||
494 | int x=0; | ||
495 | bool stop = false; | ||
496 | |||
497 | fd = mkdir(name); | ||
498 | if (fd<0) { | ||
499 | DEBUGF("Failed creating directory\n"); | ||
500 | return -1; | ||
501 | } | ||
502 | } | ||
503 | |||
489 | int dbg_cmd(int argc, char *argv[]) | 504 | int dbg_cmd(int argc, char *argv[]) |
490 | { | 505 | { |
491 | char* cmd = NULL; | 506 | char* cmd = NULL; |
@@ -577,6 +592,13 @@ int dbg_cmd(int argc, char *argv[]) | |||
577 | } | 592 | } |
578 | } | 593 | } |
579 | 594 | ||
595 | if (!strcasecmp(cmd, "mkdir")) | ||
596 | { | ||
597 | if (arg1) { | ||
598 | return dbg_mkdir(arg1); | ||
599 | } | ||
600 | } | ||
601 | |||
580 | if (!strcasecmp(cmd, "del")) | 602 | if (!strcasecmp(cmd, "del")) |
581 | { | 603 | { |
582 | if (arg1) | 604 | if (arg1) |
diff --git a/firmware/test/fat/test.sh b/firmware/test/fat/test.sh index 44ff6bb849..9b1036b69c 100644 --- a/firmware/test/fat/test.sh +++ b/firmware/test/fat/test.sh | |||
@@ -38,9 +38,20 @@ buildimage() { | |||
38 | runtests() { | 38 | runtests() { |
39 | rm $RESULT | 39 | rm $RESULT |
40 | 40 | ||
41 | echo ---Test: create a long name directory in the root | ||
42 | try mkdir "/very long subdir name" | ||
43 | check | ||
44 | try mkdir "/very long subdir name/apa.monkey.me.now" | ||
45 | check | ||
46 | |||
47 | echo ---Test: create a directory called "dir" | ||
48 | try mkdir "/dir" | ||
49 | check | ||
50 | |||
41 | echo ---Test: create a 10K file | 51 | echo ---Test: create a 10K file |
42 | try mkfile "/really long filenames rock" 10 | 52 | try mkfile "/really long filenames rock" 10 |
43 | check | 53 | check |
54 | |||
44 | try mkfile /dir/apa.monkey.me.now 10 | 55 | try mkfile /dir/apa.monkey.me.now 10 |
45 | check | 56 | check |
46 | try chkfile "/really long filenames rock" 10 | 57 | try chkfile "/really long filenames rock" 10 |
@@ -100,24 +111,34 @@ runtests() { | |||
100 | 111 | ||
101 | } | 112 | } |
102 | 113 | ||
114 | echo "--------------------------------------" | ||
103 | echo "Building test image (4 sector/cluster)" | 115 | echo "Building test image (4 sector/cluster)" |
116 | echo "--------------------------------------" | ||
104 | buildimage 4 | 117 | buildimage 4 |
105 | runtests | 118 | runtests |
106 | 119 | ||
120 | echo "---------------------------------------" | ||
107 | echo "Building test image (32 sectors/cluster)" | 121 | echo "Building test image (32 sectors/cluster)" |
122 | echo "---------------------------------------" | ||
108 | buildimage 32 | 123 | buildimage 32 |
109 | runtests | 124 | runtests |
110 | 125 | ||
126 | echo "--------------------------------------" | ||
111 | echo "Building test image (1 sector/cluster)" | 127 | echo "Building test image (1 sector/cluster)" |
128 | echo "--------------------------------------" | ||
112 | buildimage 1 | 129 | buildimage 1 |
113 | runtests | 130 | runtests |
114 | 131 | ||
132 | echo "--------------------------------------" | ||
115 | echo "Building test image (8 sectors/cluster)" | 133 | echo "Building test image (8 sectors/cluster)" |
134 | echo "--------------------------------------" | ||
116 | buildimage 8 | 135 | buildimage 8 |
117 | runtests | 136 | runtests |
118 | 137 | ||
138 | echo "----------------------------------------" | ||
119 | echo "Building test image (128 sectors/cluster)" | 139 | echo "Building test image (128 sectors/cluster)" |
140 | echo "----------------------------------------" | ||
120 | buildimage 128 | 141 | buildimage 128 |
121 | runtests | 142 | runtests |
122 | 143 | ||
123 | echo "== Test completed sucessfully ==" | 144 | echo "== Test completed successfully ==" |