s4:torture make a suite for smb2.*scan
authorGregor Beck <gbeck@sernet.de>
Thu, 1 Mar 2012 14:59:41 +0000 (15:59 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 6 Mar 2012 22:53:07 +0000 (23:53 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/torture/smb2/scan.c
source4/torture/smb2/smb2.c

index 92fbc68..18a5cbf 100644 (file)
@@ -32,7 +32,7 @@
 /* 
    scan for valid SMB2 getinfo levels
 */
-bool torture_smb2_getinfo_scan(struct torture_context *torture)
+static bool torture_smb2_getinfo_scan(struct torture_context *torture)
 {
        struct smb2_tree *tree;
        NTSTATUS status;
@@ -108,7 +108,7 @@ bool torture_smb2_getinfo_scan(struct torture_context *torture)
 /* 
    scan for valid SMB2 setinfo levels
 */
-bool torture_smb2_setinfo_scan(struct torture_context *torture)
+static bool torture_smb2_setinfo_scan(struct torture_context *torture)
 {
        static const char *FNAME  = "scan-setinfo.dat";
        static const char *FNAME2 = "scan-setinfo.dat:2ndstream";
@@ -156,7 +156,7 @@ bool torture_smb2_setinfo_scan(struct torture_context *torture)
 /* 
    scan for valid SMB2 scan levels
 */
-bool torture_smb2_find_scan(struct torture_context *torture)
+static bool torture_smb2_find_scan(struct torture_context *torture)
 {
        struct smb2_tree *tree;
        NTSTATUS status;
@@ -200,7 +200,7 @@ bool torture_smb2_find_scan(struct torture_context *torture)
 /* 
    scan for valid SMB2 opcodes
 */
-bool torture_smb2_scan(struct torture_context *torture)
+static bool torture_smb2_scan(struct torture_context *torture)
 {
        TALLOC_CTX *mem_ctx = talloc_new(NULL);
        struct smb2_tree *tree;
@@ -256,3 +256,17 @@ bool torture_smb2_scan(struct torture_context *torture)
 
        return true;
 }
+
+struct torture_suite *torture_smb2_scan_init(void)
+{
+       struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "scan");
+
+       torture_suite_add_simple_test(suite, "scan", torture_smb2_scan);
+       torture_suite_add_simple_test(suite, "getinfo", torture_smb2_getinfo_scan);
+       torture_suite_add_simple_test(suite, "setinfo", torture_smb2_setinfo_scan);
+       torture_suite_add_simple_test(suite, "find", torture_smb2_find_scan);
+
+       suite->description = talloc_strdup(suite, "scan target (not a test)");
+
+       return suite;
+}
index d5fc1db..9ea71b4 100644 (file)
@@ -140,10 +140,7 @@ NTSTATUS torture_smb2_init(void)
 {
        struct torture_suite *suite = torture_suite_create(talloc_autofree_context(), "smb2");
        torture_suite_add_simple_test(suite, "connect", torture_smb2_connect);
-       torture_suite_add_simple_test(suite, "scan", torture_smb2_scan);
-       torture_suite_add_simple_test(suite, "scangetinfo", torture_smb2_getinfo_scan);
-       torture_suite_add_simple_test(suite, "scansetinfo", torture_smb2_setinfo_scan);
-       torture_suite_add_simple_test(suite, "scanfind", torture_smb2_find_scan);
+       torture_suite_add_suite(suite, torture_smb2_scan_init());
        torture_suite_add_simple_test(suite, "getinfo", torture_smb2_getinfo);
        torture_suite_add_simple_test(suite, "setinfo", torture_smb2_setinfo);
        torture_suite_add_suite(suite, torture_smb2_lock_init());