r15016: add a test for a 2nd open with an exclusive oplock. It does not cause
authorAndrew Tridgell <tridge@samba.org>
Mon, 10 Apr 2006 06:06:26 +0000 (06:06 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:04:01 +0000 (14:04 -0500)
a break, as exclusive oplocks don't cache close requests
(This used to be commit 9f2617a062e99805c42fe9b2fa0179b1672b25e5)

source4/torture/raw/oplock.c

index 6008724d4899f5789477025628c1155e22405814..7074b7b357e50f41e96bd0284065e91a203dec20 100644 (file)
@@ -146,7 +146,13 @@ static BOOL test_oplock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
        fnum = io.ntcreatex.out.file.fnum;
        CHECK_VAL(io.ntcreatex.out.oplock_level, EXCLUSIVE_OPLOCK_RETURN);
 
-       printf("unlink it - should be no break\n");
+       printf("a 2nd open should not cause a break\n");
+       status = smb_raw_open(cli->tree, mem_ctx, &io);
+       CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION);
+       CHECK_VAL(break_info.count, 0);
+       CHECK_VAL(break_info.failures, 0);
+
+       printf("unlink it - should also be no break\n");
        unl.unlink.in.pattern = fname;
        unl.unlink.in.attrib = 0;
        status = smb_raw_unlink(cli->tree, &unl);