From 48e3bf2e9579abcf8dc07d7a33a1e44b4abc1a12 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Wed, 5 Mar 2003 23:29:36 +0000 Subject: Add code to allow us to specify the port to connect on when performing a test ... (This used to be commit 1128a2fb4c16681e669efe605ff7d7161a2f7acd) --- source3/torture/torture.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source3') 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; -- cgit