summaryrefslogtreecommitdiff
path: root/source3/torture/masktest.c
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2002-03-22 00:09:09 +0000
committerHerb Lewis <herb@samba.org>2002-03-22 00:09:09 +0000
commit2e39a46942419b623f40e950b8b2be61cef8be29 (patch)
treecc258a4259f4e43279418a37f537cbc6c55416ff /source3/torture/masktest.c
parent87eb1ffd5577c2cd3f0524da3ff7ffce0b407825 (diff)
downloadsamba-2e39a46942419b623f40e950b8b2be61cef8be29.tar.gz
samba-2e39a46942419b623f40e950b8b2be61cef8be29.tar.bz2
samba-2e39a46942419b623f40e950b8b2be61cef8be29.zip
add a -n maxloops option so this can be run in a script and end after a
certain number of iterations. (This used to be commit bdac7cb9c5bdd52db06b2507d8660bc1c9debea5)
Diffstat (limited to 'source3/torture/masktest.c')
-rw-r--r--source3/torture/masktest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index 0e0b531080..637e9ef63a 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -32,6 +32,7 @@ static char *maskchars = "<>\"?*abc.";
static char *filechars = "abcdefghijklm.";
static int verbose;
static int die_on_error;
+static int NumLoops = 0;
/* a test fn for LANMAN mask support */
int ms_fnmatch_lanman_core(char *pattern, char *string)
@@ -380,6 +381,8 @@ static void test_mask(int argc, char *argv[],
if (strspn(file+l, ".") == strlen(file+l)) continue;
testpair(cli, mask, file);
+ if (NumLoops && (--NumLoops == 0))
+ break;
}
finished:
@@ -394,6 +397,7 @@ static void usage(void)
masktest //server/share [options..]\n\
options:\n\
-d debuglevel\n\
+ -n numloops\n\
-W workgroup\n\
-U user%%pass\n\
-s seed\n\
@@ -455,8 +459,11 @@ static void usage(void)
seed = time(NULL);
- while ((opt = getopt(argc, argv, "d:U:s:hm:f:aoW:M:vE")) != EOF) {
+ while ((opt = getopt(argc, argv, "n:d:U:s:hm:f:aoW:M:vE")) != EOF) {
switch (opt) {
+ case 'n':
+ NumLoops = atoi(optarg);
+ break;
case 'd':
DEBUGLEVEL = atoi(optarg);
break;