diff options
author | Volker Lendecke <vl@samba.org> | 2013-10-16 21:34:15 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-10-23 14:06:12 +0200 |
commit | cdd232cc06a5652ad9f6800d5baf017632099cd8 (patch) | |
tree | c1f41e7910c46ec8c0f9b6ec58e93d923647c0bf /source4/torture/raw | |
parent | 76e7d8f97fd14f3ef796eb49f441e6eb56e9a238 (diff) | |
download | samba-cdd232cc06a5652ad9f6800d5baf017632099cd8.tar.gz samba-cdd232cc06a5652ad9f6800d5baf017632099cd8.tar.bz2 samba-cdd232cc06a5652ad9f6800d5baf017632099cd8.zip |
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 <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Oct 23 14:06:13 CEST 2013 on sn-devel-104
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/oplock.c | 14 |
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); |