diff options
author | Volker Lendecke <vl@samba.org> | 2014-06-29 11:07:08 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-06-30 22:28:15 +0200 |
commit | 9a27ed9c860d3d5a80326b19ce1a6d0553e55a38 (patch) | |
tree | 28d3ebb312590e5605aad6aedfe220079f78f225 | |
parent | 9f2e90754bcb7bf5f7159d07f0bc5fe754e71bf5 (diff) | |
download | samba-9a27ed9c860d3d5a80326b19ce1a6d0553e55a38.tar.gz samba-9a27ed9c860d3d5a80326b19ce1a6d0553e55a38.tar.xz samba-9a27ed9c860d3d5a80326b19ce1a6d0553e55a38.zip |
torture3: Add some brlock entries in cleanup2
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | source3/torture/test_cleanup.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/source3/torture/test_cleanup.c b/source3/torture/test_cleanup.c index a831ed74a7..e96a5de9d4 100644 --- a/source3/torture/test_cleanup.c +++ b/source3/torture/test_cleanup.c @@ -74,9 +74,9 @@ bool run_cleanup1(int dummy) bool run_cleanup2(int dummy) { - struct cli_state *cli1, *cli2; + struct cli_state *cli1, *cli2, *cli3; const char *fname = "\\cleanup2"; - uint16_t fnum1, fnum2; + uint16_t fnum1, fnum2, fnum3; NTSTATUS status; char buf; @@ -100,6 +100,30 @@ bool run_cleanup2(int dummy) return false; } + if (!torture_open_connection(&cli3, 1)) { + return false; + } + status = cli_ntcreate( + cli3, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE, + FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + FILE_OVERWRITE_IF, 0, 0, &fnum3, NULL); + if (!NT_STATUS_IS_OK(status)) { + printf("open of %s failed (%s)\n", fname, nt_errstr(status)); + return false; + } + status = cli_lock32(cli3, fnum3, 1, 1, 0, WRITE_LOCK); + if (!NT_STATUS_IS_OK(status)) { + printf("lock failed (%s)\n", nt_errstr(status)); + return false; + } + + status = cli_lock32(cli1, fnum1, 2, 1, 0, WRITE_LOCK); + if (!NT_STATUS_IS_OK(status)) { + printf("lock failed (%s)\n", nt_errstr(status)); + return false; + } + /* * Check the file is indeed locked */ |