diff options
author | Jeremy Allison <jra@samba.org> | 2003-08-14 21:11:06 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-08-14 21:11:06 +0000 |
commit | a19e269c2c401766fe0e44ea0a1daaad14f06f70 (patch) | |
tree | 11d3bec415c0b4a738fc25140500ba9c74404eb0 | |
parent | e08eee4db0cf270346de06ae55b81ae9579d87a1 (diff) | |
download | samba-a19e269c2c401766fe0e44ea0a1daaad14f06f70.tar.gz samba-a19e269c2c401766fe0e44ea0a1daaad14f06f70.tar.bz2 samba-a19e269c2c401766fe0e44ea0a1daaad14f06f70.zip |
Extended seek tests to check position information.
Jeremy.
(This used to be commit c4cc40c5c808d03e9ef813e6b2340c469cc6dc2d)
-rw-r--r-- | source4/torture/raw/seek.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source4/torture/raw/seek.c b/source4/torture/raw/seek.c index de62f88695..ec3b7125c9 100644 --- a/source4/torture/raw/seek.c +++ b/source4/torture/raw/seek.c @@ -114,6 +114,13 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.out.offset, 0xffffffff); + printf("Testing position information change\n"); + finfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION; + finfo.position_information.in.fnum = fnum; + status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(finfo.position_information.out.position, 0); + printf("Trying max overflow\n"); io.in.fnum = fnum; io.in.mode = SEEK_MODE_CURRENT; @@ -122,6 +129,13 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.out.offset, 999); + printf("Testing position information change\n"); + finfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION; + finfo.position_information.in.fnum = fnum; + status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(finfo.position_information.out.position, 0); + printf("trying read to update offset\n"); ZERO_STRUCT(c); if (cli_write(cli, fnum, 0, c, 0, 2) != 2) { @@ -129,6 +143,14 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; goto done; } + + printf("Testing position information change\n"); + finfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION; + finfo.position_information.in.fnum = fnum; + status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(finfo.position_information.out.position, 0); + io.in.fnum = fnum; io.in.mode = SEEK_MODE_CURRENT; io.in.offset = 0; @@ -141,6 +163,14 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; goto done; } + + printf("Testing position information change\n"); + finfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION; + finfo.position_information.in.fnum = fnum; + status = smb_raw_fileinfo(cli->tree, mem_ctx, &finfo); + CHECK_STATUS(status, NT_STATUS_OK); + CHECK_VALUE(finfo.position_information.out.position, 1); + status = smb_raw_seek(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.out.offset, 1); |