From cdd232cc06a5652ad9f6800d5baf017632099cd8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Oct 2013 21:34:15 +0200 Subject: torture: Extend the raw.oplock.level_ii_1 test smbd broke to none twice. Make sure this won't happen again :-) This used to happen before the MSG_SMB_BREAK_RESPONSE merge. In process_oplock_break_message we did not call remove_oplock, which would have prevented this. Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Wed Oct 23 14:06:13 CEST 2013 on sn-devel-104 --- source4/torture/raw/oplock.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source4/torture') 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); -- cgit