summaryrefslogtreecommitdiff
path: root/source4/torture/smb2/connect.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-15 04:38:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:18 -0500
commitb51703baf152c309ce325ce573c1683d7e503122 (patch)
tree89fb1a5bfd9a3659be89185c198430ab8c35f9a6 /source4/torture/smb2/connect.c
parentf7732560eea1c5d1de316fb2d64b78ad7507549b (diff)
downloadsamba-b51703baf152c309ce325ce573c1683d7e503122.tar.gz
samba-b51703baf152c309ce325ce573c1683d7e503122.tar.bz2
samba-b51703baf152c309ce325ce573c1683d7e503122.zip
r11730: added parsing and tests for a bunch more SMB2 getinfo levels
(This used to be commit ca65bf0235cbfab451e5d5ceac9f714acc0cd46c)
Diffstat (limited to 'source4/torture/smb2/connect.c')
-rw-r--r--source4/torture/smb2/connect.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c
index 4907aadecb..077c873d08 100644
--- a/source4/torture/smb2/connect.c
+++ b/source4/torture/smb2/connect.c
@@ -82,12 +82,26 @@ static NTSTATUS torture_smb2_write(struct smb2_tree *tree, struct smb2_handle ha
w.in.handle = handle;
w.in.data = data;
+ memset(w.in._pad, 0xff, 16);
+
+ status = smb2_write(tree, &w);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("write failed - %s\n", nt_errstr(status));
+ return status;
+ }
+
+ torture_smb2_all_info(tree, handle);
+
+ memset(w.in._pad, 0xff, 16);
+
status = smb2_write(tree, &w);
if (!NT_STATUS_IS_OK(status)) {
printf("write failed - %s\n", nt_errstr(status));
return status;
}
+ torture_smb2_all_info(tree, handle);
+
ZERO_STRUCT(r);
r.in.buffer_code = 0x31;
r.in.length = data.length;
@@ -168,16 +182,9 @@ BOOL torture_smb2_connect(void)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct smb2_tree *tree;
- const char *host = lp_parm_string(-1, "torture", "host");
- const char *share = lp_parm_string(-1, "torture", "share");
- struct cli_credentials *credentials = cmdline_credentials;
struct smb2_handle h1, h2;
- NTSTATUS status;
- status = smb2_connect(mem_ctx, host, share, credentials, &tree,
- event_context_find(mem_ctx));
- if (!NT_STATUS_IS_OK(status)) {
- printf("Connection failed - %s\n", nt_errstr(status));
+ if (!torture_smb2_connection(mem_ctx, &tree)) {
return False;
}