2 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
7 test_yaffs_chmod_ENOENT
8 test_yaffs_chmod_ENOTDIR
11 test_yaffs_fchmod_EBADF
12 test_yaffs_fchmod_EINVAL
15 test_yaffs_mount_ENODEV
16 test_yaffs_mount_ENAMETOOLONG
17 test_yaffs_mount_EBUSY //caused by trying to mount a new mount point with a mount point already mounted.
22 test_yaffs_access_ENIVAL
23 test_yaffs_access_ENOTDIR
24 test_yaffs_access_ENOENT
26 test_yaffs_close_EBADF
29 test_yaffs_fdatasync_EBADF
32 test_yaffs_fsync_EBADF
35 test_yaffs_ftruncate_EBADF
36 test_yaffs_ftruncate_ENIVAL
37 test_yaffs_ftruncate_big_file
40 test_yaffs_lseek_EBADF
41 test_yaffs_lseek_EINVAL
42 test_yaffs_lseek_big_file
45 test_yaffs_open_EEXIST
46 test_yaffs_open_EISDIR
47 test_yaffs_open_ENAMETOOLONG
48 test_yaffs_open_ENOENT
49 test_yaffs_open_ENOTDIR
50 test_yaffs_open_EINVAL
51 test_yaffs_open_EINVAL2 //the function open has two modes which can be set, so two tests are needed.
55 test_yaffs_read_EINVAL
58 test_yaffs_mkdir_EEXISTS
59 test_yaffs_mkdir_ENOTDIR
62 test_yaffs_stat_ENOENT
63 test_yaffs_stat_ENOTDIR
66 test_yaffs_symlink_ENOTDIR
67 test_yaffs_symlink_EEXISTS
68 test_yaffs_symlink_ENOENT //if there is a slash on the end of new path
71 test_yaffs_sync_ENOTDIR
74 test_yaffs_fstat_EBADF
77 test_yaffs_truncate_ENOTDIR
78 test_yaffs_truncate_EISDIR
79 test_yaffs_truncate_ENOENT
80 test_yaffs_truncate_ENIVAL
81 test_yaffs_truncate_big_file
84 test_yaffs_unlink_EISDIR
85 test_yaffs_unlink_ENAMETOOLONG
86 test_yaffs_unlink_ENOENT
87 test_yaffs_unlink_ENOTDIR
90 test_yaffs_unmount_ENODEV
91 test_yaffs_unmount_ENAMETOOLONG
92 test_yaffs_umount_EBUSY //cause by having a file handle open and then trying to unmount yaffs.
97 test_yaffs_write_EBADF
102 test_yaffs_fchmod_EACCES
104 test_yaffs_chmod_EACCES
105 test_yaffs_chmod_ELOOP
106 test_yaffs_chmod_ENAMETOOLONG
109 test_yaffs_lstat_EACCES
110 test_yaffs_lstat_ENOTDIR
111 test_yaffs_lstat_ENAMETOOLONG
112 test_yaffs_lstat_ENOENT
113 test_yaffs_lstat_ELOOP
116 test_yaffs_readlink_ENOENT
117 test_yaffs_readlink_ENOTDIR
118 test_yaffs_readlink_ELOOP
119 test_yaffs_readlink_ENAMETOOLONG
122 test_yaffs_mkdir_EACCES
123 test_yaffs_mkdir_ELOOP
124 test_yaffs_mkdir_ENAMETOOLONG
125 test_yaffs_mkdir_EROFS
128 test_yaffs_symlink_EACCES
129 test_yaffs_symlink_ELOOP
130 test_yaffs_symlink_ENAMETOOLONG
131 test_yaffs_symlink_EROFS
134 //the yaffs_mknod function does not exist in yaffsfs, so these tests will not be added.
136 test_yaffs_mknod_EACCES
137 test_yaffs_mknod_EEXIST
138 test_yaffs_mknod_EINVAL
139 test_yaffs_mknod_ELOOP
140 test_yaffs_mknod_ENAMETOOLONG
141 test_yaffs_mknod_ENOENT
142 test_yaffs_mknod_ENOTDIR
143 test_yaffs_mknod_EROFS
146 test_yaffs_mount2_EINVAL
147 test_yaffs_mount2_ENOTDIR
148 test_yaffs_mount2_ENOENT
149 test_yaffs_mount2_ENODEV
150 test_yaffs_mount2_ENAMETOOLONG
153 test_yaffs_unmount2_with handle open and forced mode on
154 test_yaffs_unmount2_with handle open and forced mode off. should give EBUSY.
156 test_yaffs_unmount2_ENOENT
157 test_yaffs_unmount2_ENOTDIR
158 test_yaffs_unmount2_ENODEV
159 test_yaffs_unmount2_EINVAL
162 test_yaffs_remount2_ENOENT
163 test_yaffs_remount2_ENOTDIR
164 test_yaffs_remount2_ENODEV
165 test_yaffs_remount2_EINVAL
168 test_yaffs_sync_ENOENT
171 test_yaffs_freespace_ENOENT
172 test_yaffs_freespace_ENOTDIR
174 test_yaffs_totalspace
175 test_yaffs_totalspace_ENOTDIR
176 test_yaffs_totalspace_ENOENT
178 test_yaffs_inodecount
179 test_yaffs_inodecount_ENOTDIR
180 test_yaffs_inodecount_ENOENT
191 test_yaffs_link_EACCES
192 test_yaffs_link_EEXISTS
193 test_yaffs_link_ELOOP
194 test_yaffs_link_EMLINK //should not happen on yaffs
195 test_yaffs_link_ENAMETOOLONG
196 test_yaffs_link_ENOENT
197 test_yaffs_link_ENOTDIR
198 test_yaffs_link_EPERM
199 test_yaffs_link_EROFS
202 test_yaffs_rmdir_EACCES
203 test_yaffs_rmdir_EBUSY
204 test_yaffs_rmdir_ENVAL
205 test_yaffs_rmdir_ENOENT
206 test_yaffs_rmdir_ENOTDIR
207 test_yaffs_rmdir_ENOTEMPTY
208 test_yaffs_rmdir_EROFS
211 test_yaffs_rename_EACCES
212 test_yaffs_rename_EINVAL
213 test_yaffs_rename_ELOOP
214 test_yaffs_rename_EMLINK
215 test_yaffs_rename_ENOENT
216 test_yaffs_rename_ENOTDIR
217 test_yaffs_rename_EEXISTS or EPERM
218 test_yaffs_rename_EROFS
226 test_yaffs_flush_EBADF
228 test_yaffs_fchmod_EACCES
229 test_yaffs_fchmod_ELOOP
232 test_yaffs_open_EACCES
233 test_yaffs_open_ENOSPC
234 test_yaffs_open_ELOOP
235 test yaffs_open_running_out_of_handles error
237 test_yaffs_close //This function has already been called by the time this test is reached.
239 test_yaffs_stat_ELOOP
240 test_yaffs_stat_EACCES
241 test_yaffs_stat_ENAMETOOLONG
245 test_yaffs_read_big_file
246 test what happens if you read off the end of the file?
249 test_yaffs_pread_EBADF
250 test_yaffs_pread_EINVAL
251 test_yaffs_pread_big_file
253 test_yaffs_write_big_file
254 test_yaffs_write_EINVAL
255 What happens when you run out of space?
257 test_yaffs_write_EBADF
259 test_yaffs_pwrite_big_file
260 test_yaffs_pwrite_EINVAL
262 test_yaffs_unlink_EACCES
263 test_yaffs_unlink_ELOOP
264 test_yaffs_unlink_ENOMEM
266 test_yaffs_stat_EACCES
267 test_yaffs_stat_ELOOP
269 test_yaffs_access_EACCESS
270 test_yaffs_access_ELOOP
271 test_yaffs_access_ENAMETOOLONG
272 test_yaffs_access_ENOENT_generated_with_a_dangling_symbloic_link
274 test_yaffs_ftruncate_EACCES
277 test_yaffs_truncate_EACCES
278 test_yaffs_truncate_ELOOP
279 test_yaffs_truncate_ENAMETOOLONG
280 Add a truncate function for truncating a file size to -1.
282 What happens if a handle is opened to a file and the file is then deleted?
283 Check to see if yaffs generates an error code for no reason.
284 What happens when a file is opened with no modes set?
285 Add a test where a directory is moved. /fluffy/box. move "fluffy" to "/fluffy/frog".
286 What happens when yaffs is unmounted twice?
288 What happens when open a handle, unmount yaffs and then try to use the handle?
290 What happens when a mount point is mounted using mount2 with read only mode set and then a file is chmoded?
293 First create the test .c and .h file.
294 The file name and test function name should be the same.
295 This name should follow one of these formats:
296 Test_yaffs_[function of yaffs which is been tested]
297 Test_yaffs_[function of yaffs which is been tested]_[error trying to be generated]
299 The .c file needs to contain two functions.
300 The first function needs to contain the code for the main test and will
301 return -1 on a failure and 0 or greater on a success.
302 The second function needs contain the code for cleaning up after the test.
303 Cleaning up may include closing some open handles, recreating a file, ect.
304 This second function needs to return -1 on a failure and 0 or greater on success.
306 The name of first function needs to be called the same as the file
307 name (without the .c or .h)
308 The second function's name needs be the same as the first function but
309 with "_clean" added on the end.
311 So if a test is been created for the yaffs function yaffs_foo() then
314 Contains int test_yaffs_foo(void); int test_yaffs_foo_clean(void);
316 Which includes "lib.h", "yaffsfs.h" header files.
318 Next write the test code in these files then add these files to the Makefile.
320 Add the name of the test files' object file (test_yaffs_foo.o ) to the
321 TESTFILES tag around line 50 of the Makefile.
323 Now add the test functions to the test_list[] array in quick_tests.h
324 The order of the tests matters. The idea is to test each yaffs_function
325 individualy and only using tested yaffs_components before using this new
327 This array consists of:
328 {[test function], [the clean function], [name of the tests which will be printed when the test fails]},
330 So add this line to the test_list[]: {test_yaffs_foo, test_yaffs_foo_clean, "test_yaffs_foo"},
332 Also include the test's .h file in the quick_test.h file: #include "test_yaffs_foo.h"
334 The test file should now make and run(you may need to make clean first).
338 PS: yaffs_foo() is a made up function for this README (in case you want
339 to find this function in yaffs).