yaffs Changes to direct tests
authorCharles Manning <cdhmanning@gmail.com>
Sat, 7 Aug 2010 04:30:20 +0000 (16:30 +1200)
committerCharles Manning <cdhmanning@gmail.com>
Sat, 7 Aug 2010 04:30:20 +0000 (16:30 +1200)
Add test for lost+found being empty.
Make fuzzer less verbose
Allow changing of iteration count for simulated power fail testing.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
direct/tests/fuzzer.c
direct/tests/launch_tests.sh
direct/tests/manage_nand_test.sh
direct/tests/manage_nor_test.sh
direct/tests/nor_stress.c
direct/tests/run_fuzz_test_nand.sh
direct/tests/run_fw_update_test_nor.sh

index deadf95..64d307f 100644 (file)
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
        srand(time(0));
 
        for(b = 0; b < nbuffers; b++){
-               printf("buffer %d\n",b);
+               /* printf("buffer %d\n",b); */
                lseek(h,b * sizeof(buffer),SEEK_SET);
                bufsize = read(h,buffer,sizeof(buffer));
                for(i = 0; i < changesPerBuffer; i++){
index 31e9e95..1005ff2 100755 (executable)
@@ -1,5 +1,12 @@
 #! /bin/sh
 set -x
+
+
+iterations=100000
+
+[ -z $1 ]  || iterations=$1
+
+
 LAUNCHDIR=`pwd`
 RUNDIR=`pwd`/tmp
 mkdir $RUNDIR
@@ -8,9 +15,9 @@ sudo chmod a+wr $RUNDIR
 
 
 
-xterm  -e "$LAUNCHDIR/manage_nor_test.sh  0"&
-xterm  -e "$LAUNCHDIR/manage_nand_test.sh 0"&
-xterm  -e "$LAUNCHDIR/manage_nor_test.sh  1"&
-xterm  -e "$LAUNCHDIR/manage_nand_test.sh 1"&
-xterm  -e "$LAUNCHDIR/manage_nor_test.sh  2"&
-xterm  -e "$LAUNCHDIR/manage_nand_test.sh 2"&
+xterm  -e "$LAUNCHDIR/manage_nor_test.sh  0 $iterations"&
+xterm  -e "$LAUNCHDIR/manage_nand_test.sh  0 $iterations"&
+xterm  -e "$LAUNCHDIR/manage_nor_test.sh  1 $iterations"&
+xterm  -e "$LAUNCHDIR/manage_nand_test.sh  1 $iterations"&
+xterm  -e "$LAUNCHDIR/manage_nor_test.sh  2 $iterations"&
+xterm  -e "$LAUNCHDIR/manage_nand_test.sh  2 $iterations"&
index 3d985d3..7944873 100755 (executable)
@@ -3,6 +3,10 @@
 dir_id=-none
 [ -z $1 ] || dir_id=$1
 
+iterations=100000
+
+[ -z $2 ]  || iterations=$2
+
 STARTDIR=`pwd`
 RUNDIR=`pwd`/tmp/nand-$dir_id
 mkdir $RUNDIR
@@ -11,7 +15,7 @@ cp $STARTDIR/*sh .
 ln -s $STARTDIR/yaffs_test yaffs_test
 
 ./init_fw_update_test_nand.sh
-./run_fw_update_test_nand.sh
+./run_fw_update_test_nand.sh $iterations
 
 
 echo "!!!!!!!!!!!"
index d7a08d3..60b78da 100755 (executable)
@@ -3,6 +3,11 @@
 dir_id=-none
 [ -z $1 ] || dir_id=$1
 
+
+iterations=100000
+
+[ -z $2 ]  || iterations=$2
+
 STARTDIR=`pwd`
 RUNDIR=`pwd`/tmp/nor-$dir_id
 mkdir $RUNDIR
@@ -11,7 +16,7 @@ cp $STARTDIR/*sh .
 ln -s $STARTDIR/yaffs_test yaffs_test
 
 ./init_fw_update_test_nor.sh
-./run_fw_update_test_nor.sh
+./run_fw_update_test_nor.sh $iterations
 
 echo "!!!!!!!!!!!"
 echo "Tests done"
index 3802837..6f6b4ce 100644 (file)
@@ -182,6 +182,7 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
        struct yaffs_stat s;
        char str[1000];
        int error_line = 0;
+       int nentries;
                        
        d = yaffs_opendir(dname);
        
@@ -191,11 +192,13 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
        }
        else
        {
+               nentries = 0;
                while((de = yaffs_readdir(d)) != NULL)
                {
                        strcpy(str,dname);
                        strcat(str,"/");
                        strcat(str,de->d_name);
+                       nentries++;
                        
                        yaffs_lstat(str,&s);
                        
@@ -224,10 +227,15 @@ static void dump_directory_tree_worker(const char *dname,int recursive)
                                dump_directory_tree_worker(str,1);
                                
                         if(s.st_ino > 10000)
-                          error_line = __LINE__;
+                               error_line = __LINE__;
                                                        
                }
                
+               if(strstr(dname,"lost+found") && nentries >0){
+                       printf("\n\n!!! HEY lost+found not empty, had %d entries\n\n\n",nentries);
+                       error_line = __LINE__;
+               }
+
                if(error_line && !no_verification)
                        FatalError(error_line);
                
index b9473fc..1faeff5 100755 (executable)
@@ -17,6 +17,9 @@ do
    seed=$RANDOM   
    j=$(( $i % 10 ))
 
+   cycles=$RANDOM
+   cycles=$(( $cycles % 10000 ))
+
    rm -f log-nand-*$j
    rm -f seed-nand-*$j
    echo $seed>seed-nand-for-run-$i
@@ -45,6 +48,5 @@ do
    echo "#########"
    echo "#########"
    echo "#########"
-   ./yaffs_test -u  -p -s$seed -t 8 -z yaffs2 
-   # >log-nand-$i
+   ./yaffs_test -u  -p -s$seed -t 8 -n $cycles -z yaffs2 
 done
index 9c9d616..9265336 100755 (executable)
@@ -33,6 +33,7 @@ do
    echo "#########"
    echo "#########"
    echo "#########"
-   ./yaffs_test -u -f -p -s$seed -t0 M18-1 >log-nor-$i
+   ./yaffs_test -u -f -p -s$seed -t0 M18-1 
+   #>log-nor-$i
 done