svn commit: samba r18838 - in branches/SAMBA_4_0/source/torture/smb2: .

tridge at samba.org tridge at samba.org
Sat Sep 23 02:32:47 GMT 2006


Author: tridge
Date: 2006-09-23 02:32:47 +0000 (Sat, 23 Sep 2006)
New Revision: 18838

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18838

Log:

make sure we cleanup after SMB2-MAXWRITE (it creates a large file)

Modified:
   branches/SAMBA_4_0/source/torture/smb2/maxwrite.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/smb2/maxwrite.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smb2/maxwrite.c	2006-09-23 02:24:22 UTC (rev 18837)
+++ branches/SAMBA_4_0/source/torture/smb2/maxwrite.c	2006-09-23 02:32:47 UTC (rev 18838)
@@ -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 @@
 		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 @@
 	}
 
 	printf("converged: len=%d\n", max);
+	smb2_util_close(tree, handle);
+	smb2_util_unlink(tree, FNAME);
 
 	return NT_STATUS_OK;
 }
@@ -113,7 +123,7 @@
 		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));



More information about the samba-cvs mailing list