From: Stefan Metzmacher Date: Fri, 7 Mar 2014 11:31:19 +0000 (+0100) Subject: s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=0e4f23991f33bed708e99210e5940abc050e5933 s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source4/torture/smb2/lock.c b/source4/torture/smb2/lock.c index 9350c136a218..a27ae9054dec 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); }