From bfe8de694950e6988fcbdfd5617c44c3e5c4999d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 Sep 2006 02:58:45 +0000 Subject: r18356: doing 1000 of these requests can take over an hour under valgrind. Reduce to 50, which is plenty for testing the code (This used to be commit 911c8e1c73bf3953591755ecb4c50f5644fc9c18) --- source4/torture/rpc/lsa.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 7395a814e0..6388f61cf0 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -514,8 +514,6 @@ BOOL test_many_LookupSids(struct dcerpc_pipe *p, return True; } -#define NUM_ASYNC_REQUESTS 1000 - static void lookupsids_cb(struct rpc_request *req) { int *replies = (int *)req->async.private; @@ -536,18 +534,21 @@ static BOOL test_LookupSids_async(struct dcerpc_pipe *p, { struct lsa_SidArray sids; struct lsa_SidPtr sidptr; - - uint32_t count[NUM_ASYNC_REQUESTS]; - struct lsa_TransNameArray names[NUM_ASYNC_REQUESTS]; - struct lsa_LookupSids r[NUM_ASYNC_REQUESTS]; + uint32_t *count; + struct lsa_TransNameArray *names; + struct lsa_LookupSids *r; struct rpc_request **req; - int i, replies; BOOL ret = True; + const int num_async_requests = 50; + + count = talloc_array(mem_ctx, uint32_t, num_async_requests); + names = talloc_array(mem_ctx, struct lsa_TransNameArray, num_async_requests); + r = talloc_array(mem_ctx, struct lsa_LookupSids, num_async_requests); - printf("\nTesting %d async lookupsids request\n", 100); + printf("\nTesting %d async lookupsids request\n", num_async_requests); - req = talloc_array(mem_ctx, struct rpc_request *, NUM_ASYNC_REQUESTS); + req = talloc_array(mem_ctx, struct rpc_request *, num_async_requests); sids.num_sids = 1; sids.sids = &sidptr; @@ -555,7 +556,7 @@ static BOOL test_LookupSids_async(struct dcerpc_pipe *p, replies = 0; - for (i=0; iasync.private = &replies; } - while (replies < NUM_ASYNC_REQUESTS) { + while (replies < num_async_requests) { event_loop_once(p->conn->event_ctx); if (replies < 0) { ret = False; -- cgit