summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2011-11-08 18:31:17 +0100
committerMichael Adam <obnox@samba.org>2011-11-09 01:02:08 +0100
commitafc94fea2af6e06c3ebcd08cc48d9ebb9484c338 (patch)
tree8e6a77bd63ebe6335f06a3c5b5d554a9830fc7de
parentcb98e31b2458d4f6aceabd888f276ef65b2518bd (diff)
downloadsamba-afc94fea2af6e06c3ebcd08cc48d9ebb9484c338.tar.gz
samba-afc94fea2af6e06c3ebcd08cc48d9ebb9484c338.tar.bz2
samba-afc94fea2af6e06c3ebcd08cc48d9ebb9484c338.zip
s4:torture:smb2: rewrite the durable-open.open1 test to use smb2_oplock_create_share()
-rw-r--r--source4/torture/smb2/durable_open.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/source4/torture/smb2/durable_open.c b/source4/torture/smb2/durable_open.c
index 55fce26acc..190778ca11 100644
--- a/source4/torture/smb2/durable_open.c
+++ b/source4/torture/smb2/durable_open.c
@@ -109,7 +109,6 @@ struct durable_open_vs_oplock durable_open_vs_oplock_table[NUM_OPLOCK_OPEN_TESTS
static bool test_one_durable_open_open1(struct torture_context *tctx,
struct smb2_tree *tree,
const char *fname,
- struct smb2_create io,
struct durable_open_vs_oplock test)
{
NTSTATUS status;
@@ -117,12 +116,15 @@ static bool test_one_durable_open_open1(struct torture_context *tctx,
struct smb2_handle _h;
struct smb2_handle *h = NULL;
bool ret = true;
+ struct smb2_create io;
smb2_util_unlink(tree, fname);
- io.in.fname = fname;
- io.in.share_access = smb2_util_share_access(test.share_mode);
- io.in.oplock_level = smb2_util_oplock_level(test.level);
+ smb2_oplock_create_share(&io, fname,
+ smb2_util_share_access(test.share_mode),
+ smb2_util_oplock_level(test.level));
+ io.in.durable_open = true;
+
status = smb2_create(tree, mem_ctx, &io);
CHECK_STATUS(status, NT_STATUS_OK);
_h = io.out.file.handle;
@@ -145,7 +147,6 @@ bool test_durable_open_open1(struct torture_context *tctx,
struct smb2_tree *tree)
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
- struct smb2_create io;
char fname[256];
bool ret = true;
int i;
@@ -155,28 +156,12 @@ bool test_durable_open_open1(struct torture_context *tctx,
smb2_util_unlink(tree, fname);
- ZERO_STRUCT(io);
- io.in.security_flags = 0x00;
- io.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
- io.in.create_flags = 0x00000000;
- io.in.reserved = 0x00000000;
- io.in.desired_access = SEC_RIGHTS_FILE_ALL;
- io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
- io.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
- io.in.create_options = NTCREATEX_OPTIONS_SEQUENTIAL_ONLY |
- NTCREATEX_OPTIONS_ASYNC_ALERT |
- NTCREATEX_OPTIONS_NON_DIRECTORY_FILE |
- 0x00200000;
- io.in.durable_open = true;
- io.in.fname = fname;
-
/* test various oplock levels with durable open */
for (i = 0; i < NUM_OPLOCK_OPEN_TESTS; i++) {
ret = test_one_durable_open_open1(tctx,
tree,
fname,
- io,
durable_open_vs_oplock_table[i]);
if (ret == false) {
goto done;