Pass session options around; saves another use of global_loadparm.
[amitay/samba.git] / source4 / torture / raw / composite.c
index 7238a2fd465062fe82c1aaf8e8ac66e0fe1f84e7..7f1f5943e1c95fca65bf91c6c618d5145f74f3ae 100644 (file)
@@ -31,6 +31,7 @@
 #include "lib/cmdline/popt_common.h"
 #include "torture/util.h"
 #include "param/param.h"
+#include "libcli/resolve/resolve.h"
 
 #define BASEDIR "\\composite"
 
@@ -161,7 +162,9 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
        io2.in.credentials = cmdline_credentials;
        io2.in.workgroup  = lp_workgroup(tctx->lp_ctx);
        io2.in.filename = fname;
+       io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
        lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
+       lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
 
        printf("testing parallel fetchfile with %d ops\n", torture_numops);
 
@@ -294,7 +297,7 @@ static bool test_appendacl(struct smbcli_state *cli, struct torture_context *tct
                c[i]->async.private_data = count;
        }
 
-       event_ctx = talloc_reference(tctx, cli->tree->session->transport->socket->event.ctx);
+       event_ctx = tctx->ev;
        printf("waiting for completion\n");
        while (*count != num_ops) {
                event_loop_once(event_ctx);
@@ -352,11 +355,11 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx)
 
        printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops);
 
-       event_ctx = talloc_reference(tctx, cli->tree->session->transport->socket->event.ctx);
+       event_ctx = tctx->ev;
        c = talloc_array(tctx, struct composite_context *, torture_numops);
 
        for (i=0; i<torture_numops; i++) {
-               c[i] = smb_composite_fsinfo_send(cli->tree,&io1);
+               c[i] = smb_composite_fsinfo_send(cli->tree, &io1, lp_resolve_context(tctx->lp_ctx));
                c[i]->async.fn = loadfile_complete;
                c[i]->async.private_data = count;
        }