summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-07 12:31:19 +0100
committerJeremy Allison <jra@samba.org>2014-03-12 09:27:37 -0700
commit0e4f23991f33bed708e99210e5940abc050e5933 (patch)
tree5fce392bf85381ae0214cf88a528bed0624f7f98 /source4
parent9c8badc2a5c4d74b887cad57f98c145fbb9bfa6d (diff)
downloadsamba-0e4f23991f33bed708e99210e5940abc050e5933.tar.gz
samba-0e4f23991f33bed708e99210e5940abc050e5933.tar.xz
samba-0e4f23991f33bed708e99210e5940abc050e5933.zip
s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smb2/lock.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c
index 9350c136a2..a27ae9054d 100644
--- a/source4/torture/smb2/lock.c
+++ b/source4/torture/smb2/lock.c
@@ -1044,11 +1044,12 @@ static bool test_cancel_tdis(struct torture_context *torture,
torture_comment(torture, " Check pending lock reply\n");
status = smb2_lock_recv(req, &lck);
- if (torture_setting_bool(torture, "samba4", false)) {
- /* saying that this lock succeeded is nonsense - the
- * tree is gone!! */
- CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
- } else {
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_RANGE_NOT_LOCKED)) {
+ /*
+ * The status depends on the server internals
+ * the order in which the files are closed
+ * by smb2_tdis().
+ */
CHECK_STATUS(status, NT_STATUS_OK);
}
@@ -1087,7 +1088,7 @@ static bool test_cancel_logoff(struct torture_context *torture,
struct smb2_lock_element el[2];
struct smb2_request *req = NULL;
- const char *fname = BASEDIR "\\cancel_tdis.txt";
+ const char *fname = BASEDIR "\\cancel_logoff.txt";
status = torture_smb2_testdir(tree, BASEDIR, &h);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -1130,11 +1131,12 @@ static bool test_cancel_logoff(struct torture_context *torture,
torture_comment(torture, " Check pending lock reply\n");
status = smb2_lock_recv(req, &lck);
- if (torture_setting_bool(torture, "samba4", false)) {
- /* another bogus 'success' code from windows. The lock
- * cannot have succeeded, as we are now logged off */
- CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
- } else {
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_RANGE_NOT_LOCKED)) {
+ /*
+ * The status depends on the server internals
+ * the order in which the files are closed
+ * by smb2_logoff().
+ */
CHECK_STATUS(status, NT_STATUS_OK);
}