#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/security.h"
#include "auth/credentials/credentials.h"
+#include "libcli/resolve/resolve.h"
#include "auth/gensec/gensec.h"
#include "param/param.h"
#include "dynconfig.h"
/*****************************************************
connect to the servers
*******************************************************/
-static bool connect_servers(void)
+static bool connect_servers(struct loadparm_context *lp_ctx)
{
int i, j;
for (i=0;i<NSERVERS;i++) {
for (j=0;j<NINSTANCES;j++) {
+ struct smbcli_options smb_options;
NTSTATUS status;
printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
servers[i].server_name, servers[i].share_name,
cli_credentials_set_workstation(servers[i].credentials,
"gentest", CRED_SPECIFIED);
+ lp_smbcli_options(lp_ctx, &smb_options);
status = smbcli_full_connection(NULL, &servers[i].cli[j],
servers[i].server_name,
+ lp_smb_ports(lp_ctx),
servers[i].share_name, NULL,
- servers[i].credentials, NULL);
+ servers[i].credentials,
+ lp_resolve_context(lp_ctx),
+ NULL, &smb_options);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
servers[i].server_name, servers[i].share_name,
case RAW_FILEINFO_UNIX_BASIC:
case RAW_FILEINFO_UNIX_LINK:
case RAW_FILEINFO_SMB2_ALL_EAS:
- case RAW_FILEINFO_SMB2_ALL_INFORMATION:
+ case RAW_FILEINFO_SMB2_ALL_INFORMATION:
+ case RAW_FILEINFO_UNIX_INFO2:
break;
}
case RAW_SFILEINFO_1032:
case RAW_SFILEINFO_1039:
case RAW_SFILEINFO_1040:
+ case RAW_SFILEINFO_UNIX_INFO2:
/* Untested */
break;
}
run the test with the current set of op_parms parameters
return the number of operations that completed successfully
*/
-static int run_test(void)
+static int run_test(struct loadparm_context *lp_ctx)
{
int op, i;
- if (!connect_servers()) {
+ if (!connect_servers(lp_ctx)) {
printf("Failed to connect to servers\n");
exit(1);
}
perform a backtracking analysis of the minimal set of operations
to generate an error
*/
-static void backtrack_analyze(void)
+static void backtrack_analyze(struct loadparm_context *lp_ctx)
{
int chunk, ret;
}
printf("Testing %d ops with %d-%d disabled\n",
options.numops, base, max-1);
- ret = run_test();
+ ret = run_test(lp_ctx);
printf("Completed %d of %d ops\n", ret, options.numops);
for (i=base;i<max; i++) {
op_parms[i].disabled = false;
} while (chunk > 0);
printf("Reduced to %d ops\n", options.numops);
- ret = run_test();
+ ret = run_test(lp_ctx);
if (ret != options.numops - 1) {
printf("Inconsistent result? ret=%d numops=%d\n", ret, options.numops);
}
/*
start the main gentest process
*/
-static bool start_gentest(void)
+static bool start_gentest(struct loadparm_context *lp_ctx)
{
int op;
int ret;
}
}
- ret = run_test();
+ ret = run_test(lp_ctx);
if (ret != options.numops && options.analyze) {
options.numops = ret+1;
- backtrack_analyze();
+ backtrack_analyze(lp_ctx);
} else if (options.analyze_always) {
- backtrack_analyze();
+ backtrack_analyze(lp_ctx);
} else if (options.analyze_continuous) {
- while (run_test() == options.numops) ;
+ while (run_test(lp_ctx) == options.numops) ;
}
return ret == options.numops;
int opt;
int i, username_count=0;
bool ret;
+ struct loadparm_context *lp_ctx;
setlinebuf(stdout);
argc -= NSERVERS;
argv += NSERVERS;
- lp_load(dyn_CONFIGFILE);
+ lp_ctx = loadparm_init(talloc_autofree_context());
+ lp_load(lp_ctx, dyn_CONFIGFILE);
servers[0].credentials = cli_credentials_init(talloc_autofree_context());
servers[1].credentials = cli_credentials_init(talloc_autofree_context());
- cli_credentials_guess(servers[0].credentials);
- cli_credentials_guess(servers[1].credentials);
+ cli_credentials_guess(servers[0].credentials, lp_ctx);
+ cli_credentials_guess(servers[1].credentials, lp_ctx);
options.seed = time(NULL);
options.numops = 1000;
}
}
- gensec_init();
+ gensec_init(lp_ctx);
if (username_count == 0) {
usage();
printf("seed=%u\n", options.seed);
- ret = start_gentest();
+ ret = start_gentest(lp_ctx);
if (ret) {
printf("gentest completed - no errors\n");