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 extern int ops_multiplier;
42 char mount_point[200];
49 int main(int argc, char **argv)
54 while ((ch = getopt(argc,argv, "filn:ps:u"))
58 random_seed = atoi(optarg);
61 simulate_power_failure =1;
76 n_cycles = atoi(optarg);
86 strcpy(mount_point,argv[0]);
88 if(simulate_power_failure)
90 printf("Running test %s %s %s %s seed %d cycles %d\n",
91 do_upgrade ? "fw_upgrade" : "",
92 init_test ? "initialise":"",
94 simulate_power_failure ? "power_fail" : "",
95 random_seed, n_cycles);
98 yaffs_mount(mount_point);
100 if(do_upgrade && init_test){
101 simulate_power_failure = 0;
102 NorStressTestInitialise(mount_point);
103 } else if(do_upgrade){
104 printf("Running stress on %s with seed %d\n",argv[1],random_seed);
105 NorStressTestRun(mount_point,n_cycles,do_fsx);
107 yaffs_fsx_main(mount_point,n_cycles);
109 printf("No test to run!\n");
112 yaffs_unmount(mount_point);
114 printf("Test run completed!\n");