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];
46 printf("Usage: yaffs_test [options] mountpoint\n");
48 printf(" f: do fsx testing\n");
49 printf(" i: initialise for upgrade testing\n");
50 printf(" l: multiply number of operations by 5\n");
51 printf(" n nnn: number of cycles\n");
52 printf(" p: simulate power fail testing\n");
53 printf(" s sss: set seed\n");
54 printf(" u: do upgrade test\n");
58 int main(int argc, char **argv)
63 while ((ch = getopt(argc,argv, "filn:ps:u"))
67 random_seed = atoi(optarg);
70 simulate_power_failure =1;
85 n_cycles = atoi(optarg);
95 strcpy(mount_point,argv[0]);
97 if(simulate_power_failure)
99 printf("Running test %s %s %s %s seed %d cycles %d\n",
100 do_upgrade ? "fw_upgrade" : "",
101 init_test ? "initialise":"",
103 simulate_power_failure ? "power_fail" : "",
104 random_seed, n_cycles);
107 yaffs_mount(mount_point);
108 printf("Mount complete\n");
110 if(do_upgrade && init_test){
111 simulate_power_failure = 0;
112 NorStressTestInitialise(mount_point);
113 } else if(do_upgrade){
114 printf("Running stress on %s with seed %d\n",mount_point,random_seed);
115 NorStressTestRun(mount_point,n_cycles,do_fsx);
117 yaffs_fsx_main(mount_point,n_cycles);
119 printf("No test to run!\n");
122 yaffs_unmount(mount_point);
124 printf("Test run completed!\n");