s4:torture: use tctx->ev as event context for polling
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Sep 2011 19:30:13 +0000 (21:30 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Nov 2011 15:00:08 +0000 (16:00 +0100)
metze

source4/torture/basic/base.c
source4/torture/raw/composite.c
source4/torture/raw/oplock.c
source4/torture/raw/qfileinfo.c
source4/torture/raw/samba3misc.c
source4/torture/rpc/samba3rpc.c

index cd0f61b681deed86bd01b46710e588366b11fa70..519ad406fef76d2d86b0fc1fa50cfdb811f649e4 100644 (file)
@@ -362,7 +362,7 @@ static bool run_negprot_nowait(struct torture_context *tctx)
        for (i=0;i<100;i++) {
                struct smbcli_request *req;
                req = smb_raw_negotiate_send(cli->transport, lpcfg_unicode(tctx->lp_ctx), PROTOCOL_NT1);
-               tevent_loop_once(cli->transport->socket->event.ctx);
+               tevent_loop_once(tctx->ev);
                if (req->state == SMBCLI_REQUEST_ERROR) {
                        if (i > 0) {
                                torture_comment(tctx, "Failed to fill pipe packet[%d] - %s (ignored)\n", i+1, nt_errstr(req->status));
index ee3bf7260daf3caa8ae7cc89157a91e93d3c19c6..2a28b9d50e7ab6f371c02fe11510de8bef18f0ae 100644 (file)
@@ -88,7 +88,7 @@ static bool test_loadfile(struct smbcli_state *cli, struct torture_context *tctx
 
        printf("waiting for completion\n");
        while (*count != num_ops) {
-               tevent_loop_once(cli->transport->socket->event.ctx);
+               tevent_loop_once(tctx->ev);
                if (torture_setting_bool(tctx, "progress", true)) {
                        printf("(%s) count=%d\r", __location__, *count);
                        fflush(stdout);
@@ -170,7 +170,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
 
        printf("Testing parallel fetchfile with %d ops\n", torture_numops);
 
-       event_ctx = cli->transport->socket->event.ctx;
+       event_ctx = tctx->ev;
        c = talloc_array(tctx, struct composite_context *, torture_numops);
 
        for (i=0; i<torture_numops; i++) {
index d3c7aae0250fea5af7b03e42bca7e9811ff3e1cf..7b67c528a7bd03c033aabb3554589330816df702 100644 (file)
@@ -4133,8 +4133,7 @@ static bool oplock_handler_hold(struct smbcli_transport *transport,
 bool torture_hold_oplock(struct torture_context *torture, 
                         struct smbcli_state *cli)
 {
-       struct tevent_context *ev = 
-               (struct tevent_context *)cli->transport->socket->event.ctx;
+       struct tevent_context *ev = torture->ev;
        int i;
 
        printf("Setting up open files with oplocks in %s\n", BASEDIR);
index ca5f66795e69a0604f496d045f78396b2c513a42..4f6d8d56b9b3836ff58ce9fec68d39d2d0492012 100644 (file)
@@ -889,7 +889,7 @@ bool torture_raw_qfileinfo_pipe(struct torture_context *torture,
        struct smbcli_tree *ipc_tree;
        NTSTATUS status;
 
-       if (!(p = dcerpc_pipe_init(torture, cli->tree->session->transport->socket->event.ctx))) {
+       if (!(p = dcerpc_pipe_init(torture, torture->ev))) {
                return false;
        }
 
index 0125d1f3d7844e39002d557e6de7d45d24bbf544..07669ed28b0131014d84a08329bbe8555821fe3b 100644 (file)
@@ -839,7 +839,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
        req->async.fn = receive_lock_result;
        req->async.private_data = &lock_result;
 
-       te = tevent_add_timer(req->transport->socket->event.ctx,
+       te = tevent_add_timer(tctx->ev,
                              tctx, timeval_current_ofs(1, 0),
                              close_locked_file, &fd);
        if (te == NULL) {
@@ -849,8 +849,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
        }
 
        while ((fd != -1) || (!lock_result.done)) {
-               if (tevent_loop_once(req->transport->socket->event.ctx)
-                   == -1) {
+               if (tevent_loop_once(tctx->ev) == -1) {
                        torture_warning(tctx, "tevent_loop_once failed: %s\n",
                                        strerror(errno));
                        ret = false;
index ba21cad0f1ce9bf741bd2790ba1ea1ce7e5adfcf..5274603fd293f16d16f830c0480030db184240d6 100644 (file)
@@ -91,7 +91,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
                goto done;
        }
 
-       lsa_pipe = dcerpc_pipe_init(mem_ctx, cli->transport->socket->event.ctx);
+       lsa_pipe = dcerpc_pipe_init(mem_ctx, torture->ev);
        if (lsa_pipe == NULL) {
                torture_comment(torture, "dcerpc_pipe_init failed\n");
                goto done;
@@ -221,8 +221,7 @@ static bool bindtest(struct torture_context *tctx,
                return false;
        }
 
-       lsa_pipe = dcerpc_pipe_init(mem_ctx,
-                                   cli->transport->socket->event.ctx); 
+       lsa_pipe = dcerpc_pipe_init(mem_ctx, tctx->ev);
        if (lsa_pipe == NULL) {
                torture_comment(tctx, "dcerpc_pipe_init failed\n");
                goto done;
@@ -392,8 +391,7 @@ static bool get_usr_handle(struct torture_context *tctx,
        struct samr_CreateUser2 c;
        uint32_t user_rid,access_granted;
 
-       samr_pipe = dcerpc_pipe_init(mem_ctx,
-                                    cli->transport->socket->event.ctx);
+       samr_pipe = dcerpc_pipe_init(mem_ctx, tctx->ev);
        torture_assert(tctx, samr_pipe, "dcerpc_pipe_init failed");
 
        samr_handle = samr_pipe->binding_handle;
@@ -947,8 +945,7 @@ static bool auth2(struct torture_context *tctx,
                return false;
        }
 
-       net_pipe = dcerpc_pipe_init(mem_ctx,
-                                   cli->transport->socket->event.ctx);
+       net_pipe = dcerpc_pipe_init(mem_ctx, tctx->ev);
        if (net_pipe == NULL) {
                torture_comment(tctx, "dcerpc_pipe_init failed\n");
                goto done;
@@ -1063,8 +1060,7 @@ static bool schan(struct torture_context *tctx,
                return false;
        }
 
-       net_pipe = dcerpc_pipe_init(mem_ctx,
-                                   cli->transport->socket->event.ctx);
+       net_pipe = dcerpc_pipe_init(mem_ctx, tctx->ev);
        if (net_pipe == NULL) {
                torture_comment(tctx, "dcerpc_pipe_init failed\n");
                goto done;
@@ -1508,8 +1504,7 @@ static NTSTATUS pipe_bind_smb(struct torture_context *tctx,
        struct dcerpc_pipe *result;
        NTSTATUS status;
 
-       if (!(result = dcerpc_pipe_init(
-                     mem_ctx, tree->session->transport->socket->event.ctx))) {
+       if (!(result = dcerpc_pipe_init(mem_ctx, tctx->ev))) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -2078,8 +2073,7 @@ static bool torture_samba3_rpc_randomauth2(struct torture_context *torture)
                goto done;
        }
 
-       if (!(net_pipe = dcerpc_pipe_init(
-                     mem_ctx, cli->transport->socket->event.ctx))) {
+       if (!(net_pipe = dcerpc_pipe_init(mem_ctx, torture->ev))) {
                torture_comment(torture, "dcerpc_pipe_init failed\n");
                goto done;
        }