summaryrefslogtreecommitdiff
path: root/source4/torture/raw/read.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-29 05:01:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:24:41 -0500
commit535d1920f887ef98d962bcd7a40eae556f8e727f (patch)
tree1b711a181c5e04a354ec849927ea737966d39eb0 /source4/torture/raw/read.c
parent6fbbef77e62336a0fd6c2e0ca5259a75629cd55f (diff)
downloadsamba-535d1920f887ef98d962bcd7a40eae556f8e727f.tar.gz
r19506: fixed remaining parts of RAW-READ and RAW-WRITE tests to check for
CAP_LARGE_FILES (This used to be commit 66bebb210550793d0e7fe1b6a03a5140455ae72f)
Diffstat (limited to 'source4/torture/raw/read.c')
-rw-r--r--source4/torture/raw/read.c82
1 files changed, 46 insertions, 36 deletions
diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c
index f9c44e036e0..da9580a472b 100644
--- a/source4/torture/raw/read.c
+++ b/source4/torture/raw/read.c
@@ -161,12 +161,14 @@ static BOOL test_read(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
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 @@ static BOOL test_lockread(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
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 @@ static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
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 @@ static BOOL test_readbraw(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
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 @@ static BOOL test_readbraw(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
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);