Reorganize old persistent_handles test into durable_open.c, turn it into a suite...
authorZach Loafman <zachary.loafman@isilon.com>
Thu, 26 Mar 2009 16:32:50 +0000 (09:32 -0700)
committerSteven Danneman <steven.danneman@isilon.com>
Thu, 26 Mar 2009 23:42:10 +0000 (16:42 -0700)
source4/torture/smb2/config.mk
source4/torture/smb2/durable_open.c [moved from source4/torture/smb2/persistent_handles.c with 90% similarity]
source4/torture/smb2/smb2.c

index e0fc29f2789559579698f448715f1139e99f57b9..91ba9fcf0c2134112548b1543c2f16d14935414c 100644 (file)
@@ -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)
similarity index 90%
rename from source4/torture/smb2/persistent_handles.c
rename to source4/torture/smb2/durable_open.c
index 05c5dbbe858cb4041a63525a18a0e3eadfc18f1c..3cf6e85de3220dd85fad4dc88d9765ff2201525b 100644 (file)
@@ -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
 
                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");
+}
index 9418650de452c05854798db90cf464a2e03fa44b..3b2e752295f445f7b4a3c9496f38db6cd2ab95a7 100644 (file)
@@ -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");