diff options
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/torture.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 23624d0733..29eeb802ff 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -25,8 +25,7 @@ static fstring host, workgroup, share, password, username, myname; static int max_protocol = PROTOCOL_NT1; static char *sockops="TCP_NODELAY"; -static int nprocs=1; -int torture_numops=100; +static int nprocs=1, numops=100; static int procnum; /* records process count number when forking */ static struct cli_state current_cli; static fstring randomfname; @@ -240,7 +239,7 @@ static BOOL rw_torture(struct cli_state *c) } - for (i=0;i<torture_numops;i++) { + for (i=0;i<numops;i++) { unsigned n = (unsigned)sys_random()%10; if (i % 10 == 0) { printf("%d\r", i); fflush(stdout); @@ -457,7 +456,7 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2) return False; } - for (i=0;i<torture_numops;i++) + for (i=0;i<numops;i++) { size_t buf_size = ((unsigned)sys_random()%(sizeof(buf)-1))+ 1; if (i % 10 == 0) { @@ -1113,7 +1112,7 @@ static BOOL run_locktest3(int dummy) uint32 offset; BOOL correct = True; -#define NEXT_OFFSET offset += (~(uint32)0) / torture_numops +#define NEXT_OFFSET offset += (~(uint32)0) / numops if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) { return False; @@ -1136,7 +1135,7 @@ static BOOL run_locktest3(int dummy) return False; } - for (offset=i=0;i<torture_numops;i++) { + for (offset=i=0;i<numops;i++) { NEXT_OFFSET; if (!cli_lock(&cli1, fnum1, offset-1, 1, 0, WRITE_LOCK)) { printf("lock1 %d failed (%s)\n", @@ -1153,7 +1152,7 @@ static BOOL run_locktest3(int dummy) } } - for (offset=i=0;i<torture_numops;i++) { + for (offset=i=0;i<numops;i++) { NEXT_OFFSET; if (cli_lock(&cli1, fnum1, offset-2, 1, 0, WRITE_LOCK)) { @@ -1177,7 +1176,7 @@ static BOOL run_locktest3(int dummy) } } - for (offset=i=0;i<torture_numops;i++) { + for (offset=i=0;i<numops;i++) { NEXT_OFFSET; if (!cli_unlock(&cli1, fnum1, offset-1, 1)) { @@ -3420,7 +3419,7 @@ static BOOL run_dirtest(int dummy) cli_sockopt(&cli, sockops); srandom(0); - for (i=0;i<torture_numops;i++) { + for (i=0;i<numops;i++) { fstring fname; slprintf(fname, sizeof(fname), "\\%x", (int)random()); fnum = cli_open(&cli, fname, O_RDWR|O_CREAT, DENY_NONE); @@ -3440,7 +3439,7 @@ static BOOL run_dirtest(int dummy) printf("dirtest core %g seconds\n", end_timer() - t1); srandom(0); - for (i=0;i<torture_numops;i++) { + for (i=0;i<numops;i++) { fstring fname; slprintf(fname, sizeof(fname), "\\%x", (int)random()); cli_unlink(&cli, fname); @@ -3694,7 +3693,6 @@ static struct { {"RENAME", run_rename, 0}, {"DELETE", run_deletetest, 0}, {"PROPERTIES", run_properties, 0}, - {"MANGLE", torture_mangle, 0}, {"W2K", run_w2ktest, 0}, {"TRANS2SCAN", torture_trans2_scan, 0}, {"NTTRANSSCAN", torture_nttrans_scan, 0}, @@ -3766,7 +3764,6 @@ static void usage(void) printf("\t-L use oplocks\n"); printf("\t-c CLIENT.TXT specify client load file for NBENCH\n"); printf("\t-A showall\n"); - printf("\t-s seed\n"); printf("\n\n"); printf("tests are:"); @@ -3837,11 +3834,8 @@ static void usage(void) fstrcpy(workgroup, lp_workgroup()); - while ((opt = getopt(argc, argv, "hW:U:n:N:O:o:m:Ld:Ac:ks:")) != EOF) { + while ((opt = getopt(argc, argv, "hW:U:n:N:O:o:m:Ld:Ac:k")) != EOF) { switch (opt) { - case 's': - srandom(atoi(optarg)); - break; case 'W': fstrcpy(workgroup,optarg); break; @@ -3852,7 +3846,7 @@ static void usage(void) nprocs = atoi(optarg); break; case 'o': - torture_numops = atoi(optarg); + numops = atoi(optarg); break; case 'd': DEBUGLEVEL = atoi(optarg); |