summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/gentest.c8
-rw-r--r--source4/torture/local/event.c4
-rw-r--r--source4/torture/masktest.c4
-rw-r--r--source4/torture/nbench/nbench.c17
-rw-r--r--source4/torture/nbench/nbio.c36
-rw-r--r--source4/torture/raw/composite.c2
6 files changed, 8 insertions, 63 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 0b0ab3f31c..9ad41f77e5 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -1,10 +1,3 @@
-/*
- add to build farm
- add masktest and locktest too
- add -W flag
- convert to popt_common
-*/
-
/*
Unix SMB/CIFS implementation.
generic testing tool
@@ -361,7 +354,6 @@ static int gen_int_range(uint_t min, uint_t max)
static uint16_t gen_root_fid(int instance)
{
if (gen_chance(5)) return gen_fnum(instance);
- if (gen_chance(2)) return BAD_HANDLE;
return 0;
}
diff --git a/source4/torture/local/event.c b/source4/torture/local/event.c
index ec26310e10..5dab65b693 100644
--- a/source4/torture/local/event.c
+++ b/source4/torture/local/event.c
@@ -107,9 +107,7 @@ static bool test_event_context(struct torture_context *torture_ctx,
event_add_timed(ev_ctx, ev_ctx, timeval_current_ofs(0,500),
timed_handler, fde);
- while (fde) {
- event_loop_once(ev_ctx);
- }
+ event_loop_wait(ev_ctx);
close(read_fd);
close(write_fd);
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 6528b386e9..d76a205f7c 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -1,7 +1,3 @@
-/*
- use popt_common code
-*/
-
/*
Unix SMB/CIFS implementation.
mask_match tester
diff --git a/source4/torture/nbench/nbench.c b/source4/torture/nbench/nbench.c
index eb67e15fbb..f671a5b0de 100644
--- a/source4/torture/nbench/nbench.c
+++ b/source4/torture/nbench/nbench.c
@@ -24,7 +24,6 @@
#include "torture/util.h"
#include "torture/torture.h"
#include "system/filesys.h"
-#include "system/locale.h"
#include "pstring.h"
#include "torture/nbench/proto.h"
@@ -45,6 +44,7 @@ static BOOL run_netbench(struct torture_context *tctx, struct smbcli_state *cli,
pstring line;
char *cname;
FILE *f;
+ const char **params;
BOOL correct = True;
if (torture_nprocs == 1) {
@@ -64,13 +64,9 @@ static BOOL run_netbench(struct torture_context *tctx, struct smbcli_state *cli,
return False;
}
-
again:
- nbio_time_reset();
-
while (fgets(line, sizeof(line)-1, f)) {
NTSTATUS status;
- const char **params0, **params;
nbench_line_count++;
@@ -78,16 +74,9 @@ again:
all_string_sub(line,"client1", cname, sizeof(line));
- params = params0 = str_list_make_shell(NULL, line, " ");
+ params = str_list_make_shell(NULL, line, " ");
i = str_list_length(params);
- if (i > 0 && isdigit(params[0][0])) {
- double targett = strtod(params[0], NULL);
- nbio_time_delay(targett);
- params++;
- i--;
- }
-
if (i < 2 || params[0][0] == '#') continue;
if (!strncmp(params[0],"SMB", 3)) {
@@ -157,7 +146,7 @@ again:
printf("[%d] Unknown operation %s\n", nbench_line_count, params[0]);
}
- talloc_free(params0);
+ talloc_free(params);
if (nb_tick()) goto done;
}
diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c
index 6335d53c92..cd68085169 100644
--- a/source4/torture/nbench/nbio.c
+++ b/source4/torture/nbench/nbio.c
@@ -53,25 +53,8 @@ static struct {
double bytes, warmup_bytes;
int line;
int done;
- double max_latency;
- struct timeval starttime;
} *children;
-void nbio_time_reset(void)
-{
- children[nbio_id].starttime = timeval_current();
-}
-
-void nbio_time_delay(double targett)
-{
- double elapsed = timeval_elapsed(&children[nbio_id].starttime);
- if (targett > elapsed) {
- msleep(1000*(targett - elapsed));
- } else if (elapsed - targett > children[nbio_id].max_latency) {
- children[nbio_id].max_latency = elapsed - targett;
- }
-}
-
double nbio_result(void)
{
int i;
@@ -82,19 +65,6 @@ double nbio_result(void)
return 1.0e-6 * total / timeval_elapsed2(&tv_start, &tv_end);
}
-double nbio_latency(void)
-{
- int i;
- double max_latency = 0;
- for (i=0;i<nprocs;i++) {
- if (children[i].max_latency > max_latency) {
- max_latency = children[i].max_latency;
- children[i].max_latency = 0;
- }
- }
- return max_latency;
-}
-
BOOL nb_tick(void)
{
return children[nbio_id].done;
@@ -152,9 +122,9 @@ void nb_alarm(int sig)
nprocs, lines/nprocs,
nbio_result(), t);
} else {
- printf("%4d %8d %.2f MB/sec execute %.0f sec latency %.2f msec \n",
+ printf("%4d %8d %.2f MB/sec execute %.0f sec \n",
nprocs, lines/nprocs,
- nbio_result(), t, nbio_latency() * 1.0e3);
+ nbio_result(), t);
}
fflush(stdout);
@@ -473,7 +443,7 @@ void nb_readx(int handle, off_t offset, int size, int ret_size, NTSTATUS status)
io.readx.in.remaining = 0;
io.readx.in.read_for_execute = False;
io.readx.out.data = buf;
-
+
ret = smb_raw_read(c->tree, &io);
free(buf);
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index 2cba5cee89..2dd079c4b0 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -162,7 +162,7 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
printf("testing parallel fetchfile with %d ops\n", torture_numops);
- event_ctx = event_context_find(mem_ctx);
+ event_ctx = event_context_init(mem_ctx);
c = talloc_array(mem_ctx, struct composite_context *, torture_numops);
for (i=0; i<torture_numops; i++) {