mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
Reorganize old persistent_handles test into durable_open.c, turn it into a suite instead of a solo test (in anticipation of more tests).
This commit is contained in:
parent
0788436b57
commit
7278c549ea
@ -20,7 +20,7 @@ TORTURE_SMB2_OBJ_FILES = $(addprefix $(torturesrcdir)/smb2/, \
|
||||
lock.o \
|
||||
notify.o \
|
||||
smb2.o \
|
||||
persistent_handles.o \
|
||||
durable_open.o \
|
||||
oplocks.o \
|
||||
create.o \
|
||||
read.o)
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
|
||||
test suite for SMB2 persistent file handles
|
||||
test suite for SMB2 durable opens
|
||||
|
||||
Copyright (C) Stefan Metzmacher 2008
|
||||
|
||||
@ -41,19 +41,19 @@
|
||||
goto done; \
|
||||
}} while (0)
|
||||
|
||||
/*
|
||||
basic testing of SMB2 persistent file handles
|
||||
/*
|
||||
basic testing of SMB2 durable opens
|
||||
regarding the position information on the handle
|
||||
*/
|
||||
bool torture_smb2_persistent_handles1(struct torture_context *tctx,
|
||||
struct smb2_tree *tree1,
|
||||
struct smb2_tree *tree2)
|
||||
bool test_durable_open_file_position(struct torture_context *tctx,
|
||||
struct smb2_tree *tree1,
|
||||
struct smb2_tree *tree2)
|
||||
{
|
||||
TALLOC_CTX *mem_ctx = talloc_new(tctx);
|
||||
struct smb2_handle h1, h2;
|
||||
struct smb2_create io1, io2;
|
||||
NTSTATUS status;
|
||||
const char *fname = "persistent_handles.dat";
|
||||
const char *fname = "durable_opens.dat";
|
||||
DATA_BLOB b;
|
||||
union smb_fileinfo qfinfo;
|
||||
union smb_setfileinfo sfinfo;
|
||||
@ -181,3 +181,14 @@ bool torture_smb2_persistent_handles1(struct torture_context *tctx,
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct torture_suite *torture_smb2_durable_open_init(void)
|
||||
{
|
||||
struct torture_suite *suite = torture_suite_create(talloc_autofree_context(),
|
||||
"DURABLE-OPEN");
|
||||
|
||||
torture_suite_add_2smb2_test(suite, "FILE-POSITION",
|
||||
test_durable_open_file_position);
|
||||
|
||||
suite->description = talloc_strdup(suite, "SMB2-DURABLE-OPEN tests");
|
||||
}
|
@ -139,7 +139,7 @@ NTSTATUS torture_smb2_init(void)
|
||||
torture_suite_add_suite(suite, torture_smb2_read_init());
|
||||
torture_suite_add_suite(suite, torture_smb2_create_init());
|
||||
torture_suite_add_simple_test(suite, "NOTIFY", torture_smb2_notify);
|
||||
torture_suite_add_2smb2_test(suite, "PERSISTENT-HANDLES1", torture_smb2_persistent_handles1);
|
||||
torture_suite_add_suite(suite, torture_smb2_durable_open_init());
|
||||
torture_suite_add_1smb2_test(suite, "OPLOCK-BATCH1", torture_smb2_oplock_batch1);
|
||||
|
||||
suite->description = talloc_strdup(suite, "SMB2-specific tests");
|
||||
|
Loading…
x
Reference in New Issue
Block a user