svn commit: samba r19506 - in branches/SAMBA_4_0/source/torture/raw: .

tridge at samba.org tridge at samba.org
Sun Oct 29 05:01:37 GMT 2006


Author: tridge
Date: 2006-10-29 05:01:36 +0000 (Sun, 29 Oct 2006)
New Revision: 19506

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

Log:

fixed remaining parts of RAW-READ and RAW-WRITE tests to check for
CAP_LARGE_FILES

Modified:
   branches/SAMBA_4_0/source/torture/raw/read.c
   branches/SAMBA_4_0/source/torture/raw/write.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/read.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/read.c	2006-10-28 09:40:00 UTC (rev 19505)
+++ branches/SAMBA_4_0/source/torture/raw/read.c	2006-10-29 05:01:36 UTC (rev 19506)
@@ -161,12 +161,14 @@
 		goto done;
 	}
 
-	printf("Trying max offset\n");
-	io.read.in.offset = ~0;
-	io.read.in.count = strlen(test_data);
-	status = smb_raw_read(cli->tree, &io);
-	CHECK_STATUS(status, NT_STATUS_OK);
-	CHECK_VALUE(io.read.out.nread, 0);
+	if (cli->transport->negotiate.capabilities & CAP_LARGE_FILES) {
+		printf("Trying max offset\n");
+		io.read.in.offset = ~0;
+		io.read.in.count = strlen(test_data);
+		status = smb_raw_read(cli->tree, &io);
+		CHECK_STATUS(status, NT_STATUS_OK);
+		CHECK_VALUE(io.read.out.nread, 0);
+	}
 
 	setup_buffer(buf, seed, maxsize);
 	smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize);
@@ -301,12 +303,14 @@
 		goto done;
 	}
 
-	printf("Trying max offset\n");
-	io.lockread.in.offset = ~0;
-	io.lockread.in.count = strlen(test_data);
-	status = smb_raw_read(cli->tree, &io);
-	CHECK_STATUS(status, NT_STATUS_OK);
-	CHECK_VALUE(io.lockread.out.nread, 0);
+	if (cli->transport->negotiate.capabilities & CAP_LARGE_FILES) {
+		printf("Trying max offset\n");
+		io.lockread.in.offset = ~0;
+		io.lockread.in.count = strlen(test_data);
+		status = smb_raw_read(cli->tree, &io);
+		CHECK_STATUS(status, NT_STATUS_OK);
+		CHECK_VALUE(io.lockread.out.nread, 0);
+	}
 
 	setup_buffer(buf, seed, maxsize);
 	smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize);
@@ -442,15 +446,17 @@
 		goto done;
 	}
 
-	printf("Trying max offset\n");
-	io.readx.in.offset = 0xffffffff;
-	io.readx.in.mincnt = strlen(test_data);
-	io.readx.in.maxcnt = strlen(test_data);
-	status = smb_raw_read(cli->tree, &io);
-	CHECK_STATUS(status, NT_STATUS_OK);
-	CHECK_VALUE(io.readx.out.nread, 0);
-	CHECK_VALUE(io.readx.out.remaining, 0xFFFF);
-	CHECK_VALUE(io.readx.out.compaction_mode, 0);
+	if (cli->transport->negotiate.capabilities & CAP_LARGE_FILES) {
+		printf("Trying max offset\n");
+		io.readx.in.offset = 0xffffffff;
+		io.readx.in.mincnt = strlen(test_data);
+		io.readx.in.maxcnt = strlen(test_data);
+		status = smb_raw_read(cli->tree, &io);
+		CHECK_STATUS(status, NT_STATUS_OK);
+		CHECK_VALUE(io.readx.out.nread, 0);
+		CHECK_VALUE(io.readx.out.remaining, 0xFFFF);
+		CHECK_VALUE(io.readx.out.compaction_mode, 0);
+	}
 
 	setup_buffer(buf, seed, maxsize);
 	smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize);
@@ -638,13 +644,15 @@
 		goto done;
 	}
 
-	printf("Trying max offset\n");
-	io.readbraw.in.offset = ~0;
-	io.readbraw.in.mincnt = strlen(test_data);
-	io.readbraw.in.maxcnt = strlen(test_data);
-	status = smb_raw_read(cli->tree, &io);
-	CHECK_STATUS(status, NT_STATUS_OK);
-	CHECK_VALUE(io.readbraw.out.nread, 0);
+	if (cli->transport->negotiate.capabilities & CAP_LARGE_FILES) {
+		printf("Trying max offset\n");
+		io.readbraw.in.offset = ~0;
+		io.readbraw.in.mincnt = strlen(test_data);
+		io.readbraw.in.maxcnt = strlen(test_data);
+		status = smb_raw_read(cli->tree, &io);
+		CHECK_STATUS(status, NT_STATUS_OK);
+		CHECK_VALUE(io.readbraw.out.nread, 0);
+	}
 
 	setup_buffer(buf, seed, maxsize);
 	smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize);
@@ -705,14 +713,16 @@
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(io.readbraw.out.nread, 0);
 
-	printf("Trying large offset read\n");
-	io.readbraw.in.offset = ((uint64_t)0x2) << 32;
-	io.readbraw.in.mincnt = 10;
-	io.readbraw.in.maxcnt = 10;
-	io.readbraw.in.timeout = 0;
-	status = smb_raw_read(cli->tree, &io);
-	CHECK_STATUS(status, NT_STATUS_OK);
-	CHECK_VALUE(io.readbraw.out.nread, 0);
+	if (cli->transport->negotiate.capabilities & CAP_LARGE_FILES) {
+		printf("Trying large offset read\n");
+		io.readbraw.in.offset = ((uint64_t)0x2) << 32;
+		io.readbraw.in.mincnt = 10;
+		io.readbraw.in.maxcnt = 10;
+		io.readbraw.in.timeout = 0;
+		status = smb_raw_read(cli->tree, &io);
+		CHECK_STATUS(status, NT_STATUS_OK);
+		CHECK_VALUE(io.readbraw.out.nread, 0);
+	}
 
 done:
 	smbcli_close(cli->tree, fnum);

Modified: branches/SAMBA_4_0/source/torture/raw/write.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/write.c	2006-10-28 09:40:00 UTC (rev 19505)
+++ branches/SAMBA_4_0/source/torture/raw/write.c	2006-10-29 05:01:36 UTC (rev 19506)
@@ -188,6 +188,11 @@
 		goto done;
 	}
 	
+	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
+		printf("skipping large file tests - CAP_LARGE_FILES not set\n");
+		goto done;
+	}
+
 	printf("Trying 2^32 offset\n");
 	setup_buffer(buf, seed, maxsize);
 	io.write.in.file.fnum = fnum;
@@ -198,7 +203,7 @@
 	CHECK_STATUS(status, NT_STATUS_OK);
 	CHECK_VALUE(io.write.out.nwritten, 4000);
 	CHECK_ALL_INFO(io.write.in.count + (uint64_t)io.write.in.offset, size);
-
+	
 	memset(buf, 0, maxsize);
 	if (smbcli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) {
 		printf("read failed at %s\n", __location__);
@@ -342,6 +347,11 @@
 	status = torture_set_sparse(cli->tree, fnum);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	
+	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
+		printf("skipping large file tests - CAP_LARGE_FILES not set\n");
+		goto done;
+	}
+
 	printf("Trying 2^32 offset\n");
 	setup_buffer(buf, seed, maxsize);
 	io.writex.in.file.fnum = fnum;
@@ -505,6 +515,11 @@
 	status = torture_set_sparse(cli->tree, fnum);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	
+	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
+		printf("skipping large file tests - CAP_LARGE_FILES not set\n");
+		goto done;
+	}
+
 	printf("Trying 2^32 offset\n");
 	setup_buffer(buf, seed, maxsize);
 	io.writeunlock.in.file.fnum = fnum;
@@ -655,6 +670,11 @@
 	status = torture_set_sparse(cli->tree, fnum);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	
+	if (!(cli->transport->negotiate.capabilities & CAP_LARGE_FILES)) {
+		printf("skipping large file tests - CAP_LARGE_FILES not set\n");
+		goto done;
+	}
+
 	printf("Trying 2^32 offset\n");
 	setup_buffer(buf, seed, maxsize);
 	io.writeclose.in.file.fnum = fnum;



More information about the samba-cvs mailing list