From 06d06c6c9415140167708d09307125067c1f5b87 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 01:19:20 +0200 Subject: Use provided event context rather than looking for it. (This used to be commit fd0bb96acea3d7949cf0574bb6f3568a90f67f4e) --- source4/torture/ldap/cldapbench.c | 2 +- source4/torture/nbt/dgram.c | 4 ++-- source4/torture/raw/lockbench.c | 7 +++---- source4/torture/raw/offline.c | 11 +++++------ source4/torture/raw/openbench.c | 5 ++--- 5 files changed, 13 insertions(+), 16 deletions(-) (limited to 'source4') diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c index 83e505e164..51586ac733 100644 --- a/source4/torture/ldap/cldapbench.c +++ b/source4/torture/ldap/cldapbench.c @@ -116,7 +116,7 @@ bool torture_bench_cldap(struct torture_context *torture) make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL)); /* do an initial name resolution to find its IP */ - status = resolve_name(lp_resolve_context(torture->lp_ctx), &name, torture, &address, event_context_find(torture)); + status = resolve_name(lp_resolve_context(torture->lp_ctx), &name, torture, &address, torture->ev); if (!NT_STATUS_IS_OK(status)) { printf("Failed to resolve %s - %s\n", name.name, nt_errstr(status)); diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index e1680877e8..18950e9dcb 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -87,7 +87,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx) /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)), + resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); @@ -170,7 +170,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)), + resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, tctx->ev), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 86030c538a..d7738be833 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -316,7 +316,6 @@ bool torture_bench_lock(struct torture_context *torture) int i; int timelimit = torture_setting_int(torture, "timelimit", 10); struct timeval tv; - struct event_context *ev = event_context_find(mem_ctx); struct benchlock_state *state; int total = 0, minops=0; struct smbcli_state *cli; @@ -333,8 +332,8 @@ bool torture_bench_lock(struct torture_context *torture) state[i].tctx = torture; state[i].mem_ctx = talloc_new(state); state[i].client_num = i; - state[i].ev = ev; - if (!torture_open_connection_ev(&cli, i, torture, ev)) { + state[i].ev = torture->ev; + if (!torture_open_connection_ev(&cli, i, torture, torture->ev)) { return false; } talloc_steal(mem_ctx, state); @@ -380,7 +379,7 @@ bool torture_bench_lock(struct torture_context *torture) printf("Running for %d seconds\n", timelimit); while (timeval_elapsed(&tv) < timelimit) { - event_loop_once(ev); + event_loop_once(torture->ev); if (lock_failed) { DEBUG(0,("locking failed\n")); diff --git a/source4/torture/raw/offline.c b/source4/torture/raw/offline.c index 1340692faa..852cddb996 100644 --- a/source4/torture/raw/offline.c +++ b/source4/torture/raw/offline.c @@ -389,7 +389,6 @@ bool torture_test_offline(struct torture_context *torture) int i; int timelimit = torture_setting_int(torture, "timelimit", 10); struct timeval tv; - struct event_context *ev = event_context_find(mem_ctx); struct offline_state *state; struct smbcli_state *cli; bool progress; @@ -404,8 +403,8 @@ bool torture_test_offline(struct torture_context *torture) for (i=0;iev; + if (!torture_open_connection_ev(&cli, i, torture, torture->ev)) { return false; } state[i].tree = cli->tree; @@ -418,7 +417,7 @@ bool torture_test_offline(struct torture_context *torture) for (i=nconnections;iev; state[i].tree = state[i % nconnections].tree; state[i].client = i; } @@ -473,7 +472,7 @@ bool torture_test_offline(struct torture_context *torture) printf("Running for %d seconds\n", timelimit); while (timeval_elapsed(&tv) < timelimit) { - event_loop_once(ev); + event_loop_once(torture->ev); if (test_failed) { DEBUG(0,("test failed\n")); @@ -487,7 +486,7 @@ bool torture_test_offline(struct torture_context *torture) while (state[i].loadfile || state[i].savefile || state[i].req) { - event_loop_once(ev); + event_loop_once(torture->ev); } } diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c index a5b1434a47..c28312f8a6 100644 --- a/source4/torture/raw/openbench.c +++ b/source4/torture/raw/openbench.c @@ -369,7 +369,6 @@ bool torture_bench_open(struct torture_context *torture) int i; int timelimit = torture_setting_int(torture, "timelimit", 10); struct timeval tv; - struct event_context *ev = event_context_find(mem_ctx); struct benchopen_state *state; int total = 0; int total_retries = 0; @@ -387,8 +386,8 @@ bool torture_bench_open(struct torture_context *torture) state[i].tctx = torture; state[i].mem_ctx = talloc_new(state); state[i].client_num = i; - state[i].ev = ev; - if (!torture_open_connection_ev(&state[i].cli, i, torture, ev)) { + state[i].ev = torture->ev; + if (!torture_open_connection_ev(&state[i].cli, i, torture, torture->ev)) { return false; } talloc_steal(mem_ctx, state); -- cgit