summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-23 02:32:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:20:14 -0500
commited24e83d5b96ffa84656a46736078927bbeaa6c6 (patch)
tree763640612fe89814e2365ad53fba36a1a24b7804 /source4/torture
parent921f73c7e58eac1900eb7ec9f7276cd3afaf0480 (diff)
downloadsamba-ed24e83d5b96ffa84656a46736078927bbeaa6c6.tar.gz
samba-ed24e83d5b96ffa84656a46736078927bbeaa6c6.tar.bz2
samba-ed24e83d5b96ffa84656a46736078927bbeaa6c6.zip
r18838: make sure we cleanup after SMB2-MAXWRITE (it creates a large file)
(This used to be commit 54894fb8b87a10dbf36476a001e2e32a0263c4fa)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/smb2/maxwrite.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/source4/torture/smb2/maxwrite.c b/source4/torture/smb2/maxwrite.c
index 1d64d1d359..86578134dc 100644
--- a/source4/torture/smb2/maxwrite.c
+++ b/source4/torture/smb2/maxwrite.c
@@ -27,11 +27,14 @@
#include "torture/torture.h"
#include "torture/smb2/proto.h"
+#define FNAME "testmaxwrite.dat"
+
/*
test writing
*/
static NTSTATUS torture_smb2_write(TALLOC_CTX *mem_ctx,
- struct smb2_tree *tree, struct smb2_handle handle)
+ struct smb2_tree *tree,
+ struct smb2_handle handle)
{
struct smb2_write w;
struct smb2_read r;
@@ -62,12 +65,17 @@ static NTSTATUS torture_smb2_write(TALLOC_CTX *mem_ctx,
if (!NT_STATUS_IS_OK(status)) {
printf("write failed - %s\n", nt_errstr(status));
max = len-1;
- talloc_free(tree);
- if (!torture_smb2_connection(mem_ctx, &tree)) {
- printf("failed to reconnect\n");
- return NT_STATUS_NET_WRITE_FAULT;
+ status = smb2_util_close(tree, handle);
+ if (!NT_STATUS_IS_OK(status)) {
+ /* vista bug */
+ printf("coping with server disconnect\n");
+ talloc_free(tree);
+ if (!torture_smb2_connection(mem_ctx, &tree)) {
+ printf("failed to reconnect\n");
+ return NT_STATUS_NET_WRITE_FAULT;
+ }
}
- handle = torture_smb2_create(tree, "test9.dat");
+ handle = torture_smb2_create(tree, FNAME);
continue;
} else {
min = len;
@@ -93,6 +101,8 @@ static NTSTATUS torture_smb2_write(TALLOC_CTX *mem_ctx,
}
printf("converged: len=%d\n", max);
+ smb2_util_close(tree, handle);
+ smb2_util_unlink(tree, FNAME);
return NT_STATUS_OK;
}
@@ -113,7 +123,7 @@ BOOL torture_smb2_maxwrite(struct torture_context *torture)
return False;
}
- h1 = torture_smb2_create(tree, "test9.dat");
+ h1 = torture_smb2_create(tree, FNAME);
status = torture_smb2_write(mem_ctx, tree, h1);
if (!NT_STATUS_IS_OK(status)) {
printf("Write failed - %s\n", nt_errstr(status));