s4:torture/smb2: accept NT_STATUS_RANGE_NOT_LOCKED after smb2_logoff/tdis
authorStefan Metzmacher <metze@samba.org>
Fri, 7 Mar 2014 11:31:19 +0000 (12:31 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 12 Mar 2014 16:27:37 +0000 (09:27 -0700)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/smb2/lock.c

index 9350c136a2186b4e5aa82edb1cf7a23e708064bd..a27ae9054deca8db5ca64aaeb7e45489a1a44556 100644 (file)
@@ -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);
        }