summaryrefslogtreecommitdiff
path: root/source4/torture/nbench
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-01 23:10:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:23 -0500
commitcbf0a4c362fc292518400a9ccf38a5d3d8ce80f6 (patch)
tree626ad32e0ca3136ffcfd6756b04341b768d864ee /source4/torture/nbench
parentb035f3416839bb75c059035d2a2f9bfe9b810b6f (diff)
downloadsamba-cbf0a4c362fc292518400a9ccf38a5d3d8ce80f6.tar.gz
samba-cbf0a4c362fc292518400a9ccf38a5d3d8ce80f6.tar.bz2
samba-cbf0a4c362fc292518400a9ccf38a5d3d8ce80f6.zip
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)
Diffstat (limited to 'source4/torture/nbench')
-rw-r--r--source4/torture/nbench/nbench.c19
1 files changed, 14 insertions, 5 deletions
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);