summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-06-02 08:33:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:24 -0500
commit21c71e0bed040e5079c03f3b53a3a5f53a578668 (patch)
treec51b9fc76280afeabebb3b8f68014f61856bb7dc /source4
parentdfbf6201297a39f339a179fbc8444b3748bf5012 (diff)
downloadsamba-21c71e0bed040e5079c03f3b53a3a5f53a578668.tar.gz
samba-21c71e0bed040e5079c03f3b53a3a5f53a578668.tar.bz2
samba-21c71e0bed040e5079c03f3b53a3a5f53a578668.zip
r976: - added -W for workgroup to locktest
- retry connections a few times when reconnecting (This used to be commit d0d0734845e37a2639ade2545bccef1615e17d63)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/locktest.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 10238c75a5..383520260c 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -108,6 +108,7 @@ static struct cli_state *connect_one(char *share, int snum)
fstring server, myname;
uint_t flags = 0;
NTSTATUS status;
+ int retries = 10;
fstrcpy(server,share+2);
share = strchr_m(server,'\\');
@@ -119,12 +120,17 @@ static struct cli_state *connect_one(char *share, int snum)
if (use_kerberos)
flags |= CLI_FULL_CONNECTION_USE_KERBEROS;
-
- status = cli_full_connection(&c, myname,
- server, NULL,
- share, "?????",
- username[snum], lp_workgroup(),
- password[snum], flags, NULL);
+
+ do {
+ status = cli_full_connection(&c, myname,
+ server, NULL,
+ share, "?????",
+ username[snum], lp_workgroup(),
+ password[snum], flags, NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ sleep(2);
+ }
+ } while (!NT_STATUS_IS_OK(status) && retries--);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
@@ -485,7 +491,7 @@ static void usage(void)
seed = time(NULL);
- while ((opt = getopt(argc, argv, "U:s:ho:aAW:OkR:B:M:EZ")) != EOF) {
+ while ((opt = getopt(argc, argv, "U:s:ho:aAW:OkR:B:M:EZW:")) != EOF) {
switch (opt) {
case 'k':
#ifdef HAVE_KRB5
@@ -542,6 +548,9 @@ static void usage(void)
case 'E':
exact_error_codes = True;
break;
+ case 'W':
+ lp_set_cmdline("workgroup", optarg);
+ break;
case 'h':
usage();
exit(1);