summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Loafman <zachary.loafman@isilon.com>2009-03-26 09:32:50 -0700
committerSteven Danneman <steven.danneman@isilon.com>2009-03-26 16:42:10 -0700
commit7278c549ea7ea4a83ff164a9f9bf335fa4d11dd8 (patch)
tree434f3b0d40b29b9497f98e7ae14137b680bcfc84
parent0788436b579b78088bfa9d77fb4c47f652ad5eb8 (diff)
downloadsamba-7278c549ea7ea4a83ff164a9f9bf335fa4d11dd8.tar.gz
samba-7278c549ea7ea4a83ff164a9f9bf335fa4d11dd8.tar.bz2
samba-7278c549ea7ea4a83ff164a9f9bf335fa4d11dd8.zip
Reorganize old persistent_handles test into durable_open.c, turn it into a suite instead of a solo test (in anticipation of more tests).
-rw-r--r--source4/torture/smb2/config.mk2
-rw-r--r--source4/torture/smb2/durable_open.c (renamed from source4/torture/smb2/persistent_handles.c)25
-rw-r--r--source4/torture/smb2/smb2.c2
3 files changed, 20 insertions, 9 deletions
diff --git a/source4/torture/smb2/config.mk b/source4/torture/smb2/config.mk
index e0fc29f278..91ba9fcf0c 100644
--- a/source4/torture/smb2/config.mk
+++ b/source4/torture/smb2/config.mk
@@ -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)
diff --git a/source4/torture/smb2/persistent_handles.c b/source4/torture/smb2/durable_open.c
index 05c5dbbe85..3cf6e85de3 100644
--- a/source4/torture/smb2/persistent_handles.c
+++ b/source4/torture/smb2/durable_open.c
@@ -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");
+}
diff --git a/source4/torture/smb2/smb2.c b/source4/torture/smb2/smb2.c
index 9418650de4..3b2e752295 100644
--- a/source4/torture/smb2/smb2.c
+++ b/source4/torture/smb2/smb2.c
@@ -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");