s4: popt: Global replace of cmdline_credentials -> popt_get_cmdline_credentials().
[gd/samba-autobuild/.git] / source4 / torture / unix / unix_info2.c
index d7482ddcf1f5e98b035435dedce835ce2b098da1..14f6d776081e1018561a9a7a559a474790c05900 100644 (file)
 
 #include "includes.h"
 #include "libcli/libcli.h"
-#include "libcli/raw/interfaces.h"
-#include "libcli/raw/raw_proto.h"
-#include "torture/torture.h"
 #include "torture/util.h"
-#include "torture/basic/proto.h"
+#include "torture/unix/proto.h"
 #include "lib/cmdline/popt_common.h"
-#include "auth/credentials/credentials.h"
 #include "libcli/resolve/resolve.h"
 #include "param/param.h"
 
@@ -56,19 +52,23 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
        const char *host = torture_setting_string(tctx, "host", NULL);
        const char *share = torture_setting_string(tctx, "share", NULL);
        struct smbcli_options options;
+       struct smbcli_session_options session_options;
 
-       lp_smbcli_options(tctx->lp_ctx, &options);
+       lpcfg_smbcli_options(tctx->lp_ctx, &options);
+       lpcfg_smbcli_session_options(tctx->lp_ctx, &session_options);
 
        status = smbcli_full_connection(tctx, &cli, host, 
-                                       lp_smb_ports(tctx->lp_ctx),
-                                       share, NULL,
-                                       cmdline_credentials, 
-                                       lp_resolve_context(tctx->lp_ctx),
-                                       tctx->ev, &options);
+                                       lpcfg_smb_ports(tctx->lp_ctx),
+                                       share, NULL, lpcfg_socket_options(tctx->lp_ctx),
+                                       popt_get_cmdline_credentials(),
+                                       lpcfg_resolve_context(tctx->lp_ctx),
+                                       tctx->ev, &options, &session_options,
+                                       lpcfg_gensec_settings(tctx, tctx->lp_ctx));
 
        if (!NT_STATUS_IS_OK(status)) {
-               printf("failed to connect to //%s/%s: %s\n",
-                       host, share, nt_errstr(status));
+               torture_comment(tctx, "failed to connect to //%s/%s: %s\n",
+                              host, share, nt_errstr(status));
+               torture_fail(tctx, "Failed to connect to server");
                return NULL;
        }
 
@@ -197,9 +197,9 @@ static bool query_path_info2(void *mem_ctx,
                        -1, fname, info2);
 }
 
-static bool search_callback(void *private, const union smb_search_data *fdata)
+static bool search_callback(void *private_data, const union smb_search_data *fdata)
 {
-       struct unix_info2 *info2 = (struct unix_info2 *)private;
+       struct unix_info2 *info2 = (struct unix_info2 *)private_data;
 
        info2->end_of_file = fdata->unix_info2.end_of_file;
        info2->num_bytes = fdata->unix_info2.num_bytes;