Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
authorTimothy Manning <tfhmanning@gmail.com>
Wed, 7 Dec 2011 22:01:43 +0000 (11:01 +1300)
committerTimothy Manning <tfhmanning@gmail.com>
Wed, 7 Dec 2011 22:01:43 +0000 (11:01 +1300)
12 files changed:
direct/timothy_tests/linux_tests/Makefile [new file with mode: 0644]
direct/timothy_tests/linux_tests/README.txt [new file with mode: 0644]
direct/timothy_tests/linux_tests/lib.c [new file with mode: 0644]
direct/timothy_tests/linux_tests/lib.h [new file with mode: 0644]
direct/timothy_tests/linux_tests/linux_test.c [new file with mode: 0644]
direct/timothy_tests/linux_tests/linux_test.h [new file with mode: 0644]
direct/timothy_tests/linux_tests/mkdir_link [deleted file]
direct/timothy_tests/linux_tests/mkdir_link.c [deleted file]
direct/timothy_tests/linux_tests/mkdir_link.h [deleted file]
direct/timothy_tests/linux_tests/rename [deleted file]
direct/timothy_tests/linux_tests/rename.c [deleted file]
direct/timothy_tests/linux_tests/rename.h [deleted file]

diff --git a/direct/timothy_tests/linux_tests/Makefile b/direct/timothy_tests/linux_tests/Makefile
new file mode 100644 (file)
index 0000000..6910788
--- /dev/null
@@ -0,0 +1,113 @@
+# 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_tagsvalidity.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_checkptrwtest.o\
+
+TESTFILES =    linux_test.o lib.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_tagsvalidity.c yaffs_tagsvalidity.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
+
+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: linux_test
+
+$(ALLOBJS): %.o: %.c
+       gcc -c $(CFLAGS) -o $@ $<
+
+$(PYTONOSYMLINKS):
+       ln -s ../../python/$@ $@
+
+$(YAFFSSYMLINKS):
+       ln -s ../../../$@ $@
+
+$(YAFFSDIRECTSYMLINKS):
+       ln -s ../../$@ $@
+
+$(DIRECTEXTRASYMLINKS):
+       ln -s ../../basic-test/$@ $@
+
+
+linux_test: $(SYMLINKS) $(ALLOBJS)
+       gcc $(CFLLAG) -o $@ $(ALLOBJS)
+
+
+
+clean:
+       rm -f linux_test  $(ALLOBJS) core $(SYMLINKS) 
diff --git a/direct/timothy_tests/linux_tests/README.txt b/direct/timothy_tests/linux_tests/README.txt
new file mode 100644 (file)
index 0000000..0c3fa84
--- /dev/null
@@ -0,0 +1,30 @@
+
+How to initilise the nandsim
+
+$ make
+
+$ sudo -s
+...password..
+# now have a root shell
+$ ./linux-tests/initnandsim 128MiB-2048
+$ insmod yaffs2multi.ko
+$ mkdir /mnt/y
+$ mount -t yaffs2 /dev/mtdblock0 /mnt/y
+
+
+
+How to change the permissions on the nandsim partition
+
+$ sudo chmod a+wr /mnt/y/
+#check the permission change
+$ touch /mnt/y/test_file
+
+How to clean the folder
+
+$ rm -rf /mnt/y
+
+
+The test must be run in sudo to work
+
+$ make
+$ sudo ./linux_test
diff --git a/direct/timothy_tests/linux_tests/lib.c b/direct/timothy_tests/linux_tests/lib.c
new file mode 100644 (file)
index 0000000..5f43904
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 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 "lib.h"
+static char message[200];
+static int  PRINT_LEVEL = 3;
+static int exit_on_error_val =1;
+char string[FILE_NAME_LENGTH+1];
+
+
+int get_exit_on_error(void)
+{
+       return exit_on_error_val;
+}
+
+void set_exit_on_error(int val)
+{
+       exit_on_error_val=val;
+}
+
+node * linked_list_add_node(int pos,node *head_node)
+{
+       node *new_node=NULL;
+       if (pos==HEAD){
+               new_node=malloc(sizeof(node));
+               memset(new_node, 0, sizeof(node));
+               new_node->string=NULL;
+               new_node->next=head_node;
+               return new_node;
+       }
+       return NULL;
+}
+
+void node_print_pointers(node *current_node)
+{
+       while (current_node != NULL){
+               sprintf(message,"current_node: %p, string: %s next_node: %p\n",current_node,current_node->string,current_node->next);
+               print_message(3,message);
+               current_node=current_node->next;
+       }
+}
+
+int delete_linked_list(node *head_node)
+{
+       node *next_node=NULL;
+       node *current_node=head_node;
+
+               while (current_node != NULL){
+                       next_node=current_node->next;
+                       free(current_node);
+                       current_node=next_node;
+               }
+
+       return 1;
+}
+
+char * generate_random_string(unsigned int length)
+{
+
+       unsigned int x;
+       for (x=0;x<(length-1);x++)
+       {
+               string[x]=(rand() % NAME_RANGE)+65;
+       }
+       string[x]='\0';
+       return string;
+}
+
+void set_print_level(int new_level)
+{
+       PRINT_LEVEL=new_level;
+}
+int get_print_level(void)
+{
+       return PRINT_LEVEL;
+}
+void print_message(char print_level,char *message)
+{
+       if (print_level <= PRINT_LEVEL){
+               printf("%s",message);
+       }
+}
+int random_int(void)
+{
+       return (random()%1000000); 
+}
+
+void check_function(int output)
+{
+       if (output>=0){
+               print_message(3,"test_passed\n");
+       } else {
+               print_message(3,"test_failed\n");
+               get_error_linux();
+       }
+}
+
+void get_error_linux(void)
+{
+       int error_code=0;
+       char message[30];
+       message[0]='\0';
+
+       error_code=errno;
+       sprintf(message,"linux_error code %d\n",error_code);
+       print_message(1,message);
+       
+       strcpy(message,"error is");
+       perror(message);
+//     sprintf(message,"error is : %s\n",yaffs_error_to_str(error_code));
+       //perror(message);      
+       //print_message(1,message);
+}
diff --git a/direct/timothy_tests/linux_tests/lib.h b/direct/timothy_tests/linux_tests/lib.h
new file mode 100644 (file)
index 0000000..fa0cfbe
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ *
+ * Copyright (C) 2002-2010 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 Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
+ */
+
+#ifndef __lib_h__
+#define __lib_h__
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#define NAME_RANGE 10
+#define ROOT_PATH "/mnt/y/"
+#define FILE_NAME_LENGTH 3
+#define HEAD 0
+#define TAIL 1
+
+typedef struct node_temp{
+       char *string;
+       struct node_temp *next; 
+}node;
+
+int get_exit_on_error(void);
+void set_exit_on_error(int val);
+int delete_linked_list(node *head_node);
+node * linked_list_add_node(int pos,node *head_node);
+int random_int(void);
+char * generate_random_string(unsigned int length);
+void get_error_linux(void);
+void check_function(int output);
+void print_message(char print_level, char *message);
+void set_print_level(int new_level);
+int get_print_level(void);
+void node_print_pointers(node *current_node);
+#endif
diff --git a/direct/timothy_tests/linux_tests/linux_test.c b/direct/timothy_tests/linux_tests/linux_test.c
new file mode 100644 (file)
index 0000000..429e74f
--- /dev/null
@@ -0,0 +1,315 @@
+/*
+ * YAFFS: Yet another FFS. A NAND-flash specific file system.
+ *
+ * Copyright (C) 2002-2010 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 "linux_test.h"
+
+int random_seed;
+int simulate_power_failure = 1;
+
+char message[400];     //this is used for storing print messages.
+
+
+
+const struct option long_options[]={
+       {"help",        0,NULL,'h'},
+
+
+       {"print_level", 1,NULL,'p'},
+       {"quiet",       0,NULL,'q'},
+
+       {"seed",        1,NULL,'s'},
+
+       {"verbose",     0,NULL,'v'}
+};
+
+const char short_options[]="hp:qs:v";
+
+
+void init(int argc, char *argv[])
+{
+       char dir[200];
+       dir[0]='\0';
+       int x=-1;
+       char message[100];
+       int new_option;
+
+       x=(unsigned)time(NULL);
+       sprintf(message,"seeding srand with: %d\n",x);
+       print_message(2,message);
+       srand(x);
+
+
+
+       do {
+               new_option=getopt_long(argc,argv,short_options,long_options,NULL);              
+               if (new_option=='h'){
+                       printf("mirror_tests help\n");
+                       printf("arguments:\n");
+                       printf("\t-p [NUMBER] //sets the print level for mirror_tests.\n");
+                       printf("\t-v //verbose mode everything is printed\n");
+                       printf("\t-q //quiet mode nothing is printed.\n");
+                       printf("\t-s [number] //seeds rand with the number\n");
+
+                       exit(0);
+       
+               } else if (new_option=='p'){
+                       set_print_level(atoi(optarg));
+               } else if (new_option=='v'){
+                       set_print_level(5);
+               } else if (new_option=='q'){
+                       set_print_level(-1);
+               } else if (new_option=='s'){
+                       srand(atoi(argv[x+1]));
+
+               } else if (new_option==-1){
+
+               } else if (new_option=='?') {
+                       printf("bad argument\n");
+                       exit(0);
+               }
+       }while(new_option!=-1);
+}
+
+int main(int argc, char *argv[])
+{
+       dir_struct *scanned_dir=NULL;
+       int output=0;
+       int break_bool=0;
+       int x=5;
+
+       init(argc,argv); 
+       while( 1){
+               while (break_bool!=1){
+                       //printf("x %d\n",x);
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               output=mkdir_test();
+                               break_bool=1;
+                       } 
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               output=rmdir_test();
+                               break_bool=1;
+                       } 
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               output=mknod_test();
+                               break_bool=1;
+                       } 
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               output=symlink_test();
+                               break_bool=1;
+                       } 
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               output=link_test();
+                               break_bool=1;
+                       } 
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               output=rename_test();
+                               break_bool=1;
+                       } 
+                       x--;
+                       if (x<0 &&(break_bool!=1)){
+                               scanned_dir=scan_dir();
+                               
+                               output=remount_test();
+                               check_dir(scanned_dir);
+                               scanned_dir=NULL;       //the scanned dir has been freed in check_dir.
+                               break_bool=1;
+                       } 
+               }       
+               //printf("resetting x\n"); 
+               check_function(output);
+               break_bool=0;
+               x=(rand()% 99);
+       }
+       return 0;
+}
+
+dir_struct * scan_dir(void)
+{      
+       struct dirent *dir_data;        
+       dir_struct *dir=NULL;
+       dir=malloc(sizeof(dir_struct));
+       memset(dir, 0, sizeof(dir_struct));
+       DIR *open_dir=NULL;
+
+
+       open_dir=opendir(ROOT_PATH);
+       dir_data=readdir(open_dir);
+       while(dir_data){
+               dir->path_list=linked_list_add_node(HEAD,dir->path_list);
+               dir->path_list->string=malloc(strlen(dir_data->d_name)+1);
+               strcpy(dir->path_list->string,dir_data->d_name);
+               sprintf(message,"opened file: %s\n",dir->path_list->string);
+               print_message(5,message);
+               dir_data=readdir(open_dir);
+       }
+       closedir(open_dir);
+       //node_print_pointers(dir->path_list);
+       return dir;
+}
+
+int check_dir(dir_struct *old_dir)
+{
+       print_message(3,"scanning new dir\n");
+       dir_struct *new_dir=scan_dir();
+       node *new_list=new_dir->path_list;
+       node *old_list=old_dir->path_list;
+       int exit_loop=0,error=0;
+       print_message(3,"checking dir\n");
+       for (;old_list!= NULL;old_list=old_list->next){
+               //sprintf(message,"new_list=!NULL= %d, exit_loop !=1 = %d\n",(new_list!=NULL),(exit_loop !=1));
+               //print_message(3,message);
+               for (;(new_list!=NULL) && (exit_loop !=1);new_list=new_list->next){
+                       //sprintf(message,"comparing %s  and %s\n",old_list->string,new_list->string);
+                       //print_message(3,message);
+                       if (strcmp( new_list->string ,old_list->string)==0){
+                               //files match -now compare the modes and contents of the files.
+                               //and set the paths to NULL.
+                               exit_loop=1;
+                       }
+                       /*if (new_list->next==NULL){
+                               print_message(3,"next is null\n");
+                               
+                       }*/
+               }
+               if (exit_loop !=1){
+                       //failed to find a matching file
+                       sprintf(message,"a file has disappeared: %s\n",old_list->string); 
+                       print_message(3,message);
+                       error=1;
+                       
+               }
+               new_list=new_dir->path_list;
+               exit_loop=0;
+       }
+       //now check if there are any old unmatched files 
+       
+       //free both data structs
+       delete_linked_list(old_dir->path_list);
+       delete_linked_list(new_dir->path_list);
+       new_dir->path_list=NULL;
+       old_dir->path_list=NULL;
+       free(old_dir);
+       free(new_dir);
+       if (error ==1){
+               print_message(3,"checking dir failed\n");
+               if (get_exit_on_error()==1){
+                       print_message(3,"exiting_program\n");
+                       exit(0);
+               }
+       }
+
+       else if (error !=1){
+               print_message(3,"checking dir passed\n");
+       }
+       return error;
+}
+
+int remount_test(void)
+{
+       int output;
+       print_message(3,"\nunmounting\n");
+       output=umount2("/mnt/y",1);
+       check_function(output);
+       print_message(3,"mounting\n");
+       mount("/dev/mtdblock0","/mnt/y","yaffs2",0,NULL);
+       check_function(output);
+       return output;
+}
+
+int mkdir_test(void)
+{
+
+       char string[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       int mode=0,output=0;
+       strcpy(string,ROOT_PATH);
+       strcat(string,generate_random_string(FILE_NAME_LENGTH));
+       mode = ((S_IREAD|S_IWRITE)&random_int());
+       sprintf(message,"\nmaking directory: %s, with mode %d\n",string,mode);
+       print_message(3,message);
+       output= mkdir(string,mode);
+       return output;
+}
+
+int rmdir_test(void)
+{
+       char string[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       int output=0;
+       strcpy(string,ROOT_PATH);
+       strcat(string,generate_random_string(FILE_NAME_LENGTH));
+
+       sprintf(message,"\nremoving directory: %s\n",string);
+       print_message(3,message);
+       output= rmdir(string);
+       return output;
+}
+int symlink_test(void)
+{
+       char string[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       char string2[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       int output;
+       strcpy(string,ROOT_PATH);
+       strcat(string,generate_random_string(FILE_NAME_LENGTH));
+       strcpy(string2,ROOT_PATH);
+       strcat(string2,generate_random_string(FILE_NAME_LENGTH));
+       sprintf(message,"\nsymlink from: %s, to %s\n",string,string2);
+       print_message(3,message);
+       output= symlink(string,string2);
+       return output;
+}
+int rename_test(void)
+{
+       char string[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       char string2[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       int output;
+       strcpy(string,ROOT_PATH);
+       strcat(string,generate_random_string(FILE_NAME_LENGTH));
+       strcpy(string2,ROOT_PATH);
+       strcat(string2,generate_random_string(FILE_NAME_LENGTH));
+       sprintf(message,"\nrenaming from: %s, to %s\n",string,string2);
+       print_message(3,message);
+       output= rename(string,string2);
+       return output;
+}
+int link_test(void)
+{
+       char string[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       char string2[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       int output=0;
+       strcpy(string,ROOT_PATH);
+       strcat(string,generate_random_string(FILE_NAME_LENGTH));
+       strcpy(string2,ROOT_PATH);
+       strcat(string2,generate_random_string(FILE_NAME_LENGTH));
+       sprintf(message,"\nlink from: %s, to %s\n",string,string2);
+       print_message(3,message);
+       output= link(string,string2);
+       return output;
+}
+int mknod_test(void)
+{
+       char string[FILE_NAME_LENGTH+strlen(ROOT_PATH)];
+       int mode=0,dev=0,output=0;
+       strcpy(string,ROOT_PATH);
+       strcat(string,generate_random_string(FILE_NAME_LENGTH));
+       mode = ((S_IREAD|S_IWRITE)&random_int());
+       dev = random_int();
+       sprintf(message,"\nmaking node: %s, with mode %d, dev %d\n",string,mode,dev);
+       print_message(3,message);
+       output= mknod(string,mode,dev);
+       return output;
+}
diff --git a/direct/timothy_tests/linux_tests/linux_test.h b/direct/timothy_tests/linux_tests/linux_test.h
new file mode 100644 (file)
index 0000000..97a6348
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * YAFFS: Yet another Flash File System . A NAND-flash specific file system. 
+ *
+ * Copyright (C) 2002-2010 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 Lesser General Public License version 2.1 as
+ * published by the Free Software Foundation.
+ *
+ * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
+ */
+
+#ifndef __linux_test_h__
+#define __linux_test_h__
+#include <stdio.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/mount.h>
+#include "lib.h"
+#include <fcntl.h>
+#include <time.h>
+#include <getopt.h>
+
+typedef struct dir_struct_temp{ 
+       node *path_list;
+       int number_of_items;
+}dir_struct;
+
+int check_dir(dir_struct *old_dir);
+dir_struct * scan_dir(void);
+int link_test(void);
+int symlink_test(void);
+int mknod_test(void);
+int mkdir_test(void);
+int rename_test(void);
+int rmdir_test(void);
+int remount_test(void);
+#endif
diff --git a/direct/timothy_tests/linux_tests/mkdir_link b/direct/timothy_tests/linux_tests/mkdir_link
deleted file mode 100755 (executable)
index 7f92f37..0000000
Binary files a/direct/timothy_tests/linux_tests/mkdir_link and /dev/null differ
diff --git a/direct/timothy_tests/linux_tests/mkdir_link.c b/direct/timothy_tests/linux_tests/mkdir_link.c
deleted file mode 100644 (file)
index d466958..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-
-
-int main()
-{
-       int output=0;
-       int error_code =0 ;
-       output =symlink("timothy/home/tests/new_dir" "timothy/home/test/new_dir_link");
-       output=mkdir("timothy/home/test/new_dir_link" );
-       printf("output %d\n",output);
-       if (output <0 ) {
-               error_code = errno;
-               printf("error code %d\n",error_code);
-               printf("Error description is : %s\n",strerror(errno));
-       }
-       return 0;
-}
diff --git a/direct/timothy_tests/linux_tests/mkdir_link.h b/direct/timothy_tests/linux_tests/mkdir_link.h
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/direct/timothy_tests/linux_tests/rename b/direct/timothy_tests/linux_tests/rename
deleted file mode 100755 (executable)
index a168978..0000000
Binary files a/direct/timothy_tests/linux_tests/rename and /dev/null differ
diff --git a/direct/timothy_tests/linux_tests/rename.c b/direct/timothy_tests/linux_tests/rename.c
deleted file mode 100644 (file)
index 9c40c2f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-
-
-int main()
-{
-       int output=0;
-       int error_code =0 ;
-       output=rename( "/home/timothy/test/cat/","/home/timothy/test/dog/");
-       printf("output %d\n",output);
-       if (output <0 ) {
-               error_code = errno;
-               printf("error code %d\n",error_code);
-               printf("Error description is : %s\n",strerror(errno));
-       }
-       return 0;
-}
diff --git a/direct/timothy_tests/linux_tests/rename.h b/direct/timothy_tests/linux_tests/rename.h
deleted file mode 100644 (file)
index e69de29..0000000