summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-12-01 15:29:00 -0800
committerTim Prouty <tprouty@samba.org>2009-12-03 18:54:52 -0800
commitaf8b7857ca4b9f81d2240d2592c4d02893b04f76 (patch)
tree0ad56d4844f00f3d9df13ee16e3e18416c1e0c36 /source4/torture/raw
parent66c968778d74280bf36342e76c80b617e47ebde5 (diff)
downloadsamba-af8b7857ca4b9f81d2240d2592c4d02893b04f76.tar.gz
samba-af8b7857ca4b9f81d2240d2592c4d02893b04f76.tar.bz2
samba-af8b7857ca4b9f81d2240d2592c4d02893b04f76.zip
s4 torture: Allow some implementations to break from level1 to none with two breaks
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/oplock.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index 283fed2252..106acfe793 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -253,6 +253,12 @@ done:
return;
}
+static uint8_t get_break_level1_to_none_count(struct torture_context *tctx)
+{
+ return torture_setting_bool(tctx, "2_step_break_to_none", false) ?
+ 2 : 1;
+}
+
static bool test_raw_oplock_exclusive1(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
{
const char *fname = BASEDIR "\\test_exclusive1.dat";
@@ -471,7 +477,7 @@ static bool test_raw_oplock_exclusive3(struct torture_context *tctx, struct smbc
CHECK_STATUS(tctx, status, NT_STATUS_OK);
torture_wait_for_oplock_break(tctx);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
CHECK_VAL(break_info.level, OPLOCK_BREAK_TO_NONE);
@@ -608,7 +614,7 @@ static bool test_raw_oplock_exclusive5(struct torture_context *tctx, struct smbc
fnum2 = io.ntcreatex.out.file.fnum;
CHECK_VAL(io.ntcreatex.out.oplock_level, LEVEL_II_OPLOCK_RETURN);
torture_wait_for_oplock_break(tctx);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
smbcli_close(cli1->tree, fnum);
@@ -1538,7 +1544,7 @@ static bool test_raw_oplock_batch11(struct torture_context *tctx, struct smbcli_
CHECK_STATUS(tctx, status, NT_STATUS_OK);
torture_wait_for_oplock_break(tctx);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
CHECK_VAL(break_info.level, 0);
@@ -1615,7 +1621,7 @@ static bool test_raw_oplock_batch12(struct torture_context *tctx, struct smbcli_
CHECK_STATUS(tctx, status, NT_STATUS_OK);
torture_wait_for_oplock_break(tctx);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
CHECK_VAL(break_info.level, 0);
@@ -1692,7 +1698,7 @@ static bool test_raw_oplock_batch13(struct torture_context *tctx, struct smbcli_
fnum2 = io.ntcreatex.out.file.fnum;
torture_wait_for_oplock_break(tctx);
CHECK_VAL(io.ntcreatex.out.oplock_level, LEVEL_II_OPLOCK_RETURN);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
smbcli_close(cli1->tree, fnum);
@@ -1769,7 +1775,7 @@ static bool test_raw_oplock_batch14(struct torture_context *tctx, struct smbcli_
CHECK_VAL(io.ntcreatex.out.oplock_level, LEVEL_II_OPLOCK_RETURN);
torture_wait_for_oplock_break(tctx);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
smbcli_close(cli1->tree, fnum);
@@ -1921,7 +1927,7 @@ static bool test_raw_oplock_batch16(struct torture_context *tctx, struct smbcli_
CHECK_VAL(io.ntcreatex.out.oplock_level, LEVEL_II_OPLOCK_RETURN);
torture_wait_for_oplock_break(tctx);
- CHECK_VAL(break_info.count, 1);
+ CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
CHECK_VAL(break_info.failures, 0);
smbcli_close(cli1->tree, fnum);