diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-02-27 13:19:07 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-02-27 13:19:07 +0100 |
commit | bc1a369a0ed254ede591b65756d75568c45549ea (patch) | |
tree | 9c7fdefdc1d943506752d2d4e15cd4d81f65cc42 /source4/torture/raw | |
parent | b3d2a56df29b163d93c4d20efc22c523441a92e5 (diff) | |
parent | e20f1bb6dba342fcc91d3fcf28d64c7d5fd39a38 (diff) | |
download | samba-bc1a369a0ed254ede591b65756d75568c45549ea.tar.gz samba-bc1a369a0ed254ede591b65756d75568c45549ea.tar.bz2 samba-bc1a369a0ed254ede591b65756d75568c45549ea.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-gmake3
Conflicts:
source/build/smb_build/makefile.pm
(This used to be commit c45b97c4714dd0565949732394c9c1e8eedbb99a)
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/oplock.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 3edd0c6820..e81b634161 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -1279,6 +1279,79 @@ done: return ret; } +static bool test_raw_oplock_batch15(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2) +{ + const char *fname = BASEDIR "\\test_batch15.dat"; + NTSTATUS status; + bool ret = true; + union smb_open io; + union smb_fileinfo qfi; + uint16_t fnum=0; + + if (!torture_setup_dir(cli1, BASEDIR)) { + return false; + } + + /* cleanup */ + smbcli_unlink(cli1->tree, fname); + + smbcli_oplock_handler(cli1->transport, oplock_handler_ack_to_levelII, cli1->tree); + + /* + base ntcreatex parms + */ + io.generic.level = RAW_OPEN_NTCREATEX; + io.ntcreatex.in.root_fid = 0; + io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; + io.ntcreatex.in.alloc_size = 0; + io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL; + io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE; + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF; + io.ntcreatex.in.create_options = 0; + io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS; + io.ntcreatex.in.security_flags = 0; + io.ntcreatex.in.fname = fname; + + /* Test if a qpathinfo all info on pathname breaks a batch oplock. */ + torture_comment(tctx, "Test if qpathinfo all info breaks a batch oplock (should not).\n"); + + ZERO_STRUCT(break_info); + smbcli_oplock_handler(cli1->transport, oplock_handler_ack_to_levelII, cli1->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.share_access = NTCREATEX_SHARE_ACCESS_NONE; + io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE; + status = smb_raw_open(cli1->tree, tctx, &io); + CHECK_STATUS(tctx, 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(qfi); + qfi.generic.level = RAW_FILEINFO_ALL_INFORMATION; + qfi.generic.in.file.path = fname; + + status = smb_raw_pathinfo(cli2->tree, tctx, &qfi); + + CHECK_STATUS(tctx, status, NT_STATUS_OK); + CHECK_VAL(break_info.count, 0); + + smbcli_close(cli1->tree, fnum); + +done: + smb_raw_exit(cli1->session); + smb_raw_exit(cli2->session); + smbcli_deltree(cli1->tree, BASEDIR); + return ret; +} + /* basic testing of oplocks */ @@ -1301,6 +1374,7 @@ struct torture_suite *torture_raw_oplock(TALLOC_CTX *mem_ctx) torture_suite_add_2smb_test(suite, "BATCH12", test_raw_oplock_batch12); torture_suite_add_2smb_test(suite, "BATCH13", test_raw_oplock_batch13); torture_suite_add_2smb_test(suite, "BATCH14", test_raw_oplock_batch14); + torture_suite_add_2smb_test(suite, "BATCH15", test_raw_oplock_batch15); return suite; } |