summaryrefslogtreecommitdiff
path: root/source4/torture/nbench/nbench.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/nbench/nbench.c')
-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);