summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2003-03-05 23:29:36 +0000
committerRichard Sharpe <sharpe@samba.org>2003-03-05 23:29:36 +0000
commit48e3bf2e9579abcf8dc07d7a33a1e44b4abc1a12 (patch)
treea7c200426e872fb11808216aa720513b09b4a79d /source3/torture
parent487a0562859e393e12b91eed17ab893236764763 (diff)
downloadsamba-48e3bf2e9579abcf8dc07d7a33a1e44b4abc1a12.tar.gz
samba-48e3bf2e9579abcf8dc07d7a33a1e44b4abc1a12.tar.bz2
samba-48e3bf2e9579abcf8dc07d7a33a1e44b4abc1a12.zip
Add code to allow us to specify the port to connect on when performing
a test ... (This used to be commit 1128a2fb4c16681e669efe605ff7d7161a2f7acd)
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index fe53baae7e..1744d3109c 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -26,6 +26,7 @@ static fstring host, workgroup, share, password, username, myname;
static int max_protocol = PROTOCOL_NT1;
static const char *sockops="TCP_NODELAY";
static int nprocs=1;
+static int port_to_use=0;
int torture_numops=100;
static int procnum; /* records process count number when forking */
static struct cli_state current_cli;
@@ -104,7 +105,14 @@ static BOOL open_nbt_connection(struct cli_state *c)
zero_ip(&ip);
- if (!cli_initialise(c) || !cli_connect(c, host, &ip)) {
+ if (!cli_initialise(c)) {
+ printf("Failed initialize cli_struct to connect with %s\n", host);
+ return False;
+ }
+
+ c->port = port_to_use;
+
+ if (!cli_connect(c, host, &ip)) {
printf("Failed to connect with %s\n", host);
return False;
}
@@ -4191,6 +4199,7 @@ static void usage(void)
printf("\t-L use oplocks\n");
printf("\t-c CLIENT.TXT specify client load file for NBENCH\n");
printf("\t-A showall\n");
+ printf("\t-p port\n");
printf("\t-s seed\n");
printf("\n\n");
@@ -4205,10 +4214,6 @@ static void usage(void)
exit(1);
}
-
-
-
-
/****************************************************************************
main program
****************************************************************************/
@@ -4264,8 +4269,11 @@ static void usage(void)
fstrcpy(workgroup, lp_workgroup());
- while ((opt = getopt(argc, argv, "hW:U:n:N:O:o:m:Ld:Ac:ks:")) != EOF) {
+ while ((opt = getopt(argc, argv, "p:hW:U:n:N:O:o:m:Ld:Ac:ks:")) != EOF) {
switch (opt) {
+ case 'p':
+ port_to_use = atoi(optarg);
+ break;
case 's':
srandom(atoi(optarg));
break;