1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

smbtorture: add --extra-user option

This can we used to pass additional credentials to torture tests
(it can be used multiple times.

metze
(This used to be commit 4d80dbfac2)
This commit is contained in:
Stefan Metzmacher 2008-05-14 09:47:18 +02:00
parent a05c9ab939
commit 460356c976

View File

@ -540,8 +540,9 @@ int main(int argc,char *argv[])
const char *basedir = NULL; const char *basedir = NULL;
const char *extra_module = NULL; const char *extra_module = NULL;
static int list_tests = 0; static int list_tests = 0;
int num_extra_users = 0;
enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST, enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST,
OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS}; OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS,OPT_EXTRA_USER};
struct poptOption long_options[] = { struct poptOption long_options[] = {
POPT_AUTOHELP POPT_AUTOHELP
@ -569,6 +570,8 @@ int main(int argc,char *argv[])
"number of simultaneous async requests", NULL}, "number of simultaneous async requests", NULL},
{"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, 0, {"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, 0,
"set maximum time for smbtorture to live", "seconds"}, "set maximum time for smbtorture to live", "seconds"},
{"extra-user", 0, POPT_ARG_STRING, NULL, OPT_EXTRA_USER,
"extra user credentials", NULL},
POPT_COMMON_SAMBA POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION POPT_COMMON_CONNECTION
POPT_COMMON_CREDENTIALS POPT_COMMON_CREDENTIALS
@ -612,6 +615,15 @@ int main(int argc,char *argv[])
case OPT_SMB_PORTS: case OPT_SMB_PORTS:
lp_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc)); lp_set_cmdline(cmdline_lp_ctx, "smb ports", poptGetOptArg(pc));
break; break;
case OPT_EXTRA_USER:
{
char *option = talloc_asprintf(NULL, "torture:extra_user%u",
++num_extra_users);
char *value = poptGetOptArg(pc);
lp_set_cmdline(cmdline_lp_ctx, option, value);
talloc_free(option);
}
break;
} }
} }