From 0e4f23991f33bed708e99210e5940abc050e5933 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Mar 2014 12:31:19 +0100 Subject: [PATCH] s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source4/torture/smb2/lock.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c index 9350c136a21..a27ae9054de 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); } -- 2.11.4.GIT