git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
72ab279
)
s4:torture:smb2: rename some of the durable-handle subtests more systematically
author
Michael Adam
<obnox@samba.org>
Wed, 29 Feb 2012 22:19:59 +0000
(23:19 +0100)
committer
Michael Adam
<obnox@samba.org>
Sat, 3 Mar 2012 16:03:06 +0000
(17:03 +0100)
source4/torture/smb2/durable_open.c
patch
|
blob
|
history
diff --git
a/source4/torture/smb2/durable_open.c
b/source4/torture/smb2/durable_open.c
index f23cc935b890b488f200a8a1859f980402d200d6..0c20f776ea15af3aea2adc6028628df4d590a7e6 100644
(file)
--- a/
source4/torture/smb2/durable_open.c
+++ b/
source4/torture/smb2/durable_open.c
@@
-109,10
+109,10
@@
static struct durable_open_vs_oplock durable_open_vs_oplock_table[NUM_OPLOCK_OPE
{ "b", "RWD", true },
};
{ "b", "RWD", true },
};
-static bool test_one_durable_open_open
1
(struct torture_context *tctx,
- struct smb2_tree *tree,
- const char *fname,
- struct durable_open_vs_oplock test)
+static bool test_one_durable_open_open
_oplock
(struct torture_context *tctx,
+
struct smb2_tree *tree,
+
const char *fname,
+
struct durable_open_vs_oplock test)
{
NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
{
NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
@@
-146,8
+146,8
@@
done:
return ret;
}
return ret;
}
-bool test_durable_open_open
1
(struct torture_context *tctx,
- struct smb2_tree *tree)
+bool test_durable_open_open
_oplock
(struct torture_context *tctx,
+
struct smb2_tree *tree)
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
char fname[256];
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
char fname[256];
@@
-155,17
+155,17
@@
bool test_durable_open_open1(struct torture_context *tctx,
int i;
/* Choose a random name in case the state is left a little funky. */
int i;
/* Choose a random name in case the state is left a little funky. */
- snprintf(fname, 256, "durable_open_open
1
_%s.dat", generate_random_str(tctx, 8));
+ snprintf(fname, 256, "durable_open_open
_oplock
_%s.dat", generate_random_str(tctx, 8));
smb2_util_unlink(tree, fname);
/* test various oplock levels with durable open */
for (i = 0; i < NUM_OPLOCK_OPEN_TESTS; i++) {
smb2_util_unlink(tree, fname);
/* test various oplock levels with durable open */
for (i = 0; i < NUM_OPLOCK_OPEN_TESTS; i++) {
- ret = test_one_durable_open_open
1
(tctx,
- tree,
- fname,
- durable_open_vs_oplock_table[i]);
+ ret = test_one_durable_open_open
_oplock
(tctx,
+
tree,
+
fname,
+
durable_open_vs_oplock_table[i]);
if (ret == false) {
goto done;
}
if (ret == false) {
goto done;
}
@@
-243,10
+243,10
@@
static struct durable_open_vs_lease durable_open_vs_lease_table[NUM_LEASE_OPEN_T
{ "RHW", "RWD", true },
};
{ "RHW", "RWD", true },
};
-static bool test_one_durable_open_open
2
(struct torture_context *tctx,
- struct smb2_tree *tree,
- const char *fname,
- struct durable_open_vs_lease test)
+static bool test_one_durable_open_open
_lease
(struct torture_context *tctx,
+
struct smb2_tree *tree,
+
const char *fname,
+
struct durable_open_vs_lease test)
{
NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
{
NTSTATUS status;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
@@
-294,8
+294,8
@@
done:
return ret;
}
return ret;
}
-bool test_durable_open_open
2
(struct torture_context *tctx,
- struct smb2_tree *tree)
+bool test_durable_open_open
_lease
(struct torture_context *tctx,
+
struct smb2_tree *tree)
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
char fname[256];
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
char fname[256];
@@
-309,7
+309,7
@@
bool test_durable_open_open2(struct torture_context *tctx,
}
/* Choose a random name in case the state is left a little funky. */
}
/* Choose a random name in case the state is left a little funky. */
- snprintf(fname, 256, "durable_open_open
2
_%s.dat", generate_random_str(tctx, 8));
+ snprintf(fname, 256, "durable_open_open
_lease
_%s.dat", generate_random_str(tctx, 8));
smb2_util_unlink(tree, fname);
smb2_util_unlink(tree, fname);
@@
-317,10
+317,10
@@
bool test_durable_open_open2(struct torture_context *tctx,
/* test various oplock levels with durable open */
for (i = 0; i < NUM_LEASE_OPEN_TESTS; i++) {
/* test various oplock levels with durable open */
for (i = 0; i < NUM_LEASE_OPEN_TESTS; i++) {
- ret = test_one_durable_open_open
2
(tctx,
- tree,
- fname,
- durable_open_vs_lease_table[i]);
+ ret = test_one_durable_open_open
_lease
(tctx,
+
tree,
+
fname,
+
durable_open_vs_lease_table[i]);
if (ret == false) {
goto done;
}
if (ret == false) {
goto done;
}
@@
-1088,7
+1088,7
@@
bool test_durable_open_lock(struct torture_context *tctx,
* reconnect after an open, the oplock/lease tests above will certainly
* demonstrate an error on reconnect.
*/
* reconnect after an open, the oplock/lease tests above will certainly
* demonstrate an error on reconnect.
*/
-bool test_durable_open_open_lease(struct torture_context *tctx,
+bool test_durable_open_open
2
_lease(struct torture_context *tctx,
struct smb2_tree *tree1,
struct smb2_tree *tree2)
{
struct smb2_tree *tree1,
struct smb2_tree *tree2)
{
@@
-1112,7
+1112,7
@@
bool test_durable_open_open_lease(struct torture_context *tctx,
* little funky.
*/
lease = random();
* little funky.
*/
lease = random();
- snprintf(fname, 256, "durable_open_open_lease_%s.dat",
+ snprintf(fname, 256, "durable_open_open
2
_lease_%s.dat",
generate_random_str(tctx, 8));
/* Clean slate */
generate_random_str(tctx, 8));
/* Clean slate */
@@
-1190,9
+1190,9
@@
bool test_durable_open_open_lease(struct torture_context *tctx,
* reconnect after an open, the oplock/lease tests above will certainly
* demonstrate an error on reconnect.
*/
* reconnect after an open, the oplock/lease tests above will certainly
* demonstrate an error on reconnect.
*/
-bool test_durable_open_open_oplock(struct torture_context *tctx,
- struct smb2_tree *tree1,
- struct smb2_tree *tree2)
+bool test_durable_open_open
2
_oplock(struct torture_context *tctx,
+
struct smb2_tree *tree1,
+
struct smb2_tree *tree2)
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io1, io2;
{
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_create io1, io2;
@@
-1205,7
+1205,7
@@
bool test_durable_open_open_oplock(struct torture_context *tctx,
* Choose a random name and random lease in case the state is left a
* little funky.
*/
* Choose a random name and random lease in case the state is left a
* little funky.
*/
- snprintf(fname, 256, "durable_open_open_oplock_%s.dat",
+ snprintf(fname, 256, "durable_open_open
2
_oplock_%s.dat",
generate_random_str(tctx, 8));
/* Clean slate */
generate_random_str(tctx, 8));
/* Clean slate */
@@
-1266,8
+1266,8
@@
struct torture_suite *torture_smb2_durable_open_init(void)
struct torture_suite *suite =
torture_suite_create(talloc_autofree_context(), "durable-open");
struct torture_suite *suite =
torture_suite_create(talloc_autofree_context(), "durable-open");
- torture_suite_add_1smb2_test(suite, "open
1", test_durable_open_open1
);
- torture_suite_add_1smb2_test(suite, "open
2", test_durable_open_open2
);
+ torture_suite_add_1smb2_test(suite, "open
-oplock", test_durable_open_open_oplock
);
+ torture_suite_add_1smb2_test(suite, "open
-lease", test_durable_open_open_lease
);
torture_suite_add_1smb2_test(suite, "reopen1", test_durable_open_reopen1);
torture_suite_add_1smb2_test(suite, "reopen2", test_durable_open_reopen2);
torture_suite_add_1smb2_test(suite, "reopen2a", test_durable_open_reopen2a);
torture_suite_add_1smb2_test(suite, "reopen1", test_durable_open_reopen1);
torture_suite_add_1smb2_test(suite, "reopen2", test_durable_open_reopen2);
torture_suite_add_1smb2_test(suite, "reopen2a", test_durable_open_reopen2a);
@@
-1278,10
+1278,10
@@
struct torture_suite *torture_smb2_durable_open_init(void)
torture_suite_add_2smb2_test(suite, "oplock", test_durable_open_oplock);
torture_suite_add_2smb2_test(suite, "lease", test_durable_open_lease);
torture_suite_add_1smb2_test(suite, "lock", test_durable_open_lock);
torture_suite_add_2smb2_test(suite, "oplock", test_durable_open_oplock);
torture_suite_add_2smb2_test(suite, "lease", test_durable_open_lease);
torture_suite_add_1smb2_test(suite, "lock", test_durable_open_lock);
- torture_suite_add_2smb2_test(suite, "open-lease",
- test_durable_open_open_lease);
- torture_suite_add_2smb2_test(suite, "open-oplock",
- test_durable_open_open_oplock);
+ torture_suite_add_2smb2_test(suite, "open
2
-lease",
+ test_durable_open_open
2
_lease);
+ torture_suite_add_2smb2_test(suite, "open
2
-oplock",
+ test_durable_open_open
2
_oplock);
suite->description = talloc_strdup(suite, "SMB2-DURABLE-OPEN tests");
suite->description = talloc_strdup(suite, "SMB2-DURABLE-OPEN tests");