diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-12 02:15:29 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:49:42 +0100 |
commit | 4b0199a5493ea2b88558cc40871e63c1dc8dbb56 (patch) | |
tree | 684450d46a7787e2f3a2a1b20ac0488c1ca8e94f /source4/torture/locktest2.c | |
parent | 33582dffcc2d348dc042edfdcccee7500b21d928 (diff) | |
download | samba-4b0199a5493ea2b88558cc40871e63c1dc8dbb56.tar.gz samba-4b0199a5493ea2b88558cc40871e63c1dc8dbb56.tar.xz samba-4b0199a5493ea2b88558cc40871e63c1dc8dbb56.zip |
r26409: Pass smb ports along.
(This used to be commit 2833f320de1f1fd39c710ad0a61c3fa1bb1df31f)
Diffstat (limited to 'source4/torture/locktest2.c')
-rw-r--r-- | source4/torture/locktest2.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c index 1dfefc15ed..db323e1391 100644 --- a/source4/torture/locktest2.c +++ b/source4/torture/locktest2.c @@ -136,7 +136,7 @@ static bool try_unlock(struct smbcli_state *c, int fstype, /***************************************************** return a connection to a server *******************************************************/ -static struct smbcli_state *connect_one(char *share) +static struct smbcli_state *connect_one(char *share, const char **ports) { struct smbcli_state *c; char *server_n; @@ -163,7 +163,7 @@ static struct smbcli_state *connect_one(char *share) slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++); nt_status = smbcli_full_connection(NULL, - &c, myname, server_n, 0, share, NULL, + &c, myname, server_n, ports, share, NULL, username, lp_workgroup(), password, NULL); if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status))); @@ -179,6 +179,7 @@ static struct smbcli_state *connect_one(char *share) static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], char *nfs[NSERVERS], int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES], + const char **ports, char *share1, char *share2) { int server, conn, f, fstype; @@ -197,7 +198,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], smbcli_ulogoff(cli[server][conn]); talloc_free(cli[server][conn]); } - cli[server][conn] = connect_one(share[server]); + cli[server][conn] = connect_one(share[server], ports); if (!cli[server][conn]) { DEBUG(0,("Failed to connect to %s\n", share[server])); exit(1); @@ -343,7 +344,7 @@ static int retest(struct smbcli_state *cli[NSERVERS][NCONNECTIONS], we then do random locking ops in tamdem on the 4 fnums from each server and ensure that the results match */ -static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath2) +static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath2, const char **ports) { struct smbcli_state *cli[NSERVERS][NCONNECTIONS]; char *nfs[NSERVERS]; @@ -372,7 +373,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath recorded[n].needed = true; } - reconnect(cli, nfs, fnum, share1, share2); + reconnect(cli, nfs, fnum, share1, share2, ports); open_files(cli, nfs, fnum); n = retest(cli, nfs, fnum, numops); @@ -383,7 +384,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath n1 = n; close_files(cli, nfs, fnum); - reconnect(cli, nfs, fnum, share1, share2); + reconnect(cli, nfs, fnum, share1, share2, ports); open_files(cli, nfs, fnum); for (i=0;i<n-1;i++) { @@ -410,7 +411,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath } close_files(cli, nfs, fnum); - reconnect(cli, nfs, fnum, share1, share2); + reconnect(cli, nfs, fnum, share1, share2, ports); open_files(cli, nfs, fnum); showall = true; n1 = retest(cli, nfs, fnum, n); @@ -538,7 +539,7 @@ static void usage(void) srandom(seed); locking_init(1); - test_locks(share1, share2, nfspath1, nfspath2); + test_locks(share1, share2, nfspath1, nfspath2, lp_smb_ports(lp_ctx)); return(0); } |