From 93e27bec159db33e77a7eae34249f6073993815a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 06:18:20 +0000 Subject: r5035: fixed composite test to use --num-ops command line option (This used to be commit f36e4cf6862c9cbcd36563007efa8dc59912d896) --- source4/torture/raw/composite.c | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'source4/torture/raw/composite.c') diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 5c09848f52..38941b8c56 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -121,9 +121,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) char *data; int i; size_t len = random() % 10000; - const int num_ops = 10; + extern int torture_numops; struct event_context *event_ctx; int *count = talloc_zero(mem_ctx, int); + BOOL ret = True; data = talloc_array(mem_ctx, uint8_t, len); @@ -152,12 +153,12 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io2.in.password = lp_parm_string(-1, "torture", "password"); io2.in.filename = fname; - printf("testing parallel fetchfile with %d ops\n", num_ops); + printf("testing parallel fetchfile with %d ops\n", torture_numops); event_ctx = event_context_init(mem_ctx); - c = talloc_array(mem_ctx, struct smbcli_composite *, num_ops); + c = talloc_array(mem_ctx, struct smbcli_composite *, torture_numops); - for (i=0; iasync.fn = loadfile_complete; c[i]->async.private = count; @@ -165,45 +166,38 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); - while (*count != num_ops) { + while (*count != torture_numops) { event_loop_once(event_ctx); -#if 0 - /* Attempt to kill the event ... To fix -- vl */ - for (i=0; istate == SMBCLI_REQUEST_ERROR) { - printf("error in %d\n", i); msleep(1000); - talloc_free(c[i]); c[i]=NULL; - } - } -#endif printf("count=%d\r", *count); fflush(stdout); } printf("count=%d\n", *count); - for (i=0;i