From 2e39a46942419b623f40e950b8b2be61cef8be29 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Fri, 22 Mar 2002 00:09:09 +0000 Subject: 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) --- source3/torture/masktest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; -- cgit