Have updated yaffs direct tests and added README files to the tests.
authorTimothy Manning <tfhmanning@gmail.com>
Fri, 16 Dec 2011 00:28:52 +0000 (13:28 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Fri, 16 Dec 2011 00:28:52 +0000 (13:28 +1300)
Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
44 files changed:
direct/timothy_tests/handle_tests/Makefile
direct/timothy_tests/handle_tests/README.txt [new file with mode: 0644]
direct/timothy_tests/is_yaffs_working_tests/Makefile [new file with mode: 0644]
direct/timothy_tests/is_yaffs_working_tests/README.txt [new file with mode: 0644]
direct/timothy_tests/is_yaffs_working_tests/test_1_yaffs_mount.c [new file with mode: 0644]
direct/timothy_tests/linux_tests/Makefile
direct/timothy_tests/linux_tests/README.txt
direct/timothy_tests/linux_tests/linux_test.c
direct/timothy_tests/mirror_tests/current_bugs.txt [deleted file]
direct/timothy_tests/quick_tests/Makefile
direct/timothy_tests/quick_tests/README.txt
direct/timothy_tests/quick_tests/current_bugs.txt [deleted file]
direct/timothy_tests/stress_tester/Makefile [moved from direct/timothy_tests/dev/Makefile with 96% similarity]
direct/timothy_tests/stress_tester/README.txt [new file with mode: 0644]
direct/timothy_tests/stress_tester/error_handler.c [moved from direct/timothy_tests/dev/error_handler.c with 100% similarity]
direct/timothy_tests/stress_tester/error_handler.h [moved from direct/timothy_tests/dev/error_handler.h with 100% similarity]
direct/timothy_tests/stress_tester/message_buffer.c [moved from direct/timothy_tests/dev/message_buffer.c with 100% similarity]
direct/timothy_tests/stress_tester/message_buffer.h [moved from direct/timothy_tests/dev/message_buffer.h with 100% similarity]
direct/timothy_tests/stress_tester/yaffs_tester.c [moved from direct/timothy_tests/dev/yaffs_tester.c with 96% similarity]
direct/timothy_tests/stress_tester/yaffs_tester.h [moved from direct/timothy_tests/dev/yaffs_tester.h with 97% similarity]
direct/timothy_tests/threading/Makefile
direct/timothy_tests/threading/README.txt [new file with mode: 0644]
direct/timothy_tests/yaffs_and_linux_mirror_tests/Makefile [moved from direct/timothy_tests/mirror_tests/Makefile with 96% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/README.txt [moved from direct/timothy_tests/mirror_tests/README.txt with 51% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/lib.c [moved from direct/timothy_tests/mirror_tests/lib.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/lib.h [moved from direct/timothy_tests/mirror_tests/lib.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_open.c [moved from direct/timothy_tests/mirror_tests/linux_test_open.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_open.h [moved from direct/timothy_tests/mirror_tests/linux_test_open.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_truncate.c [moved from direct/timothy_tests/mirror_tests/linux_test_truncate.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_truncate.h [moved from direct/timothy_tests/mirror_tests/linux_test_truncate.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_unlink.c [moved from direct/timothy_tests/mirror_tests/linux_test_unlink.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_unlink.h [moved from direct/timothy_tests/mirror_tests/linux_test_unlink.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_write.c [moved from direct/timothy_tests/mirror_tests/linux_test_write.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/linux_test_write.h [moved from direct/timothy_tests/mirror_tests/linux_test_write.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/mirror_tests.c [moved from direct/timothy_tests/mirror_tests/mirror_tests.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/mirror_tests.h [moved from direct/timothy_tests/mirror_tests/mirror_tests.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_open.c [moved from direct/timothy_tests/mirror_tests/yaffs_test_open.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_open.h [moved from direct/timothy_tests/mirror_tests/yaffs_test_open.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_truncate.c [moved from direct/timothy_tests/mirror_tests/yaffs_test_truncate.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_truncate.h [moved from direct/timothy_tests/mirror_tests/yaffs_test_truncate.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_unlink.c [moved from direct/timothy_tests/mirror_tests/yaffs_test_unlink.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_unlink.h [moved from direct/timothy_tests/mirror_tests/yaffs_test_unlink.h with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_write.c [moved from direct/timothy_tests/mirror_tests/yaffs_test_write.c with 100% similarity]
direct/timothy_tests/yaffs_and_linux_mirror_tests/yaffs_test_write.h [moved from direct/timothy_tests/mirror_tests/yaffs_test_write.h with 100% similarity]

index 8ca9c1d..a2e9a5e 100644 (file)
@@ -42,7 +42,8 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
                 yaffs_yaffs1.o \
                 yaffs_yaffs2.o \
                 yaffs_verify.o \
-                yaffs_error.o
+                yaffs_error.o  \
+                yaffs_summary.o
 
 #               yaffs_checkptrwtest.o\
 
@@ -66,7 +67,8 @@ YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscomp
           yaffs_yaffs1.c yaffs_yaffs1.h \
           yaffs_yaffs2.c yaffs_yaffs2.h \
           yaffs_bitmap.c yaffs_bitmap.h \
-          yaffs_verify.c yaffs_verify.h
+          yaffs_verify.c yaffs_verify.h \
+                 yaffs_summary.c yaffs_summary.h
 
 YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffsfs.h ydirectenv.h \
diff --git a/direct/timothy_tests/handle_tests/README.txt b/direct/timothy_tests/handle_tests/README.txt
new file mode 100644 (file)
index 0000000..bce7a6c
--- /dev/null
@@ -0,0 +1,7 @@
+handle_tests.c opens and closes random handles, in an effot to stress test yaffs.
+
+Command line options:
+       No commands.
+
+compile command: make
+run command: ./handle_test
diff --git a/direct/timothy_tests/is_yaffs_working_tests/Makefile b/direct/timothy_tests/is_yaffs_working_tests/Makefile
new file mode 100644 (file)
index 0000000..8cc1f44
--- /dev/null
@@ -0,0 +1,115 @@
+# Makefile for YAFFS direct stress tests
+#
+#
+# YAFFS: Yet another Flash File System. A NAND-flash specific file system.
+#
+# Copyright (C) 2003-2010 Aleph One Ltd.
+#
+#
+# Created by Charles Manning <charles@aleph1.co.uk>
+#
+# 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.
+#
+# NB Warning this Makefile does not include header dependencies.
+#
+# $Id: Makefile,v 1.7 2010-02-25 22:34:47 charles Exp $
+
+#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC
+
+CFLAGS =      -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_YAFFS2  
+CFLAGS +=     -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES
+CFLAGS +=    -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing 
+#CFLAGS +=    -fno-strict-aliasing
+CFLAGS +=    -O0
+CFLAGS +=    -Wextra -Wpointer-arith
+#CFLAGS +=    -DCONFIG_YAFFS_VALGRIND_TEST
+
+#CFLAGS+=   -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations
+#CFLAGS+=   -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline
+
+
+COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
+                yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
+                yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
+                yaffs_tagscompat.o yaffs_packedtags2.o yaffs_nand.o \
+                yaffs_checkptrw.o  yaffs_qsort.o\
+                yaffs_nameval.o yaffs_attribs.o \
+                yaffs_norif1.o  ynorsim.o  \
+                yaffs_allocator.o \
+                yaffs_bitmap.o \
+                yaffs_yaffs1.o \
+                yaffs_yaffs2.o \
+                yaffs_verify.o \
+                yaffs_error.o  \
+                yaffs_summary.o
+
+#               yaffs_checkptrwtest.o\
+
+TESTFILES =    test_1_yaffs_mount.o 
+
+
+                 
+
+YAFFSTESTOBJS  = $(COMMONTESTOBJS) $(TESTFILES)
+
+
+ALLOBJS = $(sort $(YAFFSTESTOBJS)) $(PYTHONOBJS)
+
+YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscompat.c yaffs_tagscompat.h \
+          yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
+          yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
+          yaffs_checkptrw.h yaffs_checkptrw.c \
+          yaffs_nameval.c yaffs_nameval.h \
+          yaffs_trace.h yaffs_attribs.h \
+          yaffs_allocator.c yaffs_allocator.h \
+          yaffs_yaffs1.c yaffs_yaffs1.h \
+          yaffs_yaffs2.c yaffs_yaffs2.h \
+          yaffs_bitmap.c yaffs_bitmap.h \
+          yaffs_verify.c yaffs_verify.h \
+                 yaffs_summary.c yaffs_summary.h
+
+YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
+                      yaffsfs.h ydirectenv.h \
+                      yaffs_flashif.c yaffscfg.h yaffs_qsort.c \
+                      yaffs_nandemul2k.h yaffs_list.h \
+                      yaffs_attribs.c yaffs_osglue.h \
+                      yaffs_nandif.c yaffs_nandif.h yportenv.h \
+                      yaffs_hweight.h yaffs_hweight.c \
+                      yaffs_error.c
+
+
+DIRECTEXTRASYMLINKS =  yaffscfg2k.c yaffs_fileem2k.c yaffs_fileem2k.h\
+                       yaffs_fileem.c yaffs_norif1.c yaffs_norif1.h \
+                       yaffs_ramdisk.c yaffs_ramdisk.h yaffs_ramem2k.c \
+                       ynorsim.h ynorsim.c yaffs_osglue.c
+
+SYMLINKS = $(YAFFSSYMLINKS) $(YAFFSDIRECTSYMLINKS) $(DIRECTEXTRASYMLINKS) $(PYTONOSYMLINKS)
+#all: directtest2k boottest
+
+all: test_1_yaffs_mount
+
+$(ALLOBJS): %.o: %.c
+       gcc -c $(CFLAGS) -o $@ $<
+
+$(PYTONOSYMLINKS):
+       ln -s ../../python/$@ $@
+
+$(YAFFSSYMLINKS):
+       ln -s ../../../$@ $@
+
+$(YAFFSDIRECTSYMLINKS):
+       ln -s ../../$@ $@
+
+$(DIRECTEXTRASYMLINKS):
+       ln -s ../../basic-test/$@ $@
+
+
+test_1_yaffs_mount: $(SYMLINKS) $(ALLOBJS)
+       gcc $(CFLLAG) -o $@ $(ALLOBJS)
+
+
+
+clean:
+       rm -f test_1_yaffs_mount  $(ALLOBJS) core $(SYMLINKS) 
diff --git a/direct/timothy_tests/is_yaffs_working_tests/README.txt b/direct/timothy_tests/is_yaffs_working_tests/README.txt
new file mode 100644 (file)
index 0000000..0cdddbd
--- /dev/null
@@ -0,0 +1,11 @@
+is_yaffs_working_tests folder contains the very simple tests to check that yaffs has been installed properly.
+
+test_1_yaffs_mount.c mounts yaffs, creates a file, unmounts and then mounts yaffs and checks that the file is still there. 
+
+
+
+compile command: make
+run command: ./test_1_yaffs_mount
+
+command line options:
+       No commands.
diff --git a/direct/timothy_tests/is_yaffs_working_tests/test_1_yaffs_mount.c b/direct/timothy_tests/is_yaffs_working_tests/test_1_yaffs_mount.c
new file mode 100644 (file)
index 0000000..b7726ba
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2011 Aleph One Ltd.
+ *   for Toby Churchill Ltd and Brightstar Engineering
+ *
+ * Created by Timothy Manning <timothy@yaffs.net>
+ *
+ * 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 "yaffsfs.h"
+#define YAFFS_MOUNT_POINT "/yaffs2/"
+#define FILE_PATH "/yaffs2/foo.txt"
+
+int random_seed;
+int simulate_power_failure = 0;
+
+
+int main()
+{
+       int output = 0;
+       int output2 = 0;
+       yaffs_start_up();
+
+       printf("\n\n starting test\n");
+       yaffs_set_trace(0);
+       output = yaffs_mount(YAFFS_MOUNT_POINT);
+
+       if (output>=0){  
+               printf("yaffs mounted: %s\n",YAFFS_MOUNT_POINT); 
+       } else {
+               printf("error\n yaffs failed to mount: %s\nerror\n",YAFFS_MOUNT_POINT);
+               return (0);
+       }
+       //now create a file.
+       output = yaffs_open(FILE_PATH,O_CREAT | O_RDWR, S_IREAD | S_IWRITE);
+       if (output>=0){  
+               printf("file created: %s\n",FILE_PATH); 
+       } else {
+               printf("error\n yaffs failed to create the file: %s\nerror\n",FILE_PATH);
+               return (0);
+       }
+       output2 = yaffs_close(output);
+       if (output2>=0){  
+               printf("file closed: %s\n",FILE_PATH); 
+       } else {
+               printf("error\n yaffs failed to close the file: %s\nerror\n",FILE_PATH);
+               return (0);
+       }
+       //unmount and remount the mount point.
+       output = yaffs_unmount(YAFFS_MOUNT_POINT);
+       if (output>=0){  
+               printf("yaffs unmounted: %s\n",YAFFS_MOUNT_POINT); 
+       } else {
+               printf("error\n yaffs failed to unmount: %s\nerror\n",YAFFS_MOUNT_POINT);
+               return (0);
+       }
+       output = yaffs_mount(YAFFS_MOUNT_POINT);
+       if (output>=0){  
+               printf("yaffs mounted: %s\n",YAFFS_MOUNT_POINT); 
+       } else {
+               printf("error\n yaffs failed to mount: %s\nerror\n",YAFFS_MOUNT_POINT);
+               return (0);
+       }
+       //now open the existing file.
+       output = yaffs_open(FILE_PATH, O_RDWR, S_IREAD | S_IWRITE);
+       if (output>=0){  
+               printf("file created: %s\n",FILE_PATH); 
+       } else {
+               printf("error\n yaffs failed to create the file: %s\nerror\n",FILE_PATH);
+               return (0);
+       }
+       //close the file.
+       output2 = yaffs_close(output);
+       if (output2>=0){  
+               printf("file closed: %s\n",FILE_PATH); 
+       } else {
+               printf("error\n yaffs failed to close the file: %s\nerror\n",FILE_PATH);
+               return (0);
+       }
+
+       //unmount the mount point.
+       output = yaffs_unmount(YAFFS_MOUNT_POINT);
+       if (output>=0){  
+               printf("yaffs unmounted: %s\n",YAFFS_MOUNT_POINT); 
+       } else {
+               printf("error\n yaffs failed to unmount: %s\nerror\n",YAFFS_MOUNT_POINT);
+               return (0);
+       }
+
+       printf("test passed. yay!\n");
+       
+}
index 6910788..c80ef4d 100644 (file)
@@ -33,8 +33,8 @@ CFLAGS +=    -Wextra -Wpointer-arith
 COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
                 yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
                 yaffs_packedtags1.o yaffs_ramdisk.o yaffs_ramem2k.o \
-                yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o yaffs_nand.o \
-                yaffs_checkptrw.o  yaffs_qsort.o\
+                yaffs_tagscompat.o yaffs_packedtags2.o  yaffs_nand.o \
+                yaffs_checkptrw.o  yaffs_qsort.o \
                 yaffs_nameval.o yaffs_attribs.o \
                 yaffs_norif1.o  ynorsim.o  \
                 yaffs_allocator.o \
@@ -42,8 +42,9 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
                 yaffs_yaffs1.o \
                 yaffs_yaffs2.o \
                 yaffs_verify.o \
-                yaffs_error.o
-
+                yaffs_error.o  \
+                yaffs_summary.o
+#              yaffs_tagsvalidity.o
 #               yaffs_checkptrwtest.o\
 
 TESTFILES =    linux_test.o lib.o
@@ -59,14 +60,16 @@ ALLOBJS = $(sort $(YAFFSTESTOBJS)) $(PYTHONOBJS)
 YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscompat.c yaffs_tagscompat.h \
           yaffs_packedtags1.c yaffs_packedtags1.h yaffs_packedtags2.c yaffs_packedtags2.h \
           yaffs_nand.c yaffs_nand.h yaffs_getblockinfo.h \
-          yaffs_tagsvalidity.c yaffs_tagsvalidity.h yaffs_checkptrw.h yaffs_checkptrw.c \
+           yaffs_checkptrw.h yaffs_checkptrw.c \
           yaffs_nameval.c yaffs_nameval.h \
           yaffs_trace.h yaffs_attribs.h \
           yaffs_allocator.c yaffs_allocator.h \
           yaffs_yaffs1.c yaffs_yaffs1.h \
           yaffs_yaffs2.c yaffs_yaffs2.h \
           yaffs_bitmap.c yaffs_bitmap.h \
-          yaffs_verify.c yaffs_verify.h
+          yaffs_verify.c yaffs_verify.h \
+          yaffs_summary.c yaffs_summary.h
+#yaffs_tagsvalidity.c yaffs_tagsvalidity.h
 
 YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffsfs.h ydirectenv.h \
index 0c3fa84..be8b831 100644 (file)
@@ -1,11 +1,17 @@
 
+linux_test.c tests yaffs running under linux using the nandsim generator.  
+
+
+If a segmentation fault happens during the test then check that 
+the nandsim has been initilised properly. 
+
 How to initilise the nandsim
 
 $ make
 
 $ sudo -s
 ...password..
-# now have a root shell
+# now you have a root shell
 $ ./linux-tests/initnandsim 128MiB-2048
 $ insmod yaffs2multi.ko
 $ mkdir /mnt/y
@@ -24,7 +30,19 @@ How to clean the folder
 $ rm -rf /mnt/y
 
 
-The test must be run in sudo to work
+The test must be run in sudo to work to allow the files to be 
+created in the root folders.
 
-$ make
-$ sudo ./linux_test
+compile command: make
+run command: sudo ./linux_test
+
+command line options:
+       -h                      display the command line options.
+       -s [number]     seeds the rand with the number.
+       -p [number]     sets the print level to the number. 
+                               the higher the number the more low level commands are printed.
+                               the number should be between 0 and 5.
+       -v                      verbose mode. everything is printed.
+       -q                      quite mode. nothing is printed.
+
index 429e74f..e450236 100644 (file)
@@ -149,6 +149,10 @@ dir_struct * scan_dir(void)
 
 
        open_dir=opendir(ROOT_PATH);
+       if (open_dir < 0){
+               sprintf(message,"failed to find the directory: %s",ROOT_PATH);
+               print_message(1,message);
+       }
        dir_data=readdir(open_dir);
        while(dir_data){
                dir->path_list=linked_list_add_node(HEAD,dir->path_list);
diff --git a/direct/timothy_tests/mirror_tests/current_bugs.txt b/direct/timothy_tests/mirror_tests/current_bugs.txt
deleted file mode 100644 (file)
index 8e3251a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-BUGS
-       NO Bugs.
-
-
index ef339c5..49ecd7a 100644 (file)
@@ -42,8 +42,8 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
                 yaffs_yaffs1.o \
                 yaffs_yaffs2.o \
                 yaffs_verify.o \
-                yaffs_error.o
-
+                yaffs_error.o \
+                yaffs_summary.o
 #               yaffs_checkptrwtest.o\
 
 TESTFILES =    quick_tests.o lib.o \
@@ -108,7 +108,8 @@ TESTFILES =         quick_tests.o lib.o \
                test_yaffs_lstat.o test_yaffs_lstat_ENOENT.o test_yaffs_lstat_ENOTDIR.o test_yaffs_lstat_ENAMETOOLONG.o \
                test_yaffs_lstat_NULL.o \
                test_yaffs_flush.o test_yaffs_flush_EBADF.o test_yaffs_flush_EROFS.o \
-               test_yaffs_dup.o test_yaffs_dup_EBADF.o
+               test_yaffs_dup.o test_yaffs_dup_EBADF.o 
+
 
 
                  
@@ -127,7 +128,8 @@ YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscomp
           yaffs_yaffs1.c yaffs_yaffs1.h \
           yaffs_yaffs2.c yaffs_yaffs2.h \
           yaffs_bitmap.c yaffs_bitmap.h \
-          yaffs_verify.c yaffs_verify.h
+          yaffs_verify.c yaffs_verify.h \
+          yaffs_summary.c yaffs_summary.h
 
 YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffsfs.h ydirectenv.h \
index 1744392..55b670e 100644 (file)
@@ -1,6 +1,20 @@
-
 Made by Timothy Manning <timothy@yaffs.net> on 04/11/2010
 
+This test is designed to test the response and error handling of the yaffs functions.
+
+compile command: make
+run command: ./quick_tests
+
+command line options:
+       -h                              prints the available command line options.
+       -c                              tests will continue even if a test fails, rather than exiting the test.
+       -v                              verbose mode. will print all messages.
+       -q                              quiet mode. will not print any messages.
+       -t [number]             sets the yaffs_trace() function to the number.
+       -n [number]             sets the number of randomly selected tests to run after the test has run through 
+                                       after running all of listed tests.
+
+############################# development infomation ####################################################################
 
 Tests made
 
diff --git a/direct/timothy_tests/quick_tests/current_bugs.txt b/direct/timothy_tests/quick_tests/current_bugs.txt
deleted file mode 100644 (file)
index a8a88c4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-
-Made by Timothy Manning <timothy@yaffs.net> on 08/11/2010
-
-
-Current BUGS 
-
-
-Current WARNINGS
-       
-       WARNING- If yaffs is unmounted then most of yaffs' functions return ENODIR. 
-       But some function return EBADF instead.
-       Functions which return ENOTDIR: open, close, access, unlink, lseek, write, read
-
-       Functions which return ENOENT: access, stat
-       
-
-
-       WARNING-the function yaffs_open does not check the mode passed to it. 
-       This means that yaffs open does not return EINVAL if a bad mode is passed to it.
-       However this causes the error EEXIST to happen instead, because both O_CREAT and O_EXCL  flags are set.
-
-       WARNING- yaffs_open will work with either of the two mode set to 255.
-       However there are only 4 or 5 flags that can be set for each of the modes.
-       This means that the programmer may not be setting the flags properly.  
-
-       WARNING- When mounting a non-existing mount point the error ENODEV is returned.
-       The quick tests have been altered to accommodate this error code.    
-       With standard access function in linux the error returned is ENOENT.
similarity index 96%
rename from direct/timothy_tests/dev/Makefile
rename to direct/timothy_tests/stress_tester/Makefile
index 6e774ab..b6d8cf8 100644 (file)
@@ -40,7 +40,8 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o\
                 yaffs_bitmap.o \
                 yaffs_yaffs1.o \
                 yaffs_yaffs2.o \
-                yaffs_verify.o
+                yaffs_verify.o \
+                yaffs_summary.o
 
 
 SSCOMMONTESTOBJS = yaffscfg2k.o yaffs_ecc.o yaffs_fileem.o yaffs_fileem2k.o yaffsfs.o yaffs_guts.o \
@@ -73,7 +74,8 @@ YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscomp
           yaffs_yaffs1.c yaffs_yaffs1.h \
           yaffs_yaffs2.c yaffs_yaffs2.h \
           yaffs_bitmap.c yaffs_bitmap.h \
-          yaffs_verify.c yaffs_verify.h
+          yaffs_verify.c yaffs_verify.h \
+                 yaffs_summary.c yaffs_summary.h
 
 YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffsfs.h yaffs_osglue.h ydirectenv.h \
diff --git a/direct/timothy_tests/stress_tester/README.txt b/direct/timothy_tests/stress_tester/README.txt
new file mode 100644 (file)
index 0000000..364d975
--- /dev/null
@@ -0,0 +1,8 @@
+The stress_tester program opens and closes files at random in an effort to break yaffs.
+
+compile command: make
+run command: ./yaffs_tester
+
+command line options:
+       -seed [number]          sets the random seed generator to the number.
+  
similarity index 96%
rename from direct/timothy_tests/dev/yaffs_tester.c
rename to direct/timothy_tests/stress_tester/yaffs_tester.c
index 65d2d17..86dcf46 100644 (file)
@@ -171,7 +171,7 @@ void open_random_file(char *yaffs_test_dir, handle_regster *P_open_handles_array
        {
                generate_random_string(name,MAX_FILE_NAME_SIZE);
                printf("before %d %d %d\n",strlen(yaffs_test_dir),strlen(name),strlen(path));
-               join_paths(yaffs_test_dir,name,path);//bug###################### here
+               join_paths(yaffs_test_dir,name,path);
                printf("after %d %d %d\n",strlen(yaffs_test_dir),strlen(name),strlen(path));
                add_to_buffer(&message_buffer,"trying to open file: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT);
                append_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT);
@@ -202,7 +202,7 @@ void open_random_file(char *yaffs_test_dir, handle_regster *P_open_handles_array
                
                P_open_handles_array->number_of_open_handles++; 
        }
-       else close_random_file(P_open_handles_array);
+       else  close_random_file(P_open_handles_array);
  
 }
 
@@ -271,11 +271,17 @@ void close_random_file(handle_regster *P_open_handles_array){
        int x=0;
        int output=0;
        int start=0;
+       printf("trying to clear handle");
        if (P_open_handles_array->number_of_open_handles>0){
                start=rand() % (MAX_NUMBER_OF_OPENED_HANDLES-1);
-               for (x=start;P_open_handles_array->handle[x] !=-3 &&(x+1>start ||x<start);){
+
+               for (x=start;(x+1>start ||x<start);){
                        x++;                    
-                       if (x>MAX_NUMBER_OF_OPENED_HANDLES-1) x=0;              
+                       if (x>MAX_NUMBER_OF_OPENED_HANDLES-1) x=0;
+                       if (P_open_handles_array->handle[x] !=-3 ){
+                               //the handle is open, so try to close it.
+                               break;
+                       }
 
                }
                if (P_open_handles_array->handle[x]!=-3)
@@ -341,14 +347,17 @@ void test(char*yaffs_test_dir){
                open_handles_array.path[x][0]='\0';
 
        }
+
        while(1)
        {
+
                x=rand() % 3;
+               printf("running test: %d",x);
                switch(x){
                        case 0 :open_random_file(yaffs_test_dir,&open_handles_array);break;
-                       //case 1 :write_to_random_file(&open_handles_array);break;
-                       case 2 :close_random_file(&open_handles_array);break;
-                       case 3 :truncate_random_file(&open_handles_array);break;
+                       case 3 :write_to_random_file(&open_handles_array);break;
+//                     case 1 :close_random_file(&open_handles_array);break;
+                       case 2 :truncate_random_file(&open_handles_array);break;
                }
        }
 }
similarity index 97%
rename from direct/timothy_tests/dev/yaffs_tester.h
rename to direct/timothy_tests/stress_tester/yaffs_tester.h
index a703175..11a0815 100644 (file)
@@ -25,7 +25,7 @@
 #include "message_buffer.h"
 #include "error_handler.h"
        
-#define MAX_NUMBER_OF_OPENED_HANDLES 50
+#define MAX_NUMBER_OF_OPENED_HANDLES 70
 #define MAX_FILE_NAME_SIZE 51
 
 typedef struct handle_regster_template{
index e733471..cb3c1e4 100644 (file)
@@ -42,7 +42,8 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
                 yaffs_yaffs1.o \
                 yaffs_yaffs2.o \
                 yaffs_verify.o \
-                yaffs_error.o
+                yaffs_error.o  \
+                yaffs_summary.o
 
 #               yaffs_checkptrwtest.o\
 
@@ -65,7 +66,8 @@ YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscomp
           yaffs_yaffs1.c yaffs_yaffs1.h \
           yaffs_yaffs2.c yaffs_yaffs2.h \
           yaffs_bitmap.c yaffs_bitmap.h \
-          yaffs_verify.c yaffs_verify.h
+          yaffs_verify.c yaffs_verify.h \
+                 yaffs_summary.c yaffs_summary.h
 
 YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffsfs.h ydirectenv.h \
diff --git a/direct/timothy_tests/threading/README.txt b/direct/timothy_tests/threading/README.txt
new file mode 100644 (file)
index 0000000..68c1a61
--- /dev/null
@@ -0,0 +1,12 @@
+Created by Timothy Manning <timothy@yaffs.net> on 7/01/11
+
+This test is designed to test the locking ability of yaffs functions.
+
+compile command: make
+run command: ./threading
+
+
+command line arguments are:
+       -h   displays the help contents
+       -t   sets the number of threads 
+
@@ -42,7 +42,8 @@ COMMONTESTOBJS = yaffscfg2k.o yaffs_osglue.o yaffs_hweight.o \
                 yaffs_yaffs1.o \
                 yaffs_yaffs2.o \
                 yaffs_verify.o \
-                yaffs_error.o
+                yaffs_error.o  \
+                yaffs_summary.o
 
 #               yaffs_checkptrwtest.o\
 
@@ -70,7 +71,8 @@ YAFFSSYMLINKS = yaffs_ecc.c yaffs_ecc.h yaffs_guts.c yaffs_guts.h yaffs_tagscomp
           yaffs_yaffs1.c yaffs_yaffs1.h \
           yaffs_yaffs2.c yaffs_yaffs2.h \
           yaffs_bitmap.c yaffs_bitmap.h \
-          yaffs_verify.c yaffs_verify.h
+          yaffs_verify.c yaffs_verify.h \
+          yaffs_summary.c yaffs_summary.h
 
 YAFFSDIRECTSYMLINKS =  yaffsfs.c yaffs_flashif.h yaffs_flashif2.h\
                       yaffsfs.h ydirectenv.h \
@@ -1,4 +1,4 @@
-Made by Timothy Manning on 24/12/10 <timothy@yaffs.net>
+Made by Timothy Manning on 24/12/2010 <timothy@yaffs.net>
 
 
        mirror_tests is designed to check that yaffs behaves the same way as linux.
@@ -11,14 +11,17 @@ Made by Timothy Manning on 24/12/10 <timothy@yaffs.net>
 
        rm test/*;rmdir test/;./mirror_tests -n 100 -v
 
+compile command: make
+run command: mirror_tests
+
 Command line arguments
-       -yaffs_path [PATH] //sets the path for yaffs.
-       -linux_path [PATH] //sets the path for linux.
-       -p [NUMBER] //sets the print level for mirror_tests.
-       -v //verbose mode everything is printed
-       -q //quiet mode nothing is printed.
-       -n [number] //sets the number of random tests to run.
-       -s [number] //seeds rand with the number
-       -t [number] //sets yaffs_trace to the number
-       -clean //removes emfile and test dir
+       -yaffs_path [PATH]              sets the path for yaffs.
+       -linux_path [PATH]              sets the path for linux.
+       -p [NUMBER]                     sets the print level for mirror_tests.
+       -v                                              verbose mode everything is printed
+       -q                                              quiet mode nothing is printed.
+       -n [number]                     sets the number of random tests to run.
+       -s [number]                     seeds rand with the number
+       -t [number]                     sets yaffs_trace to the number
+       -clean                                  removes emfile and test dir