summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-10 02:16:41 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:36 -0500
commit1c3bfc270ac3c6cb407776d586bcd3872b45967c (patch)
treeae064939f26e5f1cb8fa6556202490a5efe76b38
parent696629b2ecc471384fb0a4cd6619743665311fe3 (diff)
downloadsamba-1c3bfc270ac3c6cb407776d586bcd3872b45967c.tar.gz
samba-1c3bfc270ac3c6cb407776d586bcd3872b45967c.tar.bz2
samba-1c3bfc270ac3c6cb407776d586bcd3872b45967c.zip
r2271: fixed the popt argument array for smbtorture, getting rid of some
clashes metze, please note that the 'val' field in popt is not the default value, its the integer to switch on in the argument loop. (This used to be commit 0f3b01bebadc9f949a663dc40280945536bc86fd)
-rw-r--r--source4/torture/torture.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 863fe9d4f5..efcd4f2e2e 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -4034,7 +4034,7 @@ double torture_create_procs(BOOL (*fn)(struct smbcli_state *, int), BOOL *result
if (p) {
unc_list = file_lines_load(p, &num_unc_names);
if (!unc_list || num_unc_names <= 0) {
- printf("Failed to load unc names list from %s\n", p);
+ printf("Failed to load unc names list from '%s'\n", p);
exit(1);
}
}
@@ -4381,21 +4381,22 @@ static void usage(poptContext pc)
int argc_new;
char **argv_new;
poptContext pc;
+ enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,OPT_DANGEROUS};
struct poptOption long_options[] = {
POPT_AUTOHELP
{"smb-ports", 'p', POPT_ARG_STRING, NULL, 0, "SMB ports", NULL},
- {"seed", 's', POPT_ARG_STRING, NULL, 0, "seed", NULL},
- {"num-progs", 'N', POPT_ARG_INT, &torture_nprocs, 4, "num progs", NULL},
- {"num-ops", 'o', POPT_ARG_INT, &torture_numops, 100, "num ops", NULL},
- {"entries", 'e', POPT_ARG_INT, &torture_entries, 1000, "entries", NULL},
- {"use-oplocks", 'L', POPT_ARG_NONE, &use_oplocks, True, "use oplocks", NULL},
- {"show-all", 'A', POPT_ARG_NONE, &torture_showall, True, "show all", NULL},
- {"loadfile", 'c', POPT_ARG_STRING, NULL, 0, "loadfile", NULL},
- {"unclist", 'C', POPT_ARG_STRING, NULL, 0, "unclist", NULL},
- {"timelimit", 't', POPT_ARG_STRING, NULL, 0, "timelimit", NULL},
- {"failures", 'f', POPT_ARG_INT, &torture_failures, 1, "failures", NULL},
- {"parse-dns", 'D', POPT_ARG_STRING, NULL, 0, "parse-dns", NULL},
- {"dangerous", 'X', POPT_ARG_NONE, NULL, 0, "dangerous", NULL},
+ {"seed", 0, POPT_ARG_STRING, NULL, 0, "seed", NULL},
+ {"num-progs", 0, POPT_ARG_INT, &torture_nprocs, 0, "num progs", NULL},
+ {"num-ops", 0, POPT_ARG_INT, &torture_numops, 0, "num ops", NULL},
+ {"entries", 0, POPT_ARG_INT, &torture_entries, 0, "entries", NULL},
+ {"use-oplocks", 'L', POPT_ARG_NONE, &use_oplocks, 0, "use oplocks", NULL},
+ {"show-all", 'A', POPT_ARG_NONE, &torture_showall, 0, "show all", NULL},
+ {"loadfile", 0, POPT_ARG_STRING, NULL, OPT_LOADFILE, "loadfile", NULL},
+ {"unclist", 0, POPT_ARG_STRING, NULL, OPT_UNCLIST, "unclist", NULL},
+ {"timelimit", 't', POPT_ARG_STRING, NULL, OPT_TIMELIMIT, "timelimit", NULL},
+ {"failures", 'f', POPT_ARG_INT, &torture_failures, 0, "failures", NULL},
+ {"parse-dns", 'D', POPT_ARG_STRING, NULL, OPT_DNS, "parse-dns", NULL},
+ {"dangerous", 'X', POPT_ARG_NONE, NULL, OPT_DANGEROUS, "dangerous", NULL},
POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION
POPT_COMMON_CREDENTIALS
@@ -4416,23 +4417,21 @@ static void usage(poptContext pc)
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
- case 'c':
+ case OPT_LOADFILE:
lp_set_cmdline("torture:loadfile", poptGetOptArg(pc));
break;
- case 'C':
+ case OPT_UNCLIST:
lp_set_cmdline("torture:unclist", poptGetOptArg(pc));
break;
- case 't':
+ case OPT_TIMELIMIT:
lp_set_cmdline("torture:timelimit", poptGetOptArg(pc));
break;
- case 'D':
+ case OPT_DNS:
parse_dns(poptGetOptArg(pc));
break;
-
- case 'X':
+ case OPT_DANGEROUS:
lp_set_cmdline("torture:dangerous", "1");
break;
-
default:
d_printf("Invalid option %s: %s\n",
poptBadOption(pc, 0), poptStrerror(opt));