summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 15:53:07 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:27 +0100
commit0a2f1a46a02d2c9497d05d7e534829dc6e9430dc (patch)
tree5647b3b0b98f97abc84a47a19613938345e0384c /source4/torture/raw
parent53ae9bc9f6f66578948c3995073bdc1f1acae0f1 (diff)
downloadsamba-0a2f1a46a02d2c9497d05d7e534829dc6e9430dc.tar.gz
samba-0a2f1a46a02d2c9497d05d7e534829dc6e9430dc.tar.bz2
samba-0a2f1a46a02d2c9497d05d7e534829dc6e9430dc.zip
r26249: Remove a couple more uses of global_loadparm.
(This used to be commit 80a61200508a00d5b16a3e748ce92d54b9fefcd2)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/eas.c2
-rw-r--r--source4/torture/raw/lockbench.c6
-rw-r--r--source4/torture/raw/notify.c32
-rw-r--r--source4/torture/raw/open.c4
-rw-r--r--source4/torture/raw/openbench.c6
-rw-r--r--source4/torture/raw/oplock.c2
-rwxr-xr-xsource4/torture/raw/pingpong.c2
-rw-r--r--source4/torture/raw/samba3hide.c4
-rw-r--r--source4/torture/raw/samba3misc.c12
9 files changed, 37 insertions, 33 deletions
diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c
index 53449a1505..bc4473b17a 100644
--- a/source4/torture/raw/eas.c
+++ b/source4/torture/raw/eas.c
@@ -469,7 +469,7 @@ bool torture_max_eas(struct torture_context *torture)
struct smbcli_state *cli;
bool ret = true;
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, torture, 0)) {
return false;
}
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index 633264ce0a..81016fc563 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -42,6 +42,7 @@ static int num_connected;
enum lock_stage {LOCK_INITIAL, LOCK_LOCK, LOCK_UNLOCK};
struct benchlock_state {
+ struct torture_context *tctx;
struct event_context *ev;
struct smbcli_tree *tree;
TALLOC_CTX *mem_ctx;
@@ -178,7 +179,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
state->te = NULL;
- if (!torture_get_conn_index(state->client_num, state->mem_ctx, &host, &share)) {
+ if (!torture_get_conn_index(state->client_num, state->mem_ctx, state->tctx, &host, &share)) {
DEBUG(0,("Can't find host/share for reconnect?!\n"));
exit(1);
}
@@ -324,10 +325,11 @@ bool torture_bench_lock(struct torture_context *torture)
printf("Opening %d connections\n", nprocs);
for (i=0;i<nprocs;i++) {
+ state[i].tctx = torture;
state[i].mem_ctx = talloc_new(state);
state[i].client_num = i;
state[i].ev = ev;
- if (!torture_open_connection_ev(&cli, i, ev)) {
+ if (!torture_open_connection_ev(&cli, i, torture, ev)) {
return false;
}
talloc_steal(mem_ctx, state);
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index 8687e8e952..2967abdbe3 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -836,7 +836,7 @@ done:
/*
basic testing of change notifies followed by a tdis
*/
-static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
+static bool test_notify_tdis(struct torture_context *tctx)
{
bool ret = true;
NTSTATUS status;
@@ -848,7 +848,7 @@ static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY TDIS\n");
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -868,7 +868,7 @@ static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = BASEDIR;
- status = smb_raw_open(cli->tree, mem_ctx, &io);
+ status = smb_raw_open(cli->tree, tctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatex.out.file.fnum;
@@ -886,7 +886,7 @@ static bool test_notify_tdis(TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
cli->tree = NULL;
- status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+ status = smb_raw_changenotify_recv(req, tctx, &notify);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(notify.nttrans.out.num_changes, 0);
@@ -898,7 +898,7 @@ done:
/*
basic testing of change notifies followed by a exit
*/
-static bool test_notify_exit(TALLOC_CTX *mem_ctx)
+static bool test_notify_exit(struct torture_context *tctx)
{
bool ret = true;
NTSTATUS status;
@@ -910,7 +910,7 @@ static bool test_notify_exit(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY EXIT\n");
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -930,7 +930,7 @@ static bool test_notify_exit(TALLOC_CTX *mem_ctx)
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = BASEDIR;
- status = smb_raw_open(cli->tree, mem_ctx, &io);
+ status = smb_raw_open(cli->tree, tctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatex.out.file.fnum;
@@ -947,7 +947,7 @@ static bool test_notify_exit(TALLOC_CTX *mem_ctx)
status = smb_raw_exit(cli->session);
CHECK_STATUS(status, NT_STATUS_OK);
- status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+ status = smb_raw_changenotify_recv(req, tctx, &notify);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(notify.nttrans.out.num_changes, 0);
@@ -959,7 +959,7 @@ done:
/*
basic testing of change notifies followed by a ulogoff
*/
-static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
+static bool test_notify_ulogoff(struct torture_context *tctx)
{
bool ret = true;
NTSTATUS status;
@@ -971,7 +971,7 @@ static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY ULOGOFF\n");
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -991,7 +991,7 @@ static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = BASEDIR;
- status = smb_raw_open(cli->tree, mem_ctx, &io);
+ status = smb_raw_open(cli->tree, tctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatex.out.file.fnum;
@@ -1008,7 +1008,7 @@ static bool test_notify_ulogoff(TALLOC_CTX *mem_ctx)
status = smb_raw_ulogoff(cli->session);
CHECK_STATUS(status, NT_STATUS_OK);
- status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+ status = smb_raw_changenotify_recv(req, tctx, &notify);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(notify.nttrans.out.num_changes, 0);
@@ -1027,7 +1027,7 @@ static void tcp_dis_handler(struct smbcli_transport *t, void *p)
/*
basic testing of change notifies followed by tcp disconnect
*/
-static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
+static bool test_notify_tcp_dis(struct torture_context *tctx)
{
bool ret = true;
NTSTATUS status;
@@ -1039,7 +1039,7 @@ static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
printf("TESTING CHANGE NOTIFY FOLLOWED BY TCP DISCONNECT\n");
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
return false;
}
@@ -1059,7 +1059,7 @@ static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = BASEDIR;
- status = smb_raw_open(cli->tree, mem_ctx, &io);
+ status = smb_raw_open(cli->tree, tctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
fnum = io.ntcreatex.out.file.fnum;
@@ -1075,7 +1075,7 @@ static bool test_notify_tcp_dis(TALLOC_CTX *mem_ctx)
smbcli_transport_idle_handler(cli->transport, tcp_dis_handler, 250, cli);
- status = smb_raw_changenotify_recv(req, mem_ctx, &notify);
+ status = smb_raw_changenotify_recv(req, tctx, &notify);
CHECK_STATUS(status, NT_STATUS_LOCAL_DISCONNECT);
done:
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index fb81f7d55c..47f32b619b 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -1363,7 +1363,7 @@ static bool test_raw_open_multi(struct torture_context *tctx)
return false;
}
- if (!torture_open_connection_share(mem_ctx, &cli, host, share, ev)) {
+ if (!torture_open_connection_share(mem_ctx, &cli, tctx, host, share, ev)) {
return false;
}
@@ -1371,7 +1371,7 @@ static bool test_raw_open_multi(struct torture_context *tctx)
for (i=0; i<num_files; i++) {
if (!torture_open_connection_share(mem_ctx, &(clients[i]),
- host, share, ev)) {
+ tctx, host, share, ev)) {
DEBUG(0, ("Could not open %d'th connection\n", i));
return false;
}
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index a53efb3a8b..3eec9fbb13 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -42,6 +42,7 @@ static int num_connected;
static struct timed_event *report_te;
struct benchopen_state {
+ struct torture_context *tctx;
TALLOC_CTX *mem_ctx;
struct event_context *ev;
struct smbcli_state *cli;
@@ -116,7 +117,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
state->te = NULL;
- if (!torture_get_conn_index(state->client_num, state->mem_ctx, &host, &share)) {
+ if (!torture_get_conn_index(state->client_num, state->mem_ctx, state->tctx, &host, &share)) {
DEBUG(0,("Can't find host/share for reconnect?!\n"));
exit(1);
}
@@ -358,10 +359,11 @@ bool torture_bench_open(struct torture_context *torture)
printf("Opening %d connections\n", nprocs);
for (i=0;i<nprocs;i++) {
+ state[i].tctx = torture;
state[i].mem_ctx = talloc_new(state);
state[i].client_num = i;
state[i].ev = ev;
- if (!torture_open_connection_ev(&state[i].cli, i, ev)) {
+ if (!torture_open_connection_ev(&state[i].cli, i, torture, ev)) {
return false;
}
talloc_steal(mem_ctx, state);
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index e642c1846c..952088e46c 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -1325,7 +1325,7 @@ bool torture_bench_oplock(struct torture_context *torture)
torture_comment(torture, "Opening %d connections\n", torture_nprocs);
for (i=0;i<torture_nprocs;i++) {
- if (!torture_open_connection_ev(&cli[i], i, ev)) {
+ if (!torture_open_connection_ev(&cli[i], i, torture, ev)) {
return false;
}
talloc_steal(mem_ctx, cli[i]);
diff --git a/source4/torture/raw/pingpong.c b/source4/torture/raw/pingpong.c
index 3174021f7b..ca56f190a9 100755
--- a/source4/torture/raw/pingpong.c
+++ b/source4/torture/raw/pingpong.c
@@ -207,7 +207,7 @@ bool torture_ping_pong(struct torture_context *torture)
do_writes = torture_setting_bool(torture, "write", false);
lock_timeout = torture_setting_int(torture, "lock_timeout", 100000);
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, torture, 0)) {
DEBUG(0,("Could not open connection\n"));
return false;
}
diff --git a/source4/torture/raw/samba3hide.c b/source4/torture/raw/samba3hide.c
index 8fe3aa4d2d..814b5f57f4 100644
--- a/source4/torture/raw/samba3hide.c
+++ b/source4/torture/raw/samba3hide.c
@@ -135,7 +135,7 @@ bool torture_samba3_hide(struct torture_context *torture)
struct smbcli_tree *hideunwrite;
if (!torture_open_connection_share(
- torture, &cli, torture_setting_string(torture, "host", NULL),
+ torture, &cli, torture, torture_setting_string(torture, "host", NULL),
torture_setting_string(torture, "share", NULL), NULL)) {
d_printf("torture_open_connection_share failed\n");
return false;
@@ -283,7 +283,7 @@ bool torture_samba3_closeerr(struct torture_context *tctx)
const char *fname = "closeerr.dir\\closerr.txt";
int fnum;
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
goto fail;
}
diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index a075277efb..749b10cc07 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -54,7 +54,7 @@ bool torture_samba3_checkfsp(struct torture_context *torture)
}
if (!torture_open_connection_share(
- torture, &cli, torture_setting_string(torture, "host", NULL),
+ torture, &cli, torture, torture_setting_string(torture, "host", NULL),
torture_setting_string(torture, "share", NULL), NULL)) {
d_printf("torture_open_connection_share failed\n");
ret = false;
@@ -351,7 +351,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
goto fail;
}
- if (!torture_open_connection(&cli_nt, 0)) {
+ if (!torture_open_connection(&cli_nt, torture, 0)) {
goto fail;
}
@@ -360,7 +360,7 @@ bool torture_samba3_badpath(struct torture_context *torture)
goto fail;
}
- if (!torture_open_connection(&cli_dos, 1)) {
+ if (!torture_open_connection(&cli_dos, torture, 1)) {
goto fail;
}
@@ -626,7 +626,7 @@ bool torture_samba3_caseinsensitive(struct torture_context *torture)
return false;
}
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, torture, 0)) {
goto done;
}
@@ -692,7 +692,7 @@ bool torture_samba3_posixtimedlock(struct torture_context *tctx)
struct smb_lock_entry lock_entry;
struct smbcli_request *req;
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
ret = false;
goto done;
}
@@ -827,7 +827,7 @@ bool torture_samba3_rootdirfid(struct torture_context *tctx)
const char *fname = "testfile";
bool ret = false;
- if (!torture_open_connection(&cli, 0)) {
+ if (!torture_open_connection(&cli, tctx, 0)) {
ret = false;
goto done;
}