summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-06-25 02:40:37 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-25 11:32:59 +0200
commit0802f354ea837b8884c861d6d98f20aa746e4445 (patch)
tree29aac82f37b5d29fbd9fe5d2dc35341377e0b459 /source4/torture
parent653b30f91f7f9e13f16d5d6134adaa04b0675257 (diff)
downloadsamba-0802f354ea837b8884c861d6d98f20aa746e4445.tar.gz
samba-0802f354ea837b8884c861d6d98f20aa746e4445.tar.bz2
samba-0802f354ea837b8884c861d6d98f20aa746e4445.zip
smbtorture: Fix loading of --load-list.
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/smbtorture.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 14eeff93ab..978659990e 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -410,9 +410,10 @@ int main(int argc,char *argv[])
int num_extra_users = 0;
char **restricted = NULL;
int num_restricted = -1;
+ const char *load_list = NULL;
enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST,
OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS,
- OPT_EXTRA_USER,OPT_LOAD_LIST,};
+ OPT_EXTRA_USER,};
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -442,7 +443,7 @@ int main(int argc,char *argv[])
"set maximum time for smbtorture to live", "seconds"},
{"extra-user", 0, POPT_ARG_STRING, NULL, OPT_EXTRA_USER,
"extra user credentials", NULL},
- {"load-list", 0, POPT_ARG_STRING, NULL, OPT_LOAD_LIST,
+ {"load-list", 0, POPT_ARG_STRING, &load_list, 0,
"load a test id list from a text file", NULL},
POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION
@@ -496,14 +497,6 @@ int main(int argc,char *argv[])
talloc_free(option);
}
break;
- case OPT_LOAD_LIST:
- restricted = file_lines_load(optarg, &num_restricted, 0,
- talloc_autofree_context());
- if (restricted == NULL) {
- printf("Unable to read load list file '%s'\n", optarg);
- exit(1);
- }
- break;
default:
if (opt < 0) {
printf("bad command line option %d\n", opt);
@@ -512,6 +505,15 @@ int main(int argc,char *argv[])
}
}
+ if (load_list != NULL) {
+ restricted = file_lines_load(load_list, &num_restricted, 0,
+ talloc_autofree_context());
+ if (restricted == NULL) {
+ printf("Unable to read load list file '%s'\n", load_list);
+ exit(1);
+ }
+ }
+
if (strcmp(target, "samba3") == 0) {
lp_set_cmdline(cmdline_lp_ctx, "torture:samba3", "true");
lp_set_cmdline(cmdline_lp_ctx, "torture:resume_key_support", "false");