2 * YAFFS: Yet another FFS. A NAND-flash specific file system.
4 * Copyright (C) 2002 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Charles Manning <charles@aleph1.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
25 #include "nor_stress.h"
26 #include "yaffs_fsx.h"
32 int simulate_power_failure = 0;
40 char mount_point[200];
47 int main(int argc, char **argv)
52 while ((ch = getopt(argc,argv, "fin:ps:u"))
56 random_seed = atoi(optarg);
59 simulate_power_failure =1;
71 n_cycles = atoi(optarg);
81 strcpy(mount_point,argv[0]);
83 if(simulate_power_failure)
85 printf("Running test %s %s %s %s seed %d cycles %d\n",
86 do_upgrade ? "fw_upgrade" : "",
87 init_test ? "initialise":"",
89 simulate_power_failure ? "power_fail" : "",
90 random_seed, n_cycles);
93 yaffs_mount(mount_point);
95 if(do_upgrade && init_test){
96 simulate_power_failure = 0;
97 NorStressTestInitialise(mount_point);
98 } else if(do_upgrade){
99 printf("Running stress on %s with seed %d\n",argv[1],random_seed);
100 NorStressTestRun(mount_point,n_cycles,do_fsx);
102 yaffs_fsx_main(mount_point);
104 printf("No test to run!\n");
107 yaffs_unmount(mount_point);
109 printf("Test run completed!\n");