summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/torture/raw/oplock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index 26baabc984..a4f6a0555e 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -1074,6 +1074,8 @@ static bool test_raw_oplock_level_ii_1(struct torture_context *tctx,
bool ret = true;
union smb_open io;
uint16_t fnum=0, fnum2=0;
+ char c = 0;
+ ssize_t written;
if (!torture_setup_dir(cli1, BASEDIR)) {
return false;
@@ -1156,6 +1158,18 @@ static bool test_raw_oplock_level_ii_1(struct torture_context *tctx,
CHECK_VAL(break_info.level, OPLOCK_BREAK_TO_NONE);
CHECK_VAL(break_info.failures, 0);
+ /*
+ * Check that a write does not cause another break. This used to be a
+ * bug in smbd.
+ */
+
+ ZERO_STRUCT(break_info);
+ written = smbcli_write(cli2->tree, fnum2, 0, &c, 0, 1);
+ CHECK_VAL(written, 1);
+ torture_wait_for_oplock_break(tctx);
+ CHECK_VAL(break_info.count, 0);
+ CHECK_VAL(break_info.failures, 0);
+
status = smbcli_close(cli2->tree, fnum2);
CHECK_STATUS(tctx, status, NT_STATUS_OK);
status = smbcli_close(cli1->tree, fnum);