summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/gentest.c7
-rw-r--r--source4/torture/smb2/read.c1
-rw-r--r--source4/torture/smb2/scan.c11
-rw-r--r--source4/torture/smb2/util.c5
4 files changed, 15 insertions, 9 deletions
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index fd6bd5cc0a..07d394fad6 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -213,6 +213,9 @@ static bool connect_servers(struct event_context *ev,
for (i=0;i<NSERVERS;i++) {
for (j=0;j<NINSTANCES;j++) {
NTSTATUS status;
+ struct smbcli_options smb_options;
+ lp_smbcli_options(lp_ctx, &smb_options);
+
printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
servers[i].server_name, servers[i].share_name,
servers[i].credentials->username, j);
@@ -226,10 +229,8 @@ static bool connect_servers(struct event_context *ev,
lp_resolve_context(lp_ctx),
servers[i].credentials,
&servers[i].smb2_tree[j],
- ev);
+ ev, &smb_options);
} else {
- struct smbcli_options smb_options;
- lp_smbcli_options(lp_ctx, &smb_options);
status = smbcli_tree_full_connection(NULL,
&servers[i].smb_tree[j],
servers[i].server_name,
diff --git a/source4/torture/smb2/read.c b/source4/torture/smb2/read.c
index 1f306028f6..548bd1ce61 100644
--- a/source4/torture/smb2/read.c
+++ b/source4/torture/smb2/read.c
@@ -180,7 +180,6 @@ static bool test_read_dir(struct torture_context *torture, struct smb2_tree *tre
bool ret = true;
NTSTATUS status;
struct smb2_handle h;
- uint8_t buf[100];
struct smb2_read rd;
TALLOC_CTX *tmp_ctx = talloc_new(tree);
diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c
index 889d343a49..1ce796be4d 100644
--- a/source4/torture/smb2/scan.c
+++ b/source4/torture/smb2/scan.c
@@ -203,17 +203,20 @@ bool torture_smb2_scan(struct torture_context *torture)
NTSTATUS status;
int opcode;
struct smb2_request *req;
+ struct smbcli_options options;
+
+ lp_smbcli_options(torture->lp_ctx, &options);
status = smb2_connect(mem_ctx, host, share,
lp_resolve_context(torture->lp_ctx),
credentials, &tree,
- torture->ev);
+ torture->ev, &options);
if (!NT_STATUS_IS_OK(status)) {
printf("Connection failed - %s\n", nt_errstr(status));
return false;
}
- tree->session->transport->options.timeout = 3;
+ tree->session->transport->options.request_timeout = 3;
for (opcode=0;opcode<1000;opcode++) {
req = smb2_request_init_tree(tree, opcode, 2, false, 0);
@@ -224,12 +227,12 @@ bool torture_smb2_scan(struct torture_context *torture)
status = smb2_connect(mem_ctx, host, share,
lp_resolve_context(torture->lp_ctx),
credentials, &tree,
- torture->ev);
+ torture->ev, &options);
if (!NT_STATUS_IS_OK(status)) {
printf("Connection failed - %s\n", nt_errstr(status));
return false;
}
- tree->session->transport->options.timeout = 3;
+ tree->session->transport->options.request_timeout = 3;
} else {
status = smb2_request_destroy(req);
printf("active opcode %4d gave status %s\n", opcode, nt_errstr(status));
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index af4f345104..3a437acbab 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -270,11 +270,14 @@ bool torture_smb2_connection(struct torture_context *tctx, struct smb2_tree **tr
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
struct cli_credentials *credentials = cmdline_credentials;
+ struct smbcli_options options;
+
+ lp_smbcli_options(tctx->lp_ctx, &options);
status = smb2_connect(tctx, host, share,
lp_resolve_context(tctx->lp_ctx),
credentials, tree,
- tctx->ev);
+ tctx->ev, &options);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to SMB2 share \\\\%s\\%s - %s\n",
host, share, nt_errstr(status));