s4/drs(tort): TORTURE_DRS torture module - initial implementation
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>
Mon, 5 Oct 2009 15:39:13 +0000 (18:39 +0300)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Fri, 16 Oct 2009 09:54:14 +0000 (12:54 +0300)
Drsuapi tests module registers two suites:
 - DRS-RPC - tests to be executed against remote machine
 - DRS-UNIT - unit test for internal testing

source4/torture/config.mk
source4/torture/drs/config.mk [new file with mode: 0644]
source4/torture/drs/drs_init.c [new file with mode: 0644]
source4/torture/torture.c

index b85a0f84b1ce7291473b574402ad10ed4b557cca..00362b6358357cdc9f341935ee0798a21f9eb5d9 100644 (file)
@@ -125,6 +125,10 @@ torture_rpc_OBJ_FILES = $(addprefix $(torturesrcdir)/rpc/, \
 
 $(eval $(call proto_header_template,$(torturesrcdir)/rpc/proto.h,$(torture_rpc_OBJ_FILES:.o=.c)))
 
+#################################
+# RPC/Local DRSUAPI tests
+mkinclude drs/config.mk
+
 #################################
 # Start SUBSYSTEM TORTURE_RAP
 [MODULE::TORTURE_RAP]
diff --git a/source4/torture/drs/config.mk b/source4/torture/drs/config.mk
new file mode 100644 (file)
index 0000000..1044541
--- /dev/null
@@ -0,0 +1,22 @@
+#################################
+# Start SUBSYSTEM TORTURE_DRS
+[MODULE::TORTURE_DRS]
+SUBSYSTEM = smbtorture
+OUTPUT_TYPE = MERGED_OBJ
+INIT_FUNCTION = torture_drs_init
+PRIVATE_DEPENDENCIES = \
+               NDR_TABLE RPC_NDR_UNIXINFO dcerpc_samr RPC_NDR_WINREG RPC_NDR_INITSHUTDOWN \
+               RPC_NDR_OXIDRESOLVER RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL \
+               RPC_NDR_NETLOGON dcerpc_atsvc dcerpc_mgmt RPC_NDR_DRSUAPI \
+               RPC_NDR_LSA RPC_NDR_EPMAPPER RPC_NDR_DFS RPC_NDR_FRSAPI RPC_NDR_SPOOLSS \
+               RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP \
+               RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER RPC_NDR_NTSVCS WB_HELPER LIBSAMBA-NET \
+               LIBCLI_AUTH POPT_CREDENTIALS TORTURE_LDAP TORTURE_UTIL TORTURE_RAP \
+               dcerpc_server service process_model ntvfs SERVICE_SMB RPC_NDR_BROWSER LIBCLI_DRSUAPI TORTURE_LDB_MODULE
+# End SUBSYSTEM TORTURE_DRS
+#################################
+
+TORTURE_DRS_OBJ_FILES = \
+               $(torturesrcdir)/drs/drs_init.o
+
+$(eval $(call proto_header_template,$(torturesrcdir)/drs/proto.h,$(TORTURE_DRS_OBJ_FILES:.o=.c)))
diff --git a/source4/torture/drs/drs_init.c b/source4/torture/drs/drs_init.c
new file mode 100644 (file)
index 0000000..f26a668
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   DRSUAPI utility functions to be used in torture tests
+
+   Copyright (C) Kamen Mazdrashki <kamen.mazdrashki@postpath.com> 2009
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/smbtorture.h"
+#include "torture/drs/proto.h"
+
+/**
+ * DRSUAPI tests to be executed remotely
+ */
+static struct torture_suite * torture_drs_rpc_suite(TALLOC_CTX *mem_ctx)
+{
+       struct torture_suite *suite = torture_suite_create(
+               talloc_autofree_context(),
+               "RPC");
+
+       return suite;
+}
+
+/**
+ * DRSUAPI tests to be executed remotely
+ */
+static struct torture_suite * torture_drs_unit_suite(TALLOC_CTX *mem_ctx)
+{
+       struct torture_suite *suite = torture_suite_create(
+               talloc_autofree_context(),
+               "UNIT");
+
+       return suite;
+}
+
+/**
+ * DRSUAPI torture module initialization
+ */
+NTSTATUS torture_drs_init(void)
+{
+       struct torture_suite *suite = torture_suite_create(
+               talloc_autofree_context(),
+               "DRS");
+
+       torture_suite_add_suite(suite, torture_drs_rpc_suite(suite));
+       torture_suite_add_suite(suite, torture_drs_unit_suite(suite));
+
+       suite->description = talloc_strdup(suite,
+                                          "DRSUAPI related tests - Remote and Local");
+
+       torture_register_suite(suite);
+
+       return NT_STATUS_OK;
+}
index 39a8005e86dccfc6cd6d4d91278566d480147bf1..774681dac3cfdc08275c0a59e8f2fa346773abe0 100644 (file)
@@ -68,6 +68,7 @@ _PUBLIC_ int torture_init(void)
        extern NTSTATUS torture_raw_init(void);
        extern NTSTATUS torture_unix_init(void);
        extern NTSTATUS torture_winbind_init(void);
+       extern NTSTATUS torture_drs_init(void);
        init_module_fn static_init[] = { STATIC_smbtorture_MODULES };
        init_module_fn *shared_init = load_samba_modules(NULL, cmdline_lp_ctx, "smbtorture");