add exceptions for some of the strange windows SMB2 locking behaviour
authorAndrew Tridgell <tridge@samba.org>
Wed, 28 May 2008 02:05:23 +0000 (12:05 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 28 May 2008 02:05:23 +0000 (12:05 +1000)
source/torture/smb2/lock.c

index 4e21045a33027933a4fc16f99bb06d81f13969b7..5a36ac3eaef2ca8a631842e08a2485e87a39b4c3 100644 (file)
@@ -252,12 +252,20 @@ static bool test_valid_request(struct torture_context *torture, struct smb2_tree
        lck.in.lock_count       = 1;
        el[0].flags             = SMB2_LOCK_FLAG_UNLOCK;
        status = smb2_lock(tree, &lck);
-       CHECK_STATUS(status, NT_STATUS_OK);
+       if (torture_setting_bool(torture, "windows", false)) {
+               CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
+       } else {
+               CHECK_STATUS(status, NT_STATUS_OK);
+       }
 
        lck.in.lock_count       = 1;
        el[0].flags             = SMB2_LOCK_FLAG_UNLOCK;
        status = smb2_lock(tree, &lck);
-       CHECK_STATUS(status, NT_STATUS_OK);
+       if (torture_setting_bool(torture, "windows", false)) {
+               CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
+       } else {
+               CHECK_STATUS(status, NT_STATUS_OK);
+       }
 
        lck.in.lock_count       = 1;
        el[0].flags             = SMB2_LOCK_FLAG_UNLOCK;