From cbf0a4c362fc292518400a9ccf38a5d3d8ce80f6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 1 Jun 2005 23:10:11 +0000 Subject: r7178: If we're using one process in NETBENCH simultion only open one connection to the server. Makes valgrind/cachegrind on the server easier. Jeremy. (This used to be commit fba9462591864a4efcfae653e1cef81f08299f92) --- source4/torture/nbench/nbench.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source4/torture/nbench/nbench.c') diff --git a/source4/torture/nbench/nbench.c b/source4/torture/nbench/nbench.c index 748ff90467..7d29349441 100644 --- a/source4/torture/nbench/nbench.c +++ b/source4/torture/nbench/nbench.c @@ -32,6 +32,7 @@ static const char *loadfile; /* run a test that simulates an approximate netbench client load */ static BOOL run_netbench(struct smbcli_state *cli, int client) { + extern int torture_nprocs; int i; pstring line; char *cname; @@ -40,6 +41,12 @@ static BOOL run_netbench(struct smbcli_state *cli, int client) const char *p; BOOL correct = True; + if (torture_nprocs == 1) { + if (!torture_setup_dir(cli, "\\clients")) { + return False; + } + } + nb_setup(cli, client); asprintf(&cname, "client%d", client+1); @@ -173,12 +180,14 @@ BOOL torture_nbench(void) loadfile = "client.txt"; } - if (!torture_open_connection(&cli)) { - return False; - } + if (torture_nprocs > 1) { + if (!torture_open_connection(&cli)) { + return False; + } - if (!torture_setup_dir(cli, "\\clients")) { - return False; + if (!torture_setup_dir(cli, "\\clients")) { + return False; + } } nbio_shmem(torture_nprocs, timelimit, warmup); -- cgit