From ebc54da9e29be1de79d77c72c0d8eb91833c641b Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Thu, 29 Jul 2021 16:38:02 +1200 Subject: [PATCH 01/16] Further integration of 64-bit time changes Signed-off-by: Charles Manning --- direct/yaffs_attribs.c | 21 +++++++---- direct/ydirectenv.h | 2 +- direct/yportenv.h | 1 + rtems/rtems_yaffs.c | 8 ++-- rtems/rtems_yaffs_os_glue.c | 2 +- yaffs_attribs.c | 17 +++++---- yaffs_endian.h | 14 ++++--- yaffs_guts.c | 74 +++++++++++++++++++++++++++++++++++++ yaffs_guts.h | 18 +++++++++ yportenv_multi.h | 2 + yportenv_single.h | 2 + 11 files changed, 134 insertions(+), 27 deletions(-) diff --git a/direct/yaffs_attribs.c b/direct/yaffs_attribs.c index 5486bdd..e798a88 100644 --- a/direct/yaffs_attribs.c +++ b/direct/yaffs_attribs.c @@ -15,6 +15,7 @@ void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) { + #ifdef CONFIG_YAFFS_WINCE obj->win_atime[0] = oh->win_atime[0]; obj->win_ctime[0] = oh->win_ctime[0]; @@ -25,9 +26,11 @@ void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) #else obj->yst_uid = oh->yst_uid; obj->yst_gid = oh->yst_gid; - obj->yst_atime = oh->yst_atime; - obj->yst_mtime = oh->yst_mtime; - obj->yst_ctime = oh->yst_ctime; + + obj->yst_ctime = yaffs_oh_ctime_fetch(oh); + obj->yst_mtime = yaffs_oh_mtime_fetch(oh); + obj->yst_atime = yaffs_oh_atime_fetch(oh); + obj->yst_rdev = oh->yst_rdev; #endif } @@ -45,9 +48,11 @@ void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj) #else oh->yst_uid = obj->yst_uid; oh->yst_gid = obj->yst_gid; - oh->yst_atime = obj->yst_atime; - oh->yst_mtime = obj->yst_mtime; - oh->yst_ctime = obj->yst_ctime; + + yaffs_oh_ctime_load(obj, oh); + yaffs_oh_mtime_load(obj, oh); + yaffs_oh_atime_load(obj, oh); + oh->yst_rdev = obj->yst_rdev; #endif } @@ -81,8 +86,8 @@ void yaffs_load_current_time(struct yaffs_obj *obj, int do_a, int do_c) obj->yst_mtime = Y_CURRENT_TIME; if (do_a) - obj->yst_atime = obj->yst_atime; + obj->yst_atime = obj->yst_mtime; if (do_c) - obj->yst_ctime = obj->yst_atime; + obj->yst_ctime = obj->yst_mtime; #endif } diff --git a/direct/ydirectenv.h b/direct/ydirectenv.h index 08fc04d..ae2e23c 100644 --- a/direct/ydirectenv.h +++ b/direct/ydirectenv.h @@ -29,7 +29,7 @@ void yaffs_bug_fn(const char *file_name, int line_no); #define BUG() do { yaffs_bug_fn(__FILE__, __LINE__); } while (0) -#ifdef YAFFS_USE_32_BIT_TIME_T +#ifdef CONFIG_YAFFS_USE_32_BIT_TIME_T #define YTIME_T u32 #else #define YTIME_T u64 diff --git a/direct/yportenv.h b/direct/yportenv.h index ee27f73..5a79f93 100644 --- a/direct/yportenv.h +++ b/direct/yportenv.h @@ -30,6 +30,7 @@ #define CONFIG_YAFFS_PROVIDE_DEFS 1 #define CONFIG_YAFFSFS_PROVIDE_VALUES 1 #define CONFIG_YAFFS_DEFINES_TYPES 1 +#define CONFIG_YAFFS_USE_32_BIT_TIME_T 1 #define NO_Y_INLINE 1 #define loff_t off_t diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c index 4611320..bb6edf1 100644 --- a/rtems/rtems_yaffs.c +++ b/rtems/rtems_yaffs.c @@ -281,9 +281,9 @@ static int ryfs_utime( obj = yaffs_get_equivalent_obj(obj); if (obj != NULL) { obj->dirty = 1; - obj->yst_atime = (u32) actime; - obj->yst_mtime = (u32) modtime; - obj->yst_ctime = (u32) time(NULL); + obj->yst_atime = actime; + obj->yst_mtime = modtime; + obj->yst_ctime = time(NULL); } else { errno = EIO; rv = -1; @@ -680,7 +680,7 @@ static int ryfs_symlink(const rtems_filesystem_location_info_t *parent_loc, mode = S_IFLNK | ((S_IRWXU | S_IRWXG | S_IRWXO) & ~rtems_filesystem_umask); - created_link = yaffs_create_symlink(parent_dir, name, mode, + created_link = yaffs_create_symlink(parent_dir, name, mode, geteuid(), getegid(), target); if (created_link != NULL) { diff --git a/rtems/rtems_yaffs_os_glue.c b/rtems/rtems_yaffs_os_glue.c index 467d8b1..8999dff 100644 --- a/rtems/rtems_yaffs_os_glue.c +++ b/rtems/rtems_yaffs_os_glue.c @@ -39,7 +39,7 @@ void yaffsfs_free(void *ptr) free(ptr); } -u32 yaffsfs_CurrentTime(void) +YTIME_T yaffsfs_CurrentTime(void) { return time(NULL); } diff --git a/yaffs_attribs.c b/yaffs_attribs.c index a9ced27..c441185 100644 --- a/yaffs_attribs.c +++ b/yaffs_attribs.c @@ -29,9 +29,11 @@ void yaffs_load_attribs(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) { obj->yst_uid = oh->yst_uid; obj->yst_gid = oh->yst_gid; - obj->yst_atime = oh->yst_atime; - obj->yst_mtime = oh->yst_mtime; - obj->yst_ctime = oh->yst_ctime; + + obj->yst_ctime = yaffs_oh_ctime_fetch(oh); + obj->yst_mtime = yaffs_oh_mtime_fetch(oh); + obj->yst_atime = yaffs_oh_atime_fetch(oh); + obj->yst_rdev = oh->yst_rdev; } @@ -39,9 +41,11 @@ void yaffs_load_attribs_oh(struct yaffs_obj_hdr *oh, struct yaffs_obj *obj) { oh->yst_uid = obj->yst_uid; oh->yst_gid = obj->yst_gid; - oh->yst_atime = obj->yst_atime; - oh->yst_mtime = obj->yst_mtime; - oh->yst_ctime = obj->yst_ctime; + + yaffs_oh_ctime_load(obj, oh); + yaffs_oh_mtime_load(obj, oh); + yaffs_oh_atime_load(obj, oh); + oh->yst_rdev = obj->yst_rdev; } @@ -105,7 +109,6 @@ int yaffs_set_attribs(struct yaffs_obj *obj, struct iattr *attr) yaffs_update_oh(obj, NULL, 1, 0, 0, NULL); return YAFFS_OK; - } int yaffs_get_attribs(struct yaffs_obj *obj, struct iattr *attr) diff --git a/yaffs_endian.h b/yaffs_endian.h index 0f1ef04..09bcb29 100644 --- a/yaffs_endian.h +++ b/yaffs_endian.h @@ -37,12 +37,14 @@ static inline u64 swap_u64(u64 val) ((val << 56) & 0xff00000000000000); } -//YTIME_T can be a 32 or 64 bit number. -#if YAFFS_USE_32_BIT_TIME_T - #define swap_ytime_t( val ) swap_u32(val) -#else - #define swap_ytime_t( val ) swap_u64(val) -#endif +static inline YTIME_T swap_ytime_t(YTIME_T val) +{ + + if (sizeof(YTIME_T) == sizeof(u64)) + return swap_u64(val); + else + return swap_u32(val); +} //swap a signed 32 bit integer. #define swap_s32(val) \ diff --git a/yaffs_guts.c b/yaffs_guts.c index c05aee0..c09c88f 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -4887,6 +4887,80 @@ int yaffs_get_n_free_chunks(struct yaffs_dev *dev) return n_free; } +/* + * Marshalling functions to get the appropriate time values saved + * and restored to/from obj headers. + * + * Note that the WinCE time fields are used to store the 32-bit values. + */ + +static void yaffs_oh_time_load(u32 *yst_time, u32 *win_time, YTIME_T timeval) +{ + u32 upper; + u32 lower; + + lower = timeval & 0xffffffff; + if (sizeof(YTIME_T) > sizeof(u32)) + upper = (timeval >> 32) & 0xffffffff; + else + upper = 0; + + *yst_time = lower; + win_time[0] = lower; + win_time[1] = upper; +} + +static YTIME_T yaffs_oh_time_fetch(const u32 *yst_time, const u32 *win_time) +{ + u32 upper; + u32 lower; + + if (win_time[1] == 0xffffffff) { + upper = 0; + lower = *yst_time; + } else { + upper = win_time[1]; + lower = win_time[0]; + } + if (sizeof(YTIME_T) > sizeof(u32)) { + u64 ret; + ret = (((u64)upper) << 32) | lower; + return (YTIME_T) ret; + + } else + return (YTIME_T) lower; +} + +YTIME_T yaffs_oh_ctime_fetch(struct yaffs_obj_hdr *oh) +{ + return yaffs_oh_time_fetch(&oh->yst_ctime, oh->win_ctime); +} + +YTIME_T yaffs_oh_mtime_fetch(struct yaffs_obj_hdr *oh) +{ + return yaffs_oh_time_fetch(&oh->yst_mtime, oh->win_mtime); +} + +YTIME_T yaffs_oh_atime_fetch(struct yaffs_obj_hdr *oh) +{ + return yaffs_oh_time_fetch(&oh->yst_atime, oh->win_atime); +} + +void yaffs_oh_ctime_load(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) +{ + yaffs_oh_time_load(&oh->yst_ctime, oh->win_ctime, obj->yst_ctime); +} + +void yaffs_oh_mtime_load(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) +{ + yaffs_oh_time_load(&oh->yst_mtime, oh->win_mtime, obj->yst_mtime); +} + +void yaffs_oh_atime_load(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh) +{ + yaffs_oh_time_load(&oh->yst_atime, oh->win_atime, obj->yst_atime); +} + /* * Marshalling functions to get loff_t file sizes into and out of diff --git a/yaffs_guts.h b/yaffs_guts.h index 22381f9..74ded0b 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -354,6 +354,12 @@ struct yaffs_obj_hdr { u32 yst_rdev; /* stuff for block and char devices (major/min) */ + /* + * WinCE times are no longer just used to store WinCE times. + * They are also used to store 64-bit times. + * We actually store and read the times in both places and use + * the best we can. + */ u32 win_ctime[2]; u32 win_atime[2]; u32 win_mtime[2]; @@ -1063,6 +1069,18 @@ void yaffs_count_blocks_by_state(struct yaffs_dev *dev, int bs[10]); int yaffs_find_chunk_in_file(struct yaffs_obj *in, int inode_chunk, struct yaffs_ext_tags *tags); +/* + *Time marshalling functions + */ + +YTIME_T yaffs_oh_ctime_fetch(struct yaffs_obj_hdr *oh); +YTIME_T yaffs_oh_mtime_fetch(struct yaffs_obj_hdr *oh); +YTIME_T yaffs_oh_atime_fetch(struct yaffs_obj_hdr *oh); + +void yaffs_oh_ctime_load(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh); +void yaffs_oh_mtime_load(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh); +void yaffs_oh_atime_load(struct yaffs_obj *obj, struct yaffs_obj_hdr *oh); + /* * Define LOFF_T_32_BIT if a 32-bit LOFF_T is being used. * Not serious if you get this wrong - you might just get some warnings. diff --git a/yportenv_multi.h b/yportenv_multi.h index 68c239c..fa5601b 100644 --- a/yportenv_multi.h +++ b/yportenv_multi.h @@ -53,6 +53,8 @@ #define YUCHAR unsigned char #define _Y(x) x +#define YTIME_T u64 + #define YAFFS_LOSTNFOUND_NAME "lost+found" #define YAFFS_LOSTNFOUND_PREFIX "obj" diff --git a/yportenv_single.h b/yportenv_single.h index 436feae..b915433 100644 --- a/yportenv_single.h +++ b/yportenv_single.h @@ -34,6 +34,8 @@ #define YCHAR char #define YUCHAR unsigned char #define _Y(x) x +#define YTIME_T u64 + #define YAFFS_LOSTNFOUND_NAME "lost+found" #define YAFFS_LOSTNFOUND_PREFIX "obj" -- 2.30.2 From 3619653fc6a2759bd90e725c760fd1a57030e396 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Thu, 5 Aug 2021 15:27:00 +1200 Subject: [PATCH 02/16] Fixed an error with the 32 bit time. The compiler was throwing an "right shift count >= width of type" error when yaffs was compiled using 32 bit time. This was fixed by replacing an if statement with a #define. Signed-off-by: Timothy Manning --- yaffs_guts.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yaffs_guts.c b/yaffs_guts.c index 41ceb5b..b83fa63 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -4902,10 +4902,15 @@ static void yaffs_oh_time_load(u32 *yst_time, u32 *win_time, YTIME_T timeval) u32 lower; lower = timeval & 0xffffffff; - if (sizeof(YTIME_T) > sizeof(u32)) - upper = (timeval >> 32) & 0xffffffff; - else - upper = 0; + /* we have to use #defines here insted of an if statement + otherwise the compiler throws an error saying that + right shift count >= width of type when we are using 32 bit time. + */ + #ifdef CONFIG_YAFFS_USE_32_BIT_TIME_T + upper = 0; + #else + upper = (timeval >> 32) & 0xffffffff; + #endif *yst_time = lower; win_time[0] = lower; -- 2.30.2 From 8f551673ba9c0bde32ace31414d7470b4bcadf1b Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 6 Aug 2021 14:07:04 +1200 Subject: [PATCH 03/16] Added gitignores to the repository. Each of the yaffs direct tests has its own gitignore file. This is so that if the test is moved or deleted then the gitignore file is dealt with appropriately. However all the symlinks are handled by the root .gitinore file. If a test is moved or deleated, run the script in the root gitignore file to update the list of all the symlinks in the repository. Signed-off-by: Timothy Manning --- .gitignore | 619 ++++++++++++++++++ .../stress_tests/handle_tests/.gitignore | 1 + .../stress_tests/stress_tester/.gitignore | 1 + .../stress_tests/threading/.gitignore | 1 + .../64_and_32_bit_time/32_bit/.gitignore | 1 + .../64_and_32_bit_time/64_bit/.gitignore | 1 + .../is_yaffs_working_tests/.gitignore | 1 + .../unit_tests/quick_tests/.gitignore | 1 + 8 files changed, 626 insertions(+) create mode 100644 direct/test-framework/stress_tests/handle_tests/.gitignore create mode 100644 direct/test-framework/stress_tests/stress_tester/.gitignore create mode 100644 direct/test-framework/stress_tests/threading/.gitignore create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/.gitignore create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/.gitignore create mode 100644 direct/test-framework/unit_tests/is_yaffs_working_tests/.gitignore create mode 100644 direct/test-framework/unit_tests/quick_tests/.gitignore diff --git a/.gitignore b/.gitignore index d4f60ef..5fa34e9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,622 @@ DEADJOE # cscope files # cscope.* + +#emfile +emfile-* + +# here are the files that are copied into the direct folder. They are modified +# when they are copied. We don't want to track them. + +direct/yaffs_allocator.c +direct/yaffs_allocator.h +direct/yaffs_attribs.h +direct/yaffs_bitmap.c +direct/yaffs_bitmap.h +direct/yaffs_cache.c +direct/yaffs_cache.h +direct/yaffs_checkptrw.c +direct/yaffs_checkptrw.h +direct/yaffs_ecc.c +direct/yaffs_ecc.h +direct/yaffs_endian.c +direct/yaffs_endian.h +direct/yaffs_getblockinfo.h +direct/yaffs_guts.c +direct/yaffs_guts.h +direct/yaffs_nameval.c +direct/yaffs_nameval.h +direct/yaffs_nand.c +direct/yaffs_nand.h +direct/yaffs_packedtags1.c +direct/yaffs_packedtags1.h +direct/yaffs_packedtags2.c +direct/yaffs_packedtags2.h +direct/yaffs_summary.c +direct/yaffs_summary.h +direct/yaffs_tagscompat.c +direct/yaffs_tagscompat.h +direct/yaffs_tagsmarshall.c +direct/yaffs_tagsmarshall.h +direct/yaffs_trace.h +direct/yaffs_verify.c +direct/yaffs_verify.h +direct/yaffs_yaffs1.c +direct/yaffs_yaffs1.h +direct/yaffs_yaffs2.c +direct/yaffs_yaffs2.h + + + +# here are all the symlinks that yaffs direct uses +# we don't want to track them. +# this list was created using the command run in the root directory. +# $ find * -type l -not -exec grep -q "^{}$" .gitignore \; -print >> .gitignore + +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nanddrv.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_packedtags2.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nandsim.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_cache.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_hweight.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_ramem2k.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_flexible_file_sim.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_cache.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_m18_drv.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nandstore_file.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nand.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_bitmap.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_yaffs2.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_fileem2k.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_checkptrw.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_error.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_flashif.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_getblockinfo.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_list.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_ecc.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffsfs.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nand_drv.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/ydirectenv.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_allocator.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nanddrv.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_verify.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffsfs.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nandsim.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_ramdisk.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nand_chip.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_summary.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nameval.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_summary.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_checkptrw.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nand_store.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_endian.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_m18_drv.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_tagsmarshall.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_yaffs2.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nandsim_file.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_allocator.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yportenv.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_packedtags2.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_osglue.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_flashif2.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_tagsmarshall.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_endian.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nand_drv.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nandsim_file.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_fileem2k.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nor_drv.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_verify.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nandsim_file.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_packedtags1.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nor_drv.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/ynorsim.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nand.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_attribs.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_fileem.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_yaffs1.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_guts.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffscfg2k.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffscfg.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_flexible_file_sim.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_guts.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/ynorsim.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_ramdisk.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_hweight.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_packedtags1.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_trace.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_tagscompat.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_attribs.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_ecc.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_yaffs1.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_bitmap.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nameval.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nandemul2k.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_tagscompat.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_nandsim_file.h +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/yaffs_osglue.c +direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/nandstore_file.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nanddrv.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_packedtags2.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nandsim.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_cache.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_hweight.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_ramem2k.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_flexible_file_sim.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_cache.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_m18_drv.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nandstore_file.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nand.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_bitmap.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_yaffs2.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_fileem2k.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_checkptrw.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_error.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_flashif.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_getblockinfo.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_list.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_ecc.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffsfs.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nand_drv.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/ydirectenv.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_allocator.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nanddrv.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_verify.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffsfs.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nandsim.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_ramdisk.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nand_chip.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_summary.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nameval.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_summary.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_checkptrw.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nand_store.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_endian.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_m18_drv.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_tagsmarshall.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_yaffs2.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nandsim_file.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_allocator.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yportenv.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_packedtags2.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_osglue.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_flashif2.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_tagsmarshall.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_endian.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nand_drv.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nandsim_file.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_fileem2k.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nor_drv.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_verify.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nandsim_file.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_packedtags1.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nor_drv.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/ynorsim.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nand.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_attribs.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_fileem.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_yaffs1.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_guts.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffscfg2k.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffscfg.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_flexible_file_sim.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_guts.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/ynorsim.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_ramdisk.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_hweight.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_packedtags1.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_trace.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_tagscompat.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_attribs.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_ecc.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_yaffs1.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_bitmap.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nameval.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nandemul2k.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_tagscompat.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_nandsim_file.h +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/yaffs_osglue.c +direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/nandstore_file.c +direct/test-framework/unit_tests/is_yaffs_working_tests/nanddrv.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_packedtags2.h +direct/test-framework/unit_tests/is_yaffs_working_tests/nandsim.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_cache.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_hweight.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_ramem2k.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_flexible_file_sim.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_cache.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_m18_drv.c +direct/test-framework/unit_tests/is_yaffs_working_tests/nandstore_file.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nand.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_bitmap.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_yaffs2.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_fileem2k.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_checkptrw.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_error.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_flashif.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_getblockinfo.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_list.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_ecc.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffsfs.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nand_drv.c +direct/test-framework/unit_tests/is_yaffs_working_tests/ydirectenv.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_allocator.h +direct/test-framework/unit_tests/is_yaffs_working_tests/nanddrv.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_verify.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffsfs.c +direct/test-framework/unit_tests/is_yaffs_working_tests/nandsim.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_ramdisk.h +direct/test-framework/unit_tests/is_yaffs_working_tests/nand_chip.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_summary.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nameval.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_summary.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_checkptrw.c +direct/test-framework/unit_tests/is_yaffs_working_tests/nand_store.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_endian.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_m18_drv.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_tagsmarshall.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_yaffs2.h +direct/test-framework/unit_tests/is_yaffs_working_tests/nandsim_file.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_allocator.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yportenv.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_packedtags2.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_osglue.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_flashif2.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_tagsmarshall.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_endian.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nand_drv.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nandsim_file.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_fileem2k.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nor_drv.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_verify.c +direct/test-framework/unit_tests/is_yaffs_working_tests/nandsim_file.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_packedtags1.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nor_drv.c +direct/test-framework/unit_tests/is_yaffs_working_tests/ynorsim.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nand.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_attribs.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_fileem.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_yaffs1.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_guts.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffscfg2k.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffscfg.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_flexible_file_sim.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_guts.c +direct/test-framework/unit_tests/is_yaffs_working_tests/ynorsim.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_ramdisk.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_hweight.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_packedtags1.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_trace.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_tagscompat.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_attribs.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_ecc.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_yaffs1.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_bitmap.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nameval.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nandemul2k.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_tagscompat.c +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_nandsim_file.h +direct/test-framework/unit_tests/is_yaffs_working_tests/yaffs_osglue.c +direct/test-framework/unit_tests/is_yaffs_working_tests/nandstore_file.c +direct/test-framework/unit_tests/quick_tests/nanddrv.c +direct/test-framework/unit_tests/quick_tests/yaffs_packedtags2.h +direct/test-framework/unit_tests/quick_tests/nandsim.h +direct/test-framework/unit_tests/quick_tests/yaffs_cache.h +direct/test-framework/unit_tests/quick_tests/yaffs_hweight.c +direct/test-framework/unit_tests/quick_tests/yaffs_ramem2k.c +direct/test-framework/unit_tests/quick_tests/yaffs_flexible_file_sim.c +direct/test-framework/unit_tests/quick_tests/yaffs_cache.c +direct/test-framework/unit_tests/quick_tests/yaffs_m18_drv.c +direct/test-framework/unit_tests/quick_tests/nandstore_file.h +direct/test-framework/unit_tests/quick_tests/yaffs_nand.c +direct/test-framework/unit_tests/quick_tests/yaffs_bitmap.h +direct/test-framework/unit_tests/quick_tests/yaffs_yaffs2.c +direct/test-framework/unit_tests/quick_tests/yaffs_fileem2k.h +direct/test-framework/unit_tests/quick_tests/yaffs_checkptrw.h +direct/test-framework/unit_tests/quick_tests/yaffs_error.c +direct/test-framework/unit_tests/quick_tests/yaffs_flashif.h +direct/test-framework/unit_tests/quick_tests/yaffs_getblockinfo.h +direct/test-framework/unit_tests/quick_tests/yaffs_list.h +direct/test-framework/unit_tests/quick_tests/yaffs_ecc.c +direct/test-framework/unit_tests/quick_tests/yaffsfs.h +direct/test-framework/unit_tests/quick_tests/yaffs_nand_drv.c +direct/test-framework/unit_tests/quick_tests/ydirectenv.h +direct/test-framework/unit_tests/quick_tests/yaffs_allocator.h +direct/test-framework/unit_tests/quick_tests/nanddrv.h +direct/test-framework/unit_tests/quick_tests/yaffs_verify.h +direct/test-framework/unit_tests/quick_tests/yaffsfs.c +direct/test-framework/unit_tests/quick_tests/nandsim.c +direct/test-framework/unit_tests/quick_tests/yaffs_ramdisk.h +direct/test-framework/unit_tests/quick_tests/nand_chip.h +direct/test-framework/unit_tests/quick_tests/yaffs_summary.h +direct/test-framework/unit_tests/quick_tests/yaffs_nameval.c +direct/test-framework/unit_tests/quick_tests/yaffs_summary.c +direct/test-framework/unit_tests/quick_tests/yaffs_checkptrw.c +direct/test-framework/unit_tests/quick_tests/nand_store.h +direct/test-framework/unit_tests/quick_tests/yaffs_endian.c +direct/test-framework/unit_tests/quick_tests/yaffs_m18_drv.h +direct/test-framework/unit_tests/quick_tests/yaffs_tagsmarshall.c +direct/test-framework/unit_tests/quick_tests/yaffs_yaffs2.h +direct/test-framework/unit_tests/quick_tests/nandsim_file.c +direct/test-framework/unit_tests/quick_tests/yaffs_allocator.c +direct/test-framework/unit_tests/quick_tests/yportenv.h +direct/test-framework/unit_tests/quick_tests/yaffs_packedtags2.c +direct/test-framework/unit_tests/quick_tests/yaffs_osglue.h +direct/test-framework/unit_tests/quick_tests/yaffs_flashif2.h +direct/test-framework/unit_tests/quick_tests/yaffs_tagsmarshall.h +direct/test-framework/unit_tests/quick_tests/yaffs_endian.h +direct/test-framework/unit_tests/quick_tests/yaffs_nand_drv.h +direct/test-framework/unit_tests/quick_tests/yaffs_nandsim_file.c +direct/test-framework/unit_tests/quick_tests/yaffs_fileem2k.c +direct/test-framework/unit_tests/quick_tests/yaffs_nor_drv.h +direct/test-framework/unit_tests/quick_tests/yaffs_verify.c +direct/test-framework/unit_tests/quick_tests/nandsim_file.h +direct/test-framework/unit_tests/quick_tests/yaffs_packedtags1.c +direct/test-framework/unit_tests/quick_tests/yaffs_nor_drv.c +direct/test-framework/unit_tests/quick_tests/ynorsim.c +direct/test-framework/unit_tests/quick_tests/yaffs_nand.h +direct/test-framework/unit_tests/quick_tests/yaffs_attribs.h +direct/test-framework/unit_tests/quick_tests/yaffs_fileem.c +direct/test-framework/unit_tests/quick_tests/yaffs_yaffs1.c +direct/test-framework/unit_tests/quick_tests/yaffs_guts.h +direct/test-framework/unit_tests/quick_tests/yaffscfg2k.c +direct/test-framework/unit_tests/quick_tests/yaffscfg.h +direct/test-framework/unit_tests/quick_tests/yaffs_flexible_file_sim.h +direct/test-framework/unit_tests/quick_tests/yaffs_guts.c +direct/test-framework/unit_tests/quick_tests/ynorsim.h +direct/test-framework/unit_tests/quick_tests/yaffs_ramdisk.c +direct/test-framework/unit_tests/quick_tests/yaffs_hweight.h +direct/test-framework/unit_tests/quick_tests/yaffs_packedtags1.h +direct/test-framework/unit_tests/quick_tests/yaffs_trace.h +direct/test-framework/unit_tests/quick_tests/yaffs_tagscompat.h +direct/test-framework/unit_tests/quick_tests/yaffs_attribs.c +direct/test-framework/unit_tests/quick_tests/yaffs_ecc.h +direct/test-framework/unit_tests/quick_tests/yaffs_yaffs1.h +direct/test-framework/unit_tests/quick_tests/yaffs_bitmap.c +direct/test-framework/unit_tests/quick_tests/yaffs_nameval.h +direct/test-framework/unit_tests/quick_tests/yaffs_nandemul2k.h +direct/test-framework/unit_tests/quick_tests/yaffs_tagscompat.c +direct/test-framework/unit_tests/quick_tests/yaffs_nandsim_file.h +direct/test-framework/unit_tests/quick_tests/yaffs_osglue.c +direct/test-framework/unit_tests/quick_tests/nandstore_file.c +direct/test-framework/stress_tests/stress_tester/nanddrv.c +direct/test-framework/stress_tests/stress_tester/yaffs_packedtags2.h +direct/test-framework/stress_tests/stress_tester/nandsim.h +direct/test-framework/stress_tests/stress_tester/yaffs_cache.h +direct/test-framework/stress_tests/stress_tester/yaffs_hweight.c +direct/test-framework/stress_tests/stress_tester/yaffs_ramem2k.c +direct/test-framework/stress_tests/stress_tester/yaffs_flexible_file_sim.c +direct/test-framework/stress_tests/stress_tester/yaffs_cache.c +direct/test-framework/stress_tests/stress_tester/yaffs_m18_drv.c +direct/test-framework/stress_tests/stress_tester/nandstore_file.h +direct/test-framework/stress_tests/stress_tester/yaffs_nand.c +direct/test-framework/stress_tests/stress_tester/yaffs_bitmap.h +direct/test-framework/stress_tests/stress_tester/yaffs_yaffs2.c +direct/test-framework/stress_tests/stress_tester/yaffs_fileem2k.h +direct/test-framework/stress_tests/stress_tester/yaffs_checkptrw.h +direct/test-framework/stress_tests/stress_tester/yaffs_error.c +direct/test-framework/stress_tests/stress_tester/yaffs_flashif.h +direct/test-framework/stress_tests/stress_tester/yaffs_getblockinfo.h +direct/test-framework/stress_tests/stress_tester/yaffs_list.h +direct/test-framework/stress_tests/stress_tester/yaffs_ecc.c +direct/test-framework/stress_tests/stress_tester/yaffsfs.h +direct/test-framework/stress_tests/stress_tester/yaffs_nand_drv.c +direct/test-framework/stress_tests/stress_tester/ydirectenv.h +direct/test-framework/stress_tests/stress_tester/yaffs_allocator.h +direct/test-framework/stress_tests/stress_tester/nanddrv.h +direct/test-framework/stress_tests/stress_tester/yaffs_verify.h +direct/test-framework/stress_tests/stress_tester/yaffsfs.c +direct/test-framework/stress_tests/stress_tester/nandsim.c +direct/test-framework/stress_tests/stress_tester/yaffs_ramdisk.h +direct/test-framework/stress_tests/stress_tester/nand_chip.h +direct/test-framework/stress_tests/stress_tester/yaffs_summary.h +direct/test-framework/stress_tests/stress_tester/yaffs_nameval.c +direct/test-framework/stress_tests/stress_tester/yaffs_summary.c +direct/test-framework/stress_tests/stress_tester/yaffs_checkptrw.c +direct/test-framework/stress_tests/stress_tester/nand_store.h +direct/test-framework/stress_tests/stress_tester/yaffs_endian.c +direct/test-framework/stress_tests/stress_tester/yaffs_m18_drv.h +direct/test-framework/stress_tests/stress_tester/yaffs_tagsmarshall.c +direct/test-framework/stress_tests/stress_tester/yaffs_yaffs2.h +direct/test-framework/stress_tests/stress_tester/nandsim_file.c +direct/test-framework/stress_tests/stress_tester/yaffs_allocator.c +direct/test-framework/stress_tests/stress_tester/yportenv.h +direct/test-framework/stress_tests/stress_tester/yaffs_packedtags2.c +direct/test-framework/stress_tests/stress_tester/yaffs_osglue.h +direct/test-framework/stress_tests/stress_tester/yaffs_flashif2.h +direct/test-framework/stress_tests/stress_tester/yaffs_tagsmarshall.h +direct/test-framework/stress_tests/stress_tester/yaffs_endian.h +direct/test-framework/stress_tests/stress_tester/yaffs_nand_drv.h +direct/test-framework/stress_tests/stress_tester/yaffs_nandsim_file.c +direct/test-framework/stress_tests/stress_tester/yaffs_fileem2k.c +direct/test-framework/stress_tests/stress_tester/yaffs_nor_drv.h +direct/test-framework/stress_tests/stress_tester/yaffs_verify.c +direct/test-framework/stress_tests/stress_tester/nandsim_file.h +direct/test-framework/stress_tests/stress_tester/yaffs_packedtags1.c +direct/test-framework/stress_tests/stress_tester/yaffs_nor_drv.c +direct/test-framework/stress_tests/stress_tester/ynorsim.c +direct/test-framework/stress_tests/stress_tester/yaffs_nand.h +direct/test-framework/stress_tests/stress_tester/yaffs_attribs.h +direct/test-framework/stress_tests/stress_tester/yaffs_fileem.c +direct/test-framework/stress_tests/stress_tester/yaffs_yaffs1.c +direct/test-framework/stress_tests/stress_tester/yaffs_guts.h +direct/test-framework/stress_tests/stress_tester/yaffscfg2k.c +direct/test-framework/stress_tests/stress_tester/yaffscfg.h +direct/test-framework/stress_tests/stress_tester/yaffs_flexible_file_sim.h +direct/test-framework/stress_tests/stress_tester/yaffs_guts.c +direct/test-framework/stress_tests/stress_tester/ynorsim.h +direct/test-framework/stress_tests/stress_tester/yaffs_ramdisk.c +direct/test-framework/stress_tests/stress_tester/yaffs_hweight.h +direct/test-framework/stress_tests/stress_tester/yaffs_packedtags1.h +direct/test-framework/stress_tests/stress_tester/yaffs_trace.h +direct/test-framework/stress_tests/stress_tester/yaffs_tagscompat.h +direct/test-framework/stress_tests/stress_tester/yaffs_attribs.c +direct/test-framework/stress_tests/stress_tester/yaffs_ecc.h +direct/test-framework/stress_tests/stress_tester/yaffs_yaffs1.h +direct/test-framework/stress_tests/stress_tester/yaffs_bitmap.c +direct/test-framework/stress_tests/stress_tester/yaffs_nameval.h +direct/test-framework/stress_tests/stress_tester/yaffs_nandemul2k.h +direct/test-framework/stress_tests/stress_tester/yaffs_tagscompat.c +direct/test-framework/stress_tests/stress_tester/yaffs_nandsim_file.h +direct/test-framework/stress_tests/stress_tester/yaffs_osglue.c +direct/test-framework/stress_tests/stress_tester/nandstore_file.c +direct/test-framework/stress_tests/threading/nanddrv.c +direct/test-framework/stress_tests/threading/yaffs_packedtags2.h +direct/test-framework/stress_tests/threading/nandsim.h +direct/test-framework/stress_tests/threading/yaffs_cache.h +direct/test-framework/stress_tests/threading/yaffs_hweight.c +direct/test-framework/stress_tests/threading/yaffs_ramem2k.c +direct/test-framework/stress_tests/threading/yaffs_flexible_file_sim.c +direct/test-framework/stress_tests/threading/yaffs_cache.c +direct/test-framework/stress_tests/threading/yaffs_m18_drv.c +direct/test-framework/stress_tests/threading/nandstore_file.h +direct/test-framework/stress_tests/threading/yaffs_nand.c +direct/test-framework/stress_tests/threading/yaffs_bitmap.h +direct/test-framework/stress_tests/threading/yaffs_yaffs2.c +direct/test-framework/stress_tests/threading/yaffs_fileem2k.h +direct/test-framework/stress_tests/threading/yaffs_checkptrw.h +direct/test-framework/stress_tests/threading/yaffs_error.c +direct/test-framework/stress_tests/threading/yaffs_flashif.h +direct/test-framework/stress_tests/threading/yaffs_getblockinfo.h +direct/test-framework/stress_tests/threading/yaffs_list.h +direct/test-framework/stress_tests/threading/yaffs_ecc.c +direct/test-framework/stress_tests/threading/yaffsfs.h +direct/test-framework/stress_tests/threading/yaffs_nand_drv.c +direct/test-framework/stress_tests/threading/ydirectenv.h +direct/test-framework/stress_tests/threading/yaffs_allocator.h +direct/test-framework/stress_tests/threading/nanddrv.h +direct/test-framework/stress_tests/threading/yaffs_verify.h +direct/test-framework/stress_tests/threading/yaffsfs.c +direct/test-framework/stress_tests/threading/nandsim.c +direct/test-framework/stress_tests/threading/yaffs_ramdisk.h +direct/test-framework/stress_tests/threading/nand_chip.h +direct/test-framework/stress_tests/threading/yaffs_summary.h +direct/test-framework/stress_tests/threading/yaffs_nameval.c +direct/test-framework/stress_tests/threading/yaffs_summary.c +direct/test-framework/stress_tests/threading/yaffs_checkptrw.c +direct/test-framework/stress_tests/threading/nand_store.h +direct/test-framework/stress_tests/threading/yaffs_endian.c +direct/test-framework/stress_tests/threading/yaffs_m18_drv.h +direct/test-framework/stress_tests/threading/yaffs_tagsmarshall.c +direct/test-framework/stress_tests/threading/yaffs_yaffs2.h +direct/test-framework/stress_tests/threading/nandsim_file.c +direct/test-framework/stress_tests/threading/yaffs_allocator.c +direct/test-framework/stress_tests/threading/yportenv.h +direct/test-framework/stress_tests/threading/yaffs_packedtags2.c +direct/test-framework/stress_tests/threading/yaffs_osglue.h +direct/test-framework/stress_tests/threading/yaffs_flashif2.h +direct/test-framework/stress_tests/threading/yaffs_tagsmarshall.h +direct/test-framework/stress_tests/threading/yaffs_endian.h +direct/test-framework/stress_tests/threading/yaffs_nand_drv.h +direct/test-framework/stress_tests/threading/yaffs_nandsim_file.c +direct/test-framework/stress_tests/threading/yaffs_fileem2k.c +direct/test-framework/stress_tests/threading/yaffs_nor_drv.h +direct/test-framework/stress_tests/threading/yaffs_verify.c +direct/test-framework/stress_tests/threading/nandsim_file.h +direct/test-framework/stress_tests/threading/yaffs_packedtags1.c +direct/test-framework/stress_tests/threading/yaffs_nor_drv.c +direct/test-framework/stress_tests/threading/ynorsim.c +direct/test-framework/stress_tests/threading/yaffs_nand.h +direct/test-framework/stress_tests/threading/yaffs_attribs.h +direct/test-framework/stress_tests/threading/yaffs_fileem.c +direct/test-framework/stress_tests/threading/yaffs_yaffs1.c +direct/test-framework/stress_tests/threading/yaffs_guts.h +direct/test-framework/stress_tests/threading/yaffscfg2k.c +direct/test-framework/stress_tests/threading/yaffscfg.h +direct/test-framework/stress_tests/threading/yaffs_flexible_file_sim.h +direct/test-framework/stress_tests/threading/yaffs_guts.c +direct/test-framework/stress_tests/threading/ynorsim.h +direct/test-framework/stress_tests/threading/yaffs_ramdisk.c +direct/test-framework/stress_tests/threading/yaffs_hweight.h +direct/test-framework/stress_tests/threading/yaffs_packedtags1.h +direct/test-framework/stress_tests/threading/yaffs_trace.h +direct/test-framework/stress_tests/threading/yaffs_tagscompat.h +direct/test-framework/stress_tests/threading/yaffs_attribs.c +direct/test-framework/stress_tests/threading/yaffs_ecc.h +direct/test-framework/stress_tests/threading/yaffs_yaffs1.h +direct/test-framework/stress_tests/threading/yaffs_bitmap.c +direct/test-framework/stress_tests/threading/yaffs_nameval.h +direct/test-framework/stress_tests/threading/yaffs_nandemul2k.h +direct/test-framework/stress_tests/threading/yaffs_tagscompat.c +direct/test-framework/stress_tests/threading/yaffs_nandsim_file.h +direct/test-framework/stress_tests/threading/yaffs_osglue.c +direct/test-framework/stress_tests/threading/nandstore_file.c +direct/test-framework/stress_tests/handle_tests/nanddrv.c +direct/test-framework/stress_tests/handle_tests/yaffs_packedtags2.h +direct/test-framework/stress_tests/handle_tests/nandsim.h +direct/test-framework/stress_tests/handle_tests/yaffs_cache.h +direct/test-framework/stress_tests/handle_tests/yaffs_hweight.c +direct/test-framework/stress_tests/handle_tests/yaffs_ramem2k.c +direct/test-framework/stress_tests/handle_tests/yaffs_flexible_file_sim.c +direct/test-framework/stress_tests/handle_tests/yaffs_cache.c +direct/test-framework/stress_tests/handle_tests/yaffs_m18_drv.c +direct/test-framework/stress_tests/handle_tests/nandstore_file.h +direct/test-framework/stress_tests/handle_tests/yaffs_nand.c +direct/test-framework/stress_tests/handle_tests/yaffs_bitmap.h +direct/test-framework/stress_tests/handle_tests/yaffs_yaffs2.c +direct/test-framework/stress_tests/handle_tests/yaffs_fileem2k.h +direct/test-framework/stress_tests/handle_tests/yaffs_checkptrw.h +direct/test-framework/stress_tests/handle_tests/yaffs_error.c +direct/test-framework/stress_tests/handle_tests/yaffs_flashif.h +direct/test-framework/stress_tests/handle_tests/yaffs_getblockinfo.h +direct/test-framework/stress_tests/handle_tests/yaffs_list.h +direct/test-framework/stress_tests/handle_tests/yaffs_ecc.c +direct/test-framework/stress_tests/handle_tests/yaffsfs.h +direct/test-framework/stress_tests/handle_tests/yaffs_nand_drv.c +direct/test-framework/stress_tests/handle_tests/ydirectenv.h +direct/test-framework/stress_tests/handle_tests/yaffs_allocator.h +direct/test-framework/stress_tests/handle_tests/nanddrv.h +direct/test-framework/stress_tests/handle_tests/yaffs_verify.h +direct/test-framework/stress_tests/handle_tests/yaffsfs.c +direct/test-framework/stress_tests/handle_tests/nandsim.c +direct/test-framework/stress_tests/handle_tests/yaffs_ramdisk.h +direct/test-framework/stress_tests/handle_tests/nand_chip.h +direct/test-framework/stress_tests/handle_tests/yaffs_summary.h +direct/test-framework/stress_tests/handle_tests/yaffs_nameval.c +direct/test-framework/stress_tests/handle_tests/yaffs_summary.c +direct/test-framework/stress_tests/handle_tests/yaffs_checkptrw.c +direct/test-framework/stress_tests/handle_tests/nand_store.h +direct/test-framework/stress_tests/handle_tests/yaffs_endian.c +direct/test-framework/stress_tests/handle_tests/yaffs_m18_drv.h +direct/test-framework/stress_tests/handle_tests/yaffs_tagsmarshall.c +direct/test-framework/stress_tests/handle_tests/yaffs_yaffs2.h +direct/test-framework/stress_tests/handle_tests/nandsim_file.c +direct/test-framework/stress_tests/handle_tests/yaffs_allocator.c +direct/test-framework/stress_tests/handle_tests/yportenv.h +direct/test-framework/stress_tests/handle_tests/yaffs_packedtags2.c +direct/test-framework/stress_tests/handle_tests/yaffs_osglue.h +direct/test-framework/stress_tests/handle_tests/yaffs_flashif2.h +direct/test-framework/stress_tests/handle_tests/yaffs_tagsmarshall.h +direct/test-framework/stress_tests/handle_tests/yaffs_endian.h +direct/test-framework/stress_tests/handle_tests/yaffs_nand_drv.h +direct/test-framework/stress_tests/handle_tests/yaffs_nandsim_file.c +direct/test-framework/stress_tests/handle_tests/yaffs_fileem2k.c +direct/test-framework/stress_tests/handle_tests/yaffs_nor_drv.h +direct/test-framework/stress_tests/handle_tests/yaffs_verify.c +direct/test-framework/stress_tests/handle_tests/nandsim_file.h +direct/test-framework/stress_tests/handle_tests/yaffs_packedtags1.c +direct/test-framework/stress_tests/handle_tests/yaffs_nor_drv.c +direct/test-framework/stress_tests/handle_tests/ynorsim.c +direct/test-framework/stress_tests/handle_tests/yaffs_nand.h +direct/test-framework/stress_tests/handle_tests/yaffs_attribs.h +direct/test-framework/stress_tests/handle_tests/yaffs_fileem.c +direct/test-framework/stress_tests/handle_tests/yaffs_yaffs1.c +direct/test-framework/stress_tests/handle_tests/yaffs_guts.h +direct/test-framework/stress_tests/handle_tests/yaffscfg2k.c +direct/test-framework/stress_tests/handle_tests/yaffscfg.h +direct/test-framework/stress_tests/handle_tests/yaffs_flexible_file_sim.h +direct/test-framework/stress_tests/handle_tests/yaffs_guts.c +direct/test-framework/stress_tests/handle_tests/ynorsim.h +direct/test-framework/stress_tests/handle_tests/yaffs_ramdisk.c +direct/test-framework/stress_tests/handle_tests/yaffs_hweight.h +direct/test-framework/stress_tests/handle_tests/yaffs_packedtags1.h +direct/test-framework/stress_tests/handle_tests/yaffs_trace.h +direct/test-framework/stress_tests/handle_tests/yaffs_tagscompat.h +direct/test-framework/stress_tests/handle_tests/yaffs_attribs.c +direct/test-framework/stress_tests/handle_tests/yaffs_ecc.h +direct/test-framework/stress_tests/handle_tests/yaffs_yaffs1.h +direct/test-framework/stress_tests/handle_tests/yaffs_bitmap.c +direct/test-framework/stress_tests/handle_tests/yaffs_nameval.h +direct/test-framework/stress_tests/handle_tests/yaffs_nandemul2k.h +direct/test-framework/stress_tests/handle_tests/yaffs_tagscompat.c +direct/test-framework/stress_tests/handle_tests/yaffs_nandsim_file.h +direct/test-framework/stress_tests/handle_tests/yaffs_osglue.c +direct/test-framework/stress_tests/handle_tests/nandstore_file.c diff --git a/direct/test-framework/stress_tests/handle_tests/.gitignore b/direct/test-framework/stress_tests/handle_tests/.gitignore new file mode 100644 index 0000000..a69b6d9 --- /dev/null +++ b/direct/test-framework/stress_tests/handle_tests/.gitignore @@ -0,0 +1 @@ +handle_test diff --git a/direct/test-framework/stress_tests/stress_tester/.gitignore b/direct/test-framework/stress_tests/stress_tester/.gitignore new file mode 100644 index 0000000..e2cd4da --- /dev/null +++ b/direct/test-framework/stress_tests/stress_tester/.gitignore @@ -0,0 +1 @@ +yaffs_tester diff --git a/direct/test-framework/stress_tests/threading/.gitignore b/direct/test-framework/stress_tests/threading/.gitignore new file mode 100644 index 0000000..0bc952b --- /dev/null +++ b/direct/test-framework/stress_tests/threading/.gitignore @@ -0,0 +1 @@ +threading diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/.gitignore b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/.gitignore new file mode 100644 index 0000000..dcc33e8 --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/.gitignore @@ -0,0 +1 @@ +time_32_tests diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/.gitignore b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/.gitignore new file mode 100644 index 0000000..5c35cde --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/.gitignore @@ -0,0 +1 @@ +time_64_tests diff --git a/direct/test-framework/unit_tests/is_yaffs_working_tests/.gitignore b/direct/test-framework/unit_tests/is_yaffs_working_tests/.gitignore new file mode 100644 index 0000000..2e6dc02 --- /dev/null +++ b/direct/test-framework/unit_tests/is_yaffs_working_tests/.gitignore @@ -0,0 +1 @@ +test_1_yaffs_mount diff --git a/direct/test-framework/unit_tests/quick_tests/.gitignore b/direct/test-framework/unit_tests/quick_tests/.gitignore new file mode 100644 index 0000000..5e958c3 --- /dev/null +++ b/direct/test-framework/unit_tests/quick_tests/.gitignore @@ -0,0 +1 @@ +quick_tests -- 2.30.2 From 858769090d82e03c0556aaa46af4274d8a791580 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 6 Aug 2021 14:24:25 +1200 Subject: [PATCH 04/16] Fixed issues with 32 bit time tests Fixed the makefile to complile in 32 bit mode Fixed yaffs_endian.c to swap 32 bit sized times. Signed-off-by: Timothy Manning --- .../unit_tests/64_and_32_bit_time/32_bit/Makefile | 2 +- yaffs_endian.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile index 8bcaf72..7c12c25 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile @@ -21,7 +21,7 @@ YDI_FRAMEWORK_DIR = ../../../ CLEAN_OBJS = time_32_tests emfile-2k-0 emfile-nand emfile-nand128MB TESTFILES = time_32_tests.o -CFLAGS = -DYAFFS_USE_32_BIT_TIME_T +CFLAGS = -DCONFIG_YAFFS_USE_32_BIT_TIME_T all: time_32_tests YAFFS_TEST_OBJS = $(COMMONTESTOBJS) $(TESTFILES) diff --git a/yaffs_endian.c b/yaffs_endian.c index 571a35f..6103f4e 100644 --- a/yaffs_endian.c +++ b/yaffs_endian.c @@ -42,9 +42,9 @@ void yaffs_do_endian_oh(struct yaffs_dev *dev, struct yaffs_obj_hdr *oh) oh->yst_uid = swap_u32(oh->yst_uid); oh->yst_gid = swap_u32(oh->yst_gid); - oh->yst_atime = swap_ytime_t(oh->yst_atime); - oh->yst_mtime = swap_ytime_t(oh->yst_mtime); - oh->yst_ctime = swap_ytime_t(oh->yst_ctime); + oh->yst_atime = swap_u32(oh->yst_atime); + oh->yst_mtime = swap_u32(oh->yst_mtime); + oh->yst_ctime = swap_u32(oh->yst_ctime); oh->file_size_low = swap_u32(oh->file_size_low); -- 2.30.2 From 710cfd1ea71e27185612b0bdca50a23cab88907c Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 6 Aug 2021 14:27:40 +1200 Subject: [PATCH 05/16] Added more testcases to the 64 bit time tests. Signed-off-by: Timothy Manning --- .../64_and_32_bit_time/64_bit/time_64_tests.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/time_64_tests.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/time_64_tests.c index 44cd7eb..19abe94 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/time_64_tests.c +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/time_64_tests.c @@ -19,6 +19,11 @@ int main() return 1; } + struct yaffs_obj obj; + if (sizeof(obj.yst_atime) != 8) { + printf("Error: size of yaffs_obj.yst_atime is not 64 bits\n"); + return 1; + } //create several times and save them // @@ -41,11 +46,19 @@ int main() yaffs_do_endian_oh(&dev,&oh); //check that the endianess is correct - u64 expected = 0xb03217af; - if (oh.yst_atime != expected || oh.yst_mtime != expected || oh.yst_ctime != expected) { - printf("endian test failed, got %x\n",oh.yst_atime); + u32 expected = 0xb03217af; + if (oh.yst_atime != expected ) { + printf("endian test failed for yst_atime, got %x expected %x\n",oh.yst_atime,expected); return 1; } + if (oh.yst_mtime != expected) { + printf("endian test failed for yst_mtime, got %x, expected %x\n",oh.yst_mtime,expected); + return 1; + } + if (oh.yst_ctime != expected) { + printf("endian test failed for yst_ctime, got %x, expected %x\n",oh.yst_ctime,expected); + return 1; + } printf("all tests pass\n"); return 0; -- 2.30.2 From df78c65f2ea7bc2c447f3f7c5c8ce592d5a5587b Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 6 Aug 2021 14:43:05 +1200 Subject: [PATCH 06/16] Copied yaffs direct files are now read only. Signed-off-by: Timothy Manning --- direct/handle_common.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/direct/handle_common.sh b/direct/handle_common.sh index f46ee53..28edb6f 100755 --- a/direct/handle_common.sh +++ b/direct/handle_common.sh @@ -34,6 +34,8 @@ set -e -x -e "s/strncmp/yaffs_strncmp/g"\ -e "s/loff_t/Y_LOFF_T/g" \ >$i + + chmod 0444 $i done elif [ "$1" = "clean" ] ; then for i in $YAFFS_COMMON_SOURCES ; do -- 2.30.2 From 7cd92e57ab45ca1904926bea11e1d0f1d1568bd7 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 6 Aug 2021 15:56:25 +1200 Subject: [PATCH 07/16] Tests will now delete the emfiles with make clean --- direct/test-framework/FrameworkRules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/test-framework/FrameworkRules.mk b/direct/test-framework/FrameworkRules.mk index 684062c..f8cd849 100644 --- a/direct/test-framework/FrameworkRules.mk +++ b/direct/test-framework/FrameworkRules.mk @@ -28,7 +28,7 @@ CFLAGS += -Wextra -Wpointer-arith #CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations #CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline - +CLEAN_OBJS = emfile-2k-0 emfile-nand emfile-nand128MB COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o yaffs_error.o\ yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \ -- 2.30.2 From beaea59ad0543f755d502ce48643ecdb927cf091 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Sun, 8 Aug 2021 10:33:46 +1200 Subject: [PATCH 08/16] updated unit test runner to also clean its sub dirs --- .../test-framework/unit_tests/test_runner.py | 65 ++++++++++++++++--- 1 file changed, 55 insertions(+), 10 deletions(-) diff --git a/direct/test-framework/unit_tests/test_runner.py b/direct/test-framework/unit_tests/test_runner.py index 77bab48..9d963e9 100755 --- a/direct/test-framework/unit_tests/test_runner.py +++ b/direct/test-framework/unit_tests/test_runner.py @@ -51,14 +51,59 @@ def run_makefile_test(path): return (TEST_PASSED, "test passed") +def clean_tests(makefile_paths): + cmds = [("make -j -C {} clean".format(path), path) for path in makefile_paths] + + failed = 0 + passed = 0 + + for cmd, is_successful, cmd_text, debug_info in run_cmds(cmds): + if not is_successful: + print("\033[41mtest failed to clean\033[0m {}".format(debug_info[0])) + failed += 1 + else : + print("\033[42mtest cleaned successfully\033[0m {}".format(debug_info[0])) + passed += 1 + if not failed: + print ("\n\033[42mAll tests cleaned successfully\033[0m") + else : + print ("\n\033[42mTests failed to clean successfully\033[0m") + print("ran {}, passed {}, failed {}".format(len(cmds), passed, failed)) + +def run_tests(makefile_paths): + cmds = [("make -j -C {} test".format(path), path) for path in makefile_paths] + + failed = 0 + passed = 0 + + print("running tests") + for cmd, is_successful, cmd_text, debug_info in run_cmds(cmds): + if not is_successful: + print("\033[41mtest failed\033[0m {}".format(debug_info[0])) + failed += 1 + else : + print("\033[42mtest passed\033[0m {}".format(debug_info[0])) + passed += 1 + if not failed: + print ("\n\033[42mAll tests passed\033[0m") + else : + print ("\n\033[41mTests failed\033[0m") + print("ran {}, passed {}, failed {}".format(len(cmds), passed, failed)) + +def run_cmds(cmds): + output = [] + for cmd, *debug_info in cmds: + try: + subprocess.check_output(cmd, shell=True) + output.append((cmd, True, "todo add getting text for non failing test", debug_info)) + except subprocess.CalledProcessError as e: + output.append((cmd, False, e.output.decode('UTF-8'), debug_info)) + return output if __name__ == "__main__": - #run the test runner. - failed_tests = run(test_list) - - print("\ntest summary #############") - if len(failed_tests) == 0: - print('\033[42m' +"all tests passed"+'\033[0m') - else: - for path, output in failed_tests: - print('\033[41m' +"test {} failed".format(path)+'\033[0m') - print('\033[41m' + "ran {} tests, {} failed".format(len(test_list), len(failed_tests))+'\033[0m') + if len(sys.argv) == 2 and sys.argv[1] == "clean": + clean_tests(test_list) + elif len(sys.argv) == 1: + #run the test runner. + failed_tests = run_tests(test_list) + else: + print("run with command ./test_runner.py [clean]") -- 2.30.2 From 9de407bd16e3a59ab43bced7ebf488b93dda1217 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Tue, 10 Aug 2021 09:01:10 +1200 Subject: [PATCH 09/16] Adding more time tests Signed-off-by: Timothy Manning --- .../64_and_32_bit_time/64_bit/Makefile | 9 ++-- .../64_and_32_bit_time/64_bit/create_64_bit.c | 45 +++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile index a682ed6..6cdcccd 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile @@ -21,9 +21,9 @@ YDI_FRAMEWORK_DIR = ../../../ CLEAN_OBJS = time_64_tests emfile-2k-0 emfile-nand emfile-nand128MB TESTFILES = time_64_tests.o -all: time_64_tests +all: time_64_tests create_64_bit -YAFFS_TEST_OBJS = $(COMMONTESTOBJS) $(TESTFILES) +YAFFS_TEST_OBJS = $(COMMONTESTOBJS) ALL_UNSORTED_OBJS += $(YAFFS_TEST_OBJS) $(FUZZER_OBJS) @@ -34,5 +34,8 @@ phony. test: time_64_tests ./time_64_tests time_64_tests: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) - gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) -lpthread + gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) time_64_tests.o -lpthread + +create_64_bit: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) + gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) create_64_bit.o -lpthread diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c new file mode 100644 index 0000000..1b8f03e --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c @@ -0,0 +1,45 @@ +//#include +#include +#include "yaffsfs.h" + +#define TEST_PASS 0 +#define TEST_FAIL 1 + +#define YAFFS_MOUNT_POINT "/yflash2/" +#define FILE_PATH "/yflash2/foo.txt" + +int random_seed; +int simulate_power_failure = 0; + + +int setup_yaffs() { + yaffs_start_up(); + yaffs_set_trace(0); + if (yaffs_mount(YAFFS_MOUNT_POINT) < 0) { + printf("failed to mount %s/n", YAFFS_MOUNT_POINT); + return TEST_FAIL; + } + + return TEST_PASS; +} +int shared_create(int argc, char *argv[]){ + + if (argc != 3) { + printf("wrong number of arguments\n"); + printf("requires $ create file_name time\n"); + return TEST_FAIL; + } + + setup_yaffs(); + uint time = atoi(argv[2]); + char *file_path = argv[1]; + if (yaffs_open(FILE_PATH, O_CREAT | O_RDWR, S_IREAD |S_IWRITE)) { + printf("failed to open the file %s/n", FILE_PATH); + return TEST_FAIL; + } + printf("created file: %s, with time: %d\n", file_path, time); + return TEST_PASS; +} +int main(int argc, char *argv[] ){ + return shared_create(argc, argv); +} -- 2.30.2 From 7934004aff8cc9c610933f688a55a5b5ed3cd050 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Tue, 17 Aug 2021 10:02:29 +1200 Subject: [PATCH 10/16] Updating Makefile to build more time tests. Signed-off-by: Timothy Manning --- .../unit_tests/64_and_32_bit_time/64_bit/Makefile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile index 6cdcccd..deff539 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile @@ -18,10 +18,10 @@ YDI_DIR = ../../../../ YDI_FRAMEWORK_DIR = ../../../ -CLEAN_OBJS = time_64_tests emfile-2k-0 emfile-nand emfile-nand128MB -TESTFILES = time_64_tests.o +MAINFILES = time_64_tests create_64_bit +CLEAN_OBJS = $(MAINFILES) -all: time_64_tests create_64_bit +all: $(MAINFILES) YAFFS_TEST_OBJS = $(COMMONTESTOBJS) @@ -32,10 +32,6 @@ include $(YDI_FRAMEWORK_DIR)/FrameworkRules.mk phony. test: time_64_tests ./time_64_tests +$(MAINFILES): $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) + gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) $@.o -lpthread -time_64_tests: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) - gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) time_64_tests.o -lpthread - - -create_64_bit: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) - gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) create_64_bit.o -lpthread -- 2.30.2 From 9f52f17a8607d327642e4585c22fbae42a43285b Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Tue, 17 Aug 2021 10:06:32 +1200 Subject: [PATCH 11/16] Added .swp files to .gitignore. Signed-off-by: Timothy Manning --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 5fa34e9..ae483e2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,9 @@ DEADJOE /Module.symvers /.tmp_versions +# .swp files which are generated by open vim sessions. +*.swp + # # cscope files # -- 2.30.2 From 0137051a94e1e688479aa916574894d150d71625 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Tue, 17 Aug 2021 10:21:48 +1200 Subject: [PATCH 12/16] 64 bit test now cleans correctly. Signed-off-by: Timothy Manning --- direct/test-framework/FrameworkRules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/test-framework/FrameworkRules.mk b/direct/test-framework/FrameworkRules.mk index f8cd849..2efa240 100644 --- a/direct/test-framework/FrameworkRules.mk +++ b/direct/test-framework/FrameworkRules.mk @@ -28,7 +28,7 @@ CFLAGS += -Wextra -Wpointer-arith #CFLAGS+= -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations #CFLAGS+= -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline -CLEAN_OBJS = emfile-2k-0 emfile-nand emfile-nand128MB +CLEAN_OBJS += emfile-2k-0 emfile-nand emfile-nand128MB COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o yaffs_error.o\ yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \ -- 2.30.2 From 5758b7a95a391ac8e4d631fbea9fd409d1130a62 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 10 Sep 2021 16:03:13 +1200 Subject: [PATCH 13/16] Added create and validate tests. Signed-off-by: Timothy Manning --- .../64_and_32_bit_time/64_bit/Makefile | 15 ++-- .../64_and_32_bit_time/64_bit/create_64_bit.c | 43 +---------- .../64_and_32_bit_time/64_bit/shared.c | 1 + .../64_and_32_bit_time/64_bit/shared.h | 1 + .../64_bit/validate_64_bit.c | 8 ++ .../64_and_32_bit_time/shared/shared.c | 75 +++++++++++++++++++ .../64_and_32_bit_time/shared/shared.h | 13 ++++ 7 files changed, 111 insertions(+), 45 deletions(-) create mode 120000 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.c create mode 120000 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.h create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.h diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile index deff539..179ec07 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/Makefile @@ -18,20 +18,23 @@ YDI_DIR = ../../../../ YDI_FRAMEWORK_DIR = ../../../ -MAINFILES = time_64_tests create_64_bit -CLEAN_OBJS = $(MAINFILES) +MAINFILES = time_64_tests create_64_bit validate_64_bit +MAIN_OBJS = $(addsuffix .o,$(MAINFILES)) -all: $(MAINFILES) +EXTRA_OBJS = shared.o -YAFFS_TEST_OBJS = $(COMMONTESTOBJS) +CLEAN_OBJS = $(MAINFILES) +YAFFS_TEST_OBJS = $(COMMONTESTOBJS) $(EXTRA_OBJS) +ALL_UNSORTED_OBJS += $(YAFFS_TEST_OBJS) $(MAIN_OBJS) -ALL_UNSORTED_OBJS += $(YAFFS_TEST_OBJS) $(FUZZER_OBJS) +all: $(MAINFILES) include $(YDI_FRAMEWORK_DIR)/FrameworkRules.mk phony. test: time_64_tests ./time_64_tests -$(MAINFILES): $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) + +$(MAINFILES): $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) $(MAIN_OBJS) gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) $@.o -lpthread diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c index 1b8f03e..85c29bd 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c @@ -1,45 +1,10 @@ -//#include -#include -#include "yaffsfs.h" - -#define TEST_PASS 0 -#define TEST_FAIL 1 - -#define YAFFS_MOUNT_POINT "/yflash2/" -#define FILE_PATH "/yflash2/foo.txt" +#include "shared.h" int random_seed; int simulate_power_failure = 0; - -int setup_yaffs() { - yaffs_start_up(); - yaffs_set_trace(0); - if (yaffs_mount(YAFFS_MOUNT_POINT) < 0) { - printf("failed to mount %s/n", YAFFS_MOUNT_POINT); - return TEST_FAIL; - } - - return TEST_PASS; -} -int shared_create(int argc, char *argv[]){ - - if (argc != 3) { - printf("wrong number of arguments\n"); - printf("requires $ create file_name time\n"); - return TEST_FAIL; - } - - setup_yaffs(); - uint time = atoi(argv[2]); - char *file_path = argv[1]; - if (yaffs_open(FILE_PATH, O_CREAT | O_RDWR, S_IREAD |S_IWRITE)) { - printf("failed to open the file %s/n", FILE_PATH); - return TEST_FAIL; - } - printf("created file: %s, with time: %d\n", file_path, time); - return TEST_PASS; -} int main(int argc, char *argv[] ){ - return shared_create(argc, argv); + int ret = shared_create(argc, argv); + ret = ret && shared_validate_file(argc, argv); + return ret; } diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.c new file mode 120000 index 0000000..e4b04bb --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.c @@ -0,0 +1 @@ +../shared/shared.c \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.h b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.h new file mode 120000 index 0000000..ae87f9e --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/shared.h @@ -0,0 +1 @@ +../shared/shared.h \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c new file mode 100644 index 0000000..df1fcdb --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c @@ -0,0 +1,8 @@ +#include "shared.h" + +int random_seed; +int simulate_power_failure = 0; + +int main(int argc, char *argv[] ){ + return shared_validate_file(argc, argv); +} diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c new file mode 100644 index 0000000..0e0dd8b --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c @@ -0,0 +1,75 @@ +#include +#include "yaffsfs.h" +#include "shared.h" + +void assert_exit_yaffs(char *fun_name, int fun_return_value){ + if (fun_return_value < 0) { + printf("yaffs command: %s failed with error code %d \n", fun_name, fun_return_value); + int error_code = yaffsfs_GetLastError(); + printf("error code is: %d, which is %s\n", error_code, yaffs_error_to_str(error_code)); + printf("exiting program now\n"); + exit(-1); + } +} + +void setup_yaffs() { + yaffs_start_up(); + yaffs_set_trace(0); + assert_exit_yaffs("yaffs_mount", yaffs_mount(YAFFS_MOUNT_POINT)); +} + + + +int shared_create(int argc, char *argv[]){ + + if (argc != 3) { + printf("wrong number of arguments\n"); + printf("requires $ create file_name time\n"); + return TEST_FAIL; + } + + setup_yaffs(); + char *file_path = argv[1]; + int handle = yaffs_open(file_path, O_CREAT | O_RDWR, S_IREAD |S_IWRITE); + assert_exit_yaffs ( "yaffs_open", handle); + + assert_exit_yaffs ( "yaffs_close", yaffs_close(handle)); + + + //set the time. + uint time = atoi(argv[2]); + + struct yaffs_utimbuf new_times; + new_times.actime = time; + int ret = yaffs_utime(file_path, &new_times); + assert_exit_yaffs("yaffs_utime", ret); + + assert_exit_yaffs("yaffs_unmount", yaffs_unmount(YAFFS_MOUNT_POINT)); + return TEST_FAIL; +} + +int shared_validate_file(int argc, char *argv[]){ + + if (argc != 3) { + printf("wrong number of arguments\n"); + printf("requires $ create file_name time\n"); + return TEST_FAIL; + } + + setup_yaffs(); + char *file_path = argv[1]; + int handle = yaffs_open(file_path, O_RDWR, S_IREAD |S_IWRITE); + assert_exit_yaffs ( "yaffs_open", handle); + + //assert the file is the correct size and has the correct time. + uint expected_time = atoi(argv[2]); + struct yaffs_stat stat; + assert_exit_yaffs ( "yaffs_stat", yaffs_stat(file_path, &stat)); + assert_exit_yaffs ( "yaffs_close", yaffs_close(handle)); + if (stat.yst_atime != expected_time) { + printf("stat time is different from expected time\n"); + exit(0); + } + assert_exit_yaffs("yaffs_unmount", yaffs_unmount(YAFFS_MOUNT_POINT)); + return TEST_FAIL; +} diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.h b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.h new file mode 100644 index 0000000..31b64b8 --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.h @@ -0,0 +1,13 @@ +#ifndef __SHARED_H__ +#define __SHARED_H__ + +#define TEST_PASS 0 +#define TEST_FAIL 1 + +#define YAFFS_MOUNT_POINT "/yflash2/" +#define FILE_PATH "/yflash2/foo.txt" + +void setup_yaffs(); +int shared_create(); +int shared_validate_file(); +#endif -- 2.30.2 From 9d9b662225f9b3684bb4ebd3646216f3ab190ed9 Mon Sep 17 00:00:00 2001 From: Timothy Manning Date: Fri, 24 Sep 2021 16:18:35 +1200 Subject: [PATCH 14/16] Finished the 32 and 64 bit tests. Signed-off-by: Timothy Manning --- .../64_and_32_bit_time/32_bit/Makefile | 20 ++++++++++--------- .../64_and_32_bit_time/32_bit/create_32_bit.c | 1 + .../64_and_32_bit_time/32_bit/shared.c | 1 + .../64_and_32_bit_time/32_bit/shared.h | 1 + .../32_bit/validate_32_bit.c | 1 + .../64_and_32_bit_time/64_bit/create_64_bit.c | 11 +--------- .../64_bit/validate_64_bit.c | 9 +-------- .../64_and_32_bit_time/shared/create_file.c | 10 ++++++++++ .../64_and_32_bit_time/shared/shared.c | 11 +++++++--- .../64_and_32_bit_time/shared/validate_file.c | 8 ++++++++ .../64_and_32_bit_time/time_test_runner.sh | 14 +++++++++++++ 11 files changed, 57 insertions(+), 30 deletions(-) create mode 120000 direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/create_32_bit.c create mode 120000 direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.c create mode 120000 direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.h create mode 120000 direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/validate_32_bit.c mode change 100644 => 120000 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c mode change 100644 => 120000 direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/shared/create_file.c create mode 100644 direct/test-framework/unit_tests/64_and_32_bit_time/shared/validate_file.c create mode 100755 direct/test-framework/unit_tests/64_and_32_bit_time/time_test_runner.sh diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile index 7c12c25..8842f4b 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/Makefile @@ -1,4 +1,4 @@ -# Makefile for 32 bit time test. +# Makefile for 64 bit time test. # # # YAFFS: Yet another Flash File System. A NAND-flash specific file system. @@ -18,22 +18,24 @@ YDI_DIR = ../../../../ YDI_FRAMEWORK_DIR = ../../../ -CLEAN_OBJS = time_32_tests emfile-2k-0 emfile-nand emfile-nand128MB -TESTFILES = time_32_tests.o +MAINFILES = time_32_tests create_32_bit validate_32_bit +MAIN_OBJS = $(addsuffix .o,$(MAINFILES)) -CFLAGS = -DCONFIG_YAFFS_USE_32_BIT_TIME_T -all: time_32_tests +EXTRA_OBJS = shared.o -YAFFS_TEST_OBJS = $(COMMONTESTOBJS) $(TESTFILES) +CLEAN_OBJS = $(MAINFILES) +CFLAGS = -DCONFIG_YAFFS_USE_32_BIT_TIME_T +YAFFS_TEST_OBJS = $(COMMONTESTOBJS) $(EXTRA_OBJS) +ALL_UNSORTED_OBJS += $(YAFFS_TEST_OBJS) $(MAIN_OBJS) -ALL_UNSORTED_OBJS += $(YAFFS_TEST_OBJS) $(FUZZER_OBJS) +all: $(MAINFILES) include $(YDI_FRAMEWORK_DIR)/FrameworkRules.mk phony. test: time_32_tests ./time_32_tests -time_32_tests: $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) - gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) -lpthread +$(MAINFILES): $(FRAMEWORK_SOURCES) $(YAFFS_TEST_OBJS) $(MAIN_OBJS) + gcc $(CFLAGS) -o $@ $(YAFFS_TEST_OBJS) $@.o -lpthread -DCONFIG_YAFFS_USE_32_BIT_TIME_T diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/create_32_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/create_32_bit.c new file mode 120000 index 0000000..d73d45a --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/create_32_bit.c @@ -0,0 +1 @@ +../shared/create_file.c \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.c b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.c new file mode 120000 index 0000000..e4b04bb --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.c @@ -0,0 +1 @@ +../shared/shared.c \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.h b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.h new file mode 120000 index 0000000..ae87f9e --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/shared.h @@ -0,0 +1 @@ +../shared/shared.h \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/validate_32_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/validate_32_bit.c new file mode 120000 index 0000000..c08acf3 --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/32_bit/validate_32_bit.c @@ -0,0 +1 @@ +../shared/validate_file.c \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c deleted file mode 100644 index 85c29bd..0000000 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "shared.h" - -int random_seed; -int simulate_power_failure = 0; - -int main(int argc, char *argv[] ){ - int ret = shared_create(argc, argv); - ret = ret && shared_validate_file(argc, argv); - return ret; -} diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c new file mode 120000 index 0000000..d73d45a --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/create_64_bit.c @@ -0,0 +1 @@ +../shared/create_file.c \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c deleted file mode 100644 index df1fcdb..0000000 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "shared.h" - -int random_seed; -int simulate_power_failure = 0; - -int main(int argc, char *argv[] ){ - return shared_validate_file(argc, argv); -} diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c new file mode 120000 index 0000000..c08acf3 --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/64_bit/validate_64_bit.c @@ -0,0 +1 @@ +../shared/validate_file.c \ No newline at end of file diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/shared/create_file.c b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/create_file.c new file mode 100644 index 0000000..85c29bd --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/create_file.c @@ -0,0 +1,10 @@ +#include "shared.h" + +int random_seed; +int simulate_power_failure = 0; + +int main(int argc, char *argv[] ){ + int ret = shared_create(argc, argv); + ret = ret && shared_validate_file(argc, argv); + return ret; +} diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c index 0e0dd8b..31672f2 100644 --- a/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/shared.c @@ -21,7 +21,12 @@ void setup_yaffs() { int shared_create(int argc, char *argv[]){ - + printf("YTIME_T size is %lu bits\n", sizeof(YTIME_T) *8); + #ifdef CONFIG_YAFFS_USE_32_BIT_TIME_T + if (sizeof(YTIME_T)*8 != 32) { + printf("YTIME_T size is incorrect. it is %lu and should be 32\n", sizeof(YTIME_T)); + } + #endif if (argc != 3) { printf("wrong number of arguments\n"); printf("requires $ create file_name time\n"); @@ -45,7 +50,7 @@ int shared_create(int argc, char *argv[]){ assert_exit_yaffs("yaffs_utime", ret); assert_exit_yaffs("yaffs_unmount", yaffs_unmount(YAFFS_MOUNT_POINT)); - return TEST_FAIL; + return 0; } int shared_validate_file(int argc, char *argv[]){ @@ -71,5 +76,5 @@ int shared_validate_file(int argc, char *argv[]){ exit(0); } assert_exit_yaffs("yaffs_unmount", yaffs_unmount(YAFFS_MOUNT_POINT)); - return TEST_FAIL; + return 0; } diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/shared/validate_file.c b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/validate_file.c new file mode 100644 index 0000000..df1fcdb --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/shared/validate_file.c @@ -0,0 +1,8 @@ +#include "shared.h" + +int random_seed; +int simulate_power_failure = 0; + +int main(int argc, char *argv[] ){ + return shared_validate_file(argc, argv); +} diff --git a/direct/test-framework/unit_tests/64_and_32_bit_time/time_test_runner.sh b/direct/test-framework/unit_tests/64_and_32_bit_time/time_test_runner.sh new file mode 100755 index 0000000..74d1cec --- /dev/null +++ b/direct/test-framework/unit_tests/64_and_32_bit_time/time_test_runner.sh @@ -0,0 +1,14 @@ +make -C 32_bit/ && make -C 64_bit/ && + rm emfile-* && + ./32_bit/create_32_bit /yflash2/foo 100 && + echo created 32 bit file && + ./64_bit/validate_64_bit /yflash2/foo 100 && + echo 32 bit file opened with 64 bit mode correctly + + rm emfile-* && + ./64_bit/create_64_bit /yflash2/foo 100 && + echo created 64 bit file && + ./32_bit/validate_32_bit /yflash2/foo 100 && + echo 64 bit file opened with 32 bit mode correctly && + + echo All tests ran properly -- 2.30.2 From 5cbf74097b08507fe33bb09cef346237d8199374 Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Fri, 9 Dec 2022 10:25:20 +1300 Subject: [PATCH 15/16] Add test for reldev functions Used to test we don't get NULL dereferences and as a test case for the next commit. Signed-off-by: Charles Manning --- direct/test-framework/basic-tests/Makefile | 10 +- .../test-framework/basic-tests/reldevtest.c | 95 +++++++++++++++++++ 2 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 direct/test-framework/basic-tests/reldevtest.c diff --git a/direct/test-framework/basic-tests/Makefile b/direct/test-framework/basic-tests/Makefile index 3535381..7d219ef 100644 --- a/direct/test-framework/basic-tests/Makefile +++ b/direct/test-framework/basic-tests/Makefile @@ -21,16 +21,20 @@ YDI_DIR = ../../ YDI_FRAMEWORK_DIR = ../ -TARGETS = directtest2k +TARGETS = directtest2k reldevtest all: $(TARGETS) DIRECTTESTOBJS = $(COMMONTESTOBJS) dtest.o +RELDEVOBJS = $(COMMONTESTOBJS) reldevtest.o -ALL_UNSORTED_OBJS += $(DIRECTTESTOBJS) +ALL_UNSORTED_OBJS += $(DIRECTTESTOBJS) $(RELDEVOBJS) include ../FrameworkRules.mk -directtest2k: $(FRAMEWORK_SOURCES) $(DIRECTTESTOBJS) +directtest2k: $(FRAMEWORK_SOURCES) $(DIRECTTESTOBJS) Makefile gcc -o $@ $(DIRECTTESTOBJS) -lpthread +reldevtest: $(FRAMEWORK_SOURCES) $(RELDEVOBJS) Makefile + gcc -o $@ $(RELDEVOBJS) -lpthread + diff --git a/direct/test-framework/basic-tests/reldevtest.c b/direct/test-framework/basic-tests/reldevtest.c new file mode 100644 index 0000000..0661be6 --- /dev/null +++ b/direct/test-framework/basic-tests/reldevtest.c @@ -0,0 +1,95 @@ +/* + * YAFFS: Yet another FFS. A NAND-flash specific file system. + * + * Copyright (C) 2002-2018 Aleph One Ltd. + * + * Created by Charles Manning + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + + +#include +#include +#include +#include +#include +#include + + +#include "yaffsfs.h" + +#include "yaffs_guts.h" /* Only for dumping device innards */ +#include "yaffs_endian.h" /*For testing the swap_u64 macro */ + +extern int yaffs_trace_mask; + + + +int call_all_reldev(struct yaffs_dev *dev) +{ + struct yaffs_stat buf; + struct yaffs_utimbuf utime; + unsigned char xbuffer[20]; + char cbuffer[20]; + + yaffs_mount_reldev(dev); + yaffs_open_sharing_reldev(dev, "foo", 0, 0, 0); + yaffs_open_reldev(dev, "foo", 0, 0); + yaffs_truncate_reldev(dev, "foo", 99); + yaffs_unlink_reldev(dev, "foo"); + yaffs_rename_reldev(dev, "foo", "foo_new"); + yaffs_stat_reldev(dev, "foo", &buf); + yaffs_lstat_reldev(dev, "foo", &buf); + yaffs_utime_reldev(dev, "foo", &utime); + yaffs_setxattr_reldev(dev, "foo", "name", xbuffer, 20, 0); + yaffs_lsetxattr_reldev(dev, "foo", "name", xbuffer, 20, 0); + yaffs_getxattr_reldev(dev, "foo", "name", xbuffer, 20); + yaffs_lgetxattr_reldev(dev, "foo", "name", xbuffer, 20); + + yaffs_listxattr_reldev(dev, "foo", cbuffer, 20); + yaffs_llistxattr_reldev(dev, "foo", cbuffer, 20); + yaffs_removexattr_reldev(dev, "foo", "name"); + yaffs_lremovexattr_reldev(dev, "foo", "name"); + + yaffs_access_reldev(dev, "foo", 0); + yaffs_chmod_reldev(dev, "foo", 0); + yaffs_mkdir_reldev(dev, "foo", 0); + yaffs_rmdir_reldev(dev, "foo"); + + + yaffs_opendir_reldev(dev, "foo"); + + //yaffs_symlink_reldev(dev, "foo", "foolink"); + //yaffs_readlink_reldev(dev, "foo", cbuffer, 20); + //yaffs_link_reldev(dev, "foo", "foo_new"); + + yaffs_mknod_reldev(dev, "foo", 0, 0); + yaffs_freespace_reldev(dev); + yaffs_totalspace_reldev(dev); + + yaffs_sync_reldev(dev); + yaffs_sync_files_reldev(dev); + + yaffs_unmount_reldev(dev); + yaffs_unmount2_reldev(dev, 1); + yaffs_remount_reldev(dev, 1, 1); + + return 0; +} + + +int random_seed; +int simulate_power_failure; + +int main(int argc, char *argv[]) +{ + (void) argc; + (void) argv; + + call_all_reldev(NULL); + + return 0; +} -- 2.30.2 From 613a901a229e8a701c18f003dd0aee18453e0670 Mon Sep 17 00:00:00 2001 From: Charles Manning Date: Fri, 9 Dec 2022 10:27:12 +1300 Subject: [PATCH 16/16] yaffsfs.c: Fix NULL dereference in yaffs_unmount2_reldev() Signed-off-by: Charles Manning --- direct/yaffsfs.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index 2c1ac42..823f7ed 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -3110,14 +3110,17 @@ int yaffs_unmount2_common(struct yaffs_dev *dev, const YCHAR *path, int force) { int retVal = -1; - if (yaffsfs_CheckMemRegion(path, 0, 0) < 0) { - yaffsfs_SetError(-EFAULT); - return -1; - } - if (yaffsfs_CheckPath(path) < 0) { - yaffsfs_SetError(-ENAMETOOLONG); - return -1; + if (!dev) { + if (yaffsfs_CheckMemRegion(path, 0, 0) < 0) { + yaffsfs_SetError(-EFAULT); + return -1; + } + + if (yaffsfs_CheckPath(path) < 0) { + yaffsfs_SetError(-ENAMETOOLONG); + return -1; + } } yaffsfs_Lock(); -- 2.30.2