summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-05-30 03:57:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:43 -0500
commit4dd65fdd4888556dbb7ac0ea63588ae0d858203c (patch)
treeae612e4140ac3965ba6ed05e03afb75ff9535e9e /source4/torture
parent1204445aa01111f7ad8935bb532b579384337b42 (diff)
downloadsamba-4dd65fdd4888556dbb7ac0ea63588ae0d858203c.tar.gz
samba-4dd65fdd4888556dbb7ac0ea63588ae0d858203c.tar.bz2
samba-4dd65fdd4888556dbb7ac0ea63588ae0d858203c.zip
r15947: Do the same test on setting allocation info.
Jeremy. (This used to be commit b8f6f62acd2ae79c87303b72e8bea22abc3a6b6e)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/oplock.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index 7099691d6f..81042755a3 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -571,7 +571,7 @@ static BOOL test_oplock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
smbcli_unlink(cli->tree, fname);
/* Test if a set-eof on pathname breaks an exclusive oplock. */
- printf("Test if setpathinfo breaks oplocks.\n");
+ printf("Test if setpathinfo set EOF breaks oplocks.\n");
ZERO_STRUCT(break_info);
smbcli_oplock_handler(cli->transport, oplock_handler_ack_to_levelII, cli->tree);
@@ -586,7 +586,7 @@ static BOOL test_oplock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
status = smb_raw_open(cli->tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
- fnum2 = io.ntcreatex.out.file.fnum;
+ fnum = io.ntcreatex.out.file.fnum;
CHECK_VAL(break_info.count, 0);
CHECK_VAL(break_info.failures, 0);
CHECK_VAL(io.ntcreatex.out.oplock_level, BATCH_OPLOCK_RETURN);
@@ -601,7 +601,43 @@ static BOOL test_oplock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_VAL(break_info.count, 1);
CHECK_VAL(break_info.failures, 0);
+ CHECK_VAL(break_info.level, 0);
+
+ smbcli_close(cli->tree, fnum);
+ smbcli_unlink(cli->tree, fname);
+
+ /* Test if a set-allocation size on pathname breaks an exclusive oplock. */
+ printf("Test if setpathinfo allocation size breaks oplocks.\n");
+
+ ZERO_STRUCT(break_info);
+ smbcli_oplock_handler(cli->transport, oplock_handler_ack_to_levelII, cli->tree);
+
+ io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED |
+ NTCREATEX_FLAGS_REQUEST_OPLOCK |
+ NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK;
+ io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+ io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ|
+ NTCREATEX_SHARE_ACCESS_WRITE|
+ NTCREATEX_SHARE_ACCESS_DELETE;
+ io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+ status = smb_raw_open(cli->tree, mem_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ fnum = io.ntcreatex.out.file.fnum;
+ CHECK_VAL(break_info.count, 0);
+ CHECK_VAL(break_info.failures, 0);
CHECK_VAL(io.ntcreatex.out.oplock_level, BATCH_OPLOCK_RETURN);
+
+ ZERO_STRUCT(sfi);
+ sfi.generic.level = SMB_SFILEINFO_ALLOCATION_INFORMATION;
+ sfi.generic.in.file.path = fname;
+ sfi.allocation_info.in.alloc_size = 65536 * 8;
+
+ status = smb_raw_setpathinfo(cli->tree, &sfi);
+
+ CHECK_STATUS(status, NT_STATUS_OK);
+ CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.failures, 0);
+ CHECK_VAL(break_info.level, 0);
done:
smbcli_close(cli->tree, fnum);