r14379: Build torture/rpc/ as a seperate smbtorture module. Move helper
authorJelmer Vernooij <jelmer@samba.org>
Tue, 14 Mar 2006 15:02:05 +0000 (15:02 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:57:16 +0000 (13:57 -0500)
functions for rpc out of torture/torture.c

51 files changed:
source/torture/basic/aliases.c
source/torture/basic/locking.c
source/torture/config.mk
source/torture/libnet/domain.c
source/torture/libnet/libnet_share.c
source/torture/libnet/userinfo.c
source/torture/libnet/userman.c
source/torture/nbt/dgram.c
source/torture/raw/acls.c
source/torture/rpc/alter_context.c
source/torture/rpc/atsvc.c
source/torture/rpc/autoidl.c
source/torture/rpc/bench.c
source/torture/rpc/bind.c
source/torture/rpc/countcalls.c
source/torture/rpc/dcom.c
source/torture/rpc/dfs.c
source/torture/rpc/drsuapi.c
source/torture/rpc/drsuapi.h
source/torture/rpc/drsuapi_cracknames.c
source/torture/rpc/dssetup.c
source/torture/rpc/dssync.c
source/torture/rpc/echo.c
source/torture/rpc/epmapper.c
source/torture/rpc/eventlog.c
source/torture/rpc/initshutdown.c
source/torture/rpc/join.c
source/torture/rpc/lsa.c
source/torture/rpc/lsa_lookup.c
source/torture/rpc/mgmt.c
source/torture/rpc/netlogon.c
source/torture/rpc/oxidresolve.c
source/torture/rpc/remact.c
source/torture/rpc/rot.c
source/torture/rpc/rpc.c [new file with mode: 0644]
source/torture/rpc/rpc.h [new file with mode: 0644]
source/torture/rpc/samlogon.c
source/torture/rpc/samr.c
source/torture/rpc/samsync.c
source/torture/rpc/scanner.c
source/torture/rpc/schannel.c
source/torture/rpc/session_key.c
source/torture/rpc/spoolss.c
source/torture/rpc/srvsvc.c
source/torture/rpc/svcctl.c
source/torture/rpc/testjoin.c
source/torture/rpc/unixinfo.c
source/torture/rpc/winreg.c
source/torture/rpc/wkssvc.c
source/torture/torture.c
source/torture/torture.h [new file with mode: 0644]

index 104fdc193332f4ea8989e09f403930e92b89eaa4..142899ba8d7998b565d51902a01bc5f6801d2db2 100644 (file)
 */
 
 #include "includes.h"
-#include "torture/torture.h"
 #include "dlinklist.h"
 #include "libcli/raw/libcliraw.h"
-#include "libcli/libcli.h"
+#include "torture/torture.h"
 
 int create_complex_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, const char *fname);
 
index 307bb0fafc0ae5c1511425d8a5e9bbf6e4a37481..9a00ab3efa5fbd2ceca2a4cb0622d08f7648a401 100644 (file)
@@ -22,9 +22,9 @@
 */
 
 #include "includes.h"
-#include "torture/torture.h"
 #include "libcli/raw/libcliraw.h"
 #include "libcli/libcli.h"
+#include "torture/torture.h"
 #include "system/time.h"
 #include "system/filesys.h"
 
index cd6c8964752e7be28faee755da5c3a31d5e6760f..b6381af3f94a749121c0c2ef5834cf10f59c24c1 100644 (file)
@@ -73,9 +73,9 @@ OBJ_FILES = \
 REQUIRED_SUBSYSTEMS = \
                com dcom
 
-#################################
-# Start SUBSYSTEM TORTURE_RPC
-[SUBSYSTEM::TORTURE_RPC]
+[MODULE::torture_rpc]
+SUBSYSTEM = smbtorture
+INIT_FUNCTION = torture_rpc_init
 PRIVATE_PROTO_HEADER = \
                rpc/proto.h
 OBJ_FILES = \
@@ -115,7 +115,8 @@ OBJ_FILES = \
                rpc/bind.o \
                rpc/dssetup.o \
                rpc/alter_context.o \
-               rpc/bench.o
+               rpc/bench.o \
+               rpc/rpc.o
 REQUIRED_SUBSYSTEMS = \
                NDR_TABLE RPC_NDR_UNIXINFO RPC_NDR_SAMR RPC_NDR_WINREG RPC_NDR_INITSHUTDOWN \
                RPC_NDR_OXIDRESOLVER RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL \
@@ -123,8 +124,6 @@ REQUIRED_SUBSYSTEMS = \
                RPC_NDR_LSA RPC_NDR_EPMAPPER RPC_NDR_DFS RPC_NDR_SPOOLSS \
                RPC_NDR_SRVSVC RPC_NDR_WKSSVC RPC_NDR_ROT RPC_NDR_DSSETUP \
                RPC_NDR_REMACT RPC_NDR_OXIDRESOLVER WB_HELPER 
-# End SUBSYSTEM TORTURE_RPC
-#################################
 
 #################################
 # Start SUBSYSTEM TORTURE_RAP
@@ -219,7 +218,7 @@ REQUIRED_SUBSYSTEMS = \
 # Start BINARY smbtorture
 [BINARY::smbtorture]
 INSTALLDIR = BINDIR
-PRIVATE_PROTO_HEADER = torture.h
+PRIVATE_PROTO_HEADER = proto.h
 OBJ_FILES = \
                torture.o \
                torture_util.o
@@ -227,7 +226,6 @@ REQUIRED_SUBSYSTEMS = \
                TORTURE_BASIC \
                TORTURE_RAW \
                TORTURE_SMB2 \
-               TORTURE_RPC \
                TORTURE_RAP \
                TORTURE_AUTH \
                TORTURE_LOCAL \
index 79c3ccd9fd116b97285d8ef9c07a576cd3b0f28e..439561e3d06a29ded8d31c7d8d9e40c01cb477a0 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 #include "includes.h"
-#include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "libnet/libnet.h"
 
 static BOOL test_domainopen(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
index 93919a41294053315294b8ca9e1a7e30bd5ce87a..25a86a7072f3ae963431d8434c1415f8468c5416 100644 (file)
@@ -21,7 +21,7 @@
 */
 
 #include "includes.h"
-#include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "libnet/libnet.h"
 #include "lib/cmdline/popt_common.h"
 
index 589b2ee288cd37954d0d9943c65f64d89cfec59e..cf5dc2e410a248daaecc74ed85a024c1bd54f298 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 #include "includes.h"
-#include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "libnet/libnet.h"
 #include "libnet/userinfo.h"
 #include "libcli/security/proto.h"
index e9528f45985338f6a3c6d8f3d076be03ca53c774..f4d988e1b9796910b3192e15760134c7d387d614 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 #include "includes.h"
-#include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "libnet/userman.h"
 #include "libnet/libnet.h"
 
index 8e6ec290fa52fe35a2f3099e9a57a8a2b9107ec4..0de55543936e7dfe2526607c8efb39494ed51522 100644 (file)
@@ -25,8 +25,7 @@
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "lib/socket/socket.h"
 #include "lib/events/events.h"
-#include "auth/credentials/credentials.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 #include "libcli/resolve/resolve.h"
 #include "system/network.h"
 #include "netif/netif.h"
index 5583178f3e81e3fda364171ce8acaef54b2e9fc9..7a7780c01ce1069f4868f1a0192bdb0ccba474c8 100644 (file)
@@ -24,6 +24,7 @@
 #include "torture/torture.h"
 #include "libcli/raw/libcliraw.h"
 #include "libcli/libcli.h"
+#include "librpc/gen_ndr/lsa.h"
 #include "libcli/util/clilsa.h"
 #include "libcli/security/proto.h"
 
index b76cf605b2a475ca40b3536c237720548aeaba7c..62cfcf758d3b708072c45c5389ff530a9f3f6da9 100644 (file)
@@ -24,8 +24,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "librpc/gen_ndr/ndr_dssetup.h"
-#include "auth/credentials/credentials.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 
 BOOL torture_rpc_alter_context(void)
 {
index 7a282dd1be013acf53f92b99f924b836bea791c7..bfc44a4bb19929562d6b3830a18dcb53d1e90c5b 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_atsvc.h"
+#include "torture/rpc/rpc.h"
 
 static BOOL test_JobGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, uint32_t job_id)
 {
index 32bee5c3631a80070f3f41813ba65e09b6046578..cc9d8a1641d343f044380d2319f94ed73ecdb1aa 100644 (file)
@@ -25,6 +25,7 @@
 #include "librpc/gen_ndr/ndr_drsuapi.h"
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "librpc/rpc/dcerpc_table.h"
+#include "torture/rpc/rpc.h"
 
 
 #if 1
index b0605649c3ac8c1497a39902fbb70969fa8831de..c4a08597259dc77888bf7c9ad44e176362740c9e 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_srvsvc.h"
+#include "torture/rpc/rpc.h"
 
 /**************************/
 /* srvsvc_NetShare        */
index a1fd3d65b2cf2e707c37ab42f9ee5e3a10c9e5f7..2a6cb53979f73f68633138b6bcd49febd03a3890 100644 (file)
@@ -25,6 +25,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "lib/cmdline/popt_common.h"
+#include "torture/rpc/rpc.h"
 
 /*
   This test is 'bogus' in that it doesn't actually perform to the
index 9da8e54a91aafdaad04ed52626ded614e6b7bec5..8ad5241ada3cdcf5e4d0400c266b4b5750f08b8c 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/rpc/dcerpc_table.h"
+#include "torture/rpc/rpc.h"
 
 
 BOOL torture_rpc_countcalls(void)
index 71a7c8d0aa5ca47ee7a5b10a6b14128e54631d49..b9ff5adffe20be46a1f0eb07beb04d56db0017e1 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "librpc/gen_ndr/ndr_oxidresolver.h"
 
 BOOL torture_rpc_dcom(void)
index 3e600a4f44408b7c3b447bde888acfc5c487a4a5..14261c41235dfe6d703319e43d6c7d9488e8378e 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "librpc/gen_ndr/ndr_dfs.h"
 
 
index f23bb5586beb9cf99a16f70bc4971bb0dafa8ced..0b700a7ac4772570ea497f07f1b6dd1fcc5919f7 100644 (file)
@@ -25,9 +25,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_drsuapi.h"
-#include "auth/credentials/credentials.h"
-#include "torture/rpc/drsuapi.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 
 BOOL test_DsBind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
                 struct DsPrivate *priv)
index 25bbc7ebedcb1d1adbf6bf2c99b1f7ad5ca61a15..4914d0a2727a03921b0bdce03e0590a11c87af75 100644 (file)
@@ -22,6 +22,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include "librpc/gen_ndr/drsuapi.h"
 
 struct DsPrivate {
        struct policy_handle bind_handle;
index 0a44084dde48c3009d6782c6eaf8000bec668581..ef8a5cc45d3e221899745520567390b736c1448e 100644 (file)
@@ -25,9 +25,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_drsuapi.h"
-#include "auth/credentials/credentials.h"
-#include "torture/rpc/drsuapi.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 #include "ldb/include/ldb.h"
 
 static BOOL test_DsCrackNamesMatrix(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
index ea5925db0c4c9cb9193ef3f35aa2f16c98fb599c..70f8c99dde3ce5cd2d271767954b3e6cbac73524 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_dssetup.h"
+#include "torture/rpc/rpc.h"
 
 
 BOOL test_DsRoleGetPrimaryDomainInformation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
index 3731f19c617249c4cbbe8e84d1cfbb2baeb7e08b..d334f162bcb31466b2b3265cd7db63f46810beec 100644 (file)
@@ -25,6 +25,7 @@
 #include "lib/cmdline/popt_common.h"
 #include "librpc/gen_ndr/ndr_drsuapi.h"
 #include "libcli/cldap/cldap.h"
+#include "libcli/ldap/ldap_client.h"
 #include "torture/ldap/proto.h"
 
 struct DsSyncBindInfo {
index 02631d0b444eb139e7c194d15d9340efea4c20a6..49752665e4e4ba16346dc4fb4cca7627b12c9b62 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "includes.h"
 #include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "lib/events/events.h"
 #include "librpc/gen_ndr/ndr_echo.h"
 
index bf5747eb9344254d770c5db57198394264a49f9f..4f6cb122a86a3f25139c3236c26dd84e3fe1f19b 100644 (file)
@@ -23,6 +23,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
 #include "librpc/rpc/dcerpc_table.h"
+#include "torture/rpc/rpc.h"
 
 
 /*
index 64c2b0b4ad39fcb6575ab8497f71f6bad3189ace..8de099d2152ef7e88927f783f155cc1a11d9b40f 100644 (file)
@@ -24,6 +24,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_eventlog.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
+#include "torture/rpc/rpc.h"
 
 static void init_lsa_String(struct lsa_String *name, const char *s)
 {
index 4b754acf74bfcf6cfad8f2603ff80597e52c5011..efd320052dc92cfa6b0172e890f4a752fc06e0a2 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_initshutdown.h"
+#include "torture/rpc/rpc.h"
 
 static void init_initshutdown_String(TALLOC_CTX *mem_ctx, struct initshutdown_String *name, const char *s)
 {
index 7dea5cdb26edd995f156476637f871344dd09716..2a3c26087f673704b4017377df411a8b94ababb5 100644 (file)
@@ -2,7 +2,7 @@
 #include "libnet/libnet.h"
 
 #include "auth/credentials/credentials.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 
 #define TORTURE_NETBIOS_NAME "smbtorturejoin"
 
index eaced4b3d33340ddfdeffb7ebba8b9b858f6fd0c..980c9b36e690666fade62dd6c11515bc382ad20b 100644 (file)
@@ -25,8 +25,8 @@
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "lib/events/events.h"
 #include "libcli/security/proto.h"
-#include "auth/credentials/credentials.h"
-#include "libcli/auth/proto.h"
+#include "libcli/auth/libcli_auth.h"
+#include "torture/rpc/rpc.h"
 
 static void init_lsa_String(struct lsa_String *name, const char *s)
 {
index aa36c63f29fd396a538ae380a2a9621f2b27a035..c009f89f58eaa8642b01a21567a42e64db9b785a 100644 (file)
@@ -24,6 +24,8 @@
 #include "librpc/gen_ndr/ndr_lsa.h"
 #include "lib/events/events.h"
 #include "libcli/security/proto.h"
+#include "libnet/libnet_join.h"
+#include "torture/rpc/rpc.h"
 
 static BOOL open_policy(TALLOC_CTX *mem_ctx, struct dcerpc_pipe *p,
                        struct policy_handle **handle)
index 5e6f0e366eee31ccba284feb1f9119a35fd1107d..d94c65e1d93e286d9ca753d543b14a31eecfaaa6 100644 (file)
@@ -24,6 +24,7 @@
 #include "librpc/gen_ndr/ndr_mgmt.h"
 #include "auth/gensec/gensec.h"
 #include "librpc/rpc/dcerpc_table.h"
+#include "torture/rpc/rpc.h"
 
 
 /*
index e786dd38982e973011b35fe9690d89fd36903d94..a64df0f5bb17ac7b070c71a5faf9194a30229702 100644 (file)
@@ -28,8 +28,8 @@
 #include "auth/auth.h"
 #include "smb.h"
 #include "lib/cmdline/popt_common.h"
-#include "torture/rpc/proto.h"
-#include "libcli/auth/proto.h"
+#include "torture/rpc/rpc.h"
+#include "libcli/auth/libcli_auth.h"
 
 static const char *machine_password;
 
index 837d64cc529e945e03eb6e4ef2a9abeddead94fe..e3070fa6ee9c07da0dd463e02e1b31f8fa787dbb 100644 (file)
@@ -24,6 +24,7 @@
 #include "librpc/gen_ndr/ndr_oxidresolver.h"
 #include "librpc/gen_ndr/ndr_remact.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
+#include "torture/rpc/rpc.h"
 
 #define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
 
index 62d1d2e0d69810cadd893b2211d743ff227339f9..69c31fc6427a269ab86491f5adeb912a855cf9f7 100644 (file)
@@ -23,6 +23,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_remact.h"
 #include "librpc/gen_ndr/ndr_epmapper.h"
+#include "torture/rpc/rpc.h"
 
 #define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
 
index ccddab086e95683991e257c61c17650dc2d20f5f..48a8717fa53e5ff66c9f021d56167fd7f76b70d4 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_rot.h"
+#include "torture/rpc/rpc.h"
 
 BOOL torture_rpc_rot(void)
 {
diff --git a/source/torture/rpc/rpc.c b/source/torture/rpc/rpc.c
new file mode 100644 (file)
index 0000000..4fe35a5
--- /dev/null
@@ -0,0 +1,125 @@
+/* 
+   Unix SMB/CIFS implementation.
+   SMB torture tester
+   Copyright (C) Andrew Tridgell 1997-2003
+   Copyright (C) Jelmer Vernooij 2006
+   
+   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 2 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, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "includes.h"
+#include "auth/credentials/credentials.h"
+#include "lib/cmdline/popt_common.h"
+#include "torture/rpc/rpc.h"
+#include "torture/torture.h"
+
+/* open a rpc connection to the chosen binding string */
+NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx, 
+                               struct dcerpc_pipe **p, 
+                               const struct dcerpc_interface_table *table)
+{
+        NTSTATUS status;
+       const char *binding = lp_parm_string(-1, "torture", "binding");
+
+       if (!binding) {
+               printf("You must specify a ncacn binding string\n");
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
+       status = dcerpc_pipe_connect(parent_ctx, 
+                                    p, binding, table,
+                                    cmdline_credentials, NULL);
+        return status;
+}
+
+/* open a rpc connection to a specific transport */
+NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx, 
+                                         struct dcerpc_pipe **p, 
+                                         const struct dcerpc_interface_table *table,
+                                         enum dcerpc_transport_t transport)
+{
+        NTSTATUS status;
+       const char *binding = lp_parm_string(-1, "torture", "binding");
+       struct dcerpc_binding *b;
+       TALLOC_CTX *mem_ctx = talloc_named(parent_ctx, 0, "torture_rpc_connection_smb");
+
+       if (!binding) {
+               printf("You must specify a ncacn binding string\n");
+               talloc_free(mem_ctx);
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
+       status = dcerpc_parse_binding(mem_ctx, binding, &b);
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(0,("Failed to parse dcerpc binding '%s'\n", binding));
+               talloc_free(mem_ctx);
+               return status;
+       }
+
+       b->transport = transport;
+
+       status = dcerpc_pipe_connect_b(mem_ctx, p, b, table,
+                                      cmdline_credentials, NULL);
+                                          
+       if (NT_STATUS_IS_OK(status)) {
+               *p = talloc_reference(parent_ctx, *p);
+       } else {
+               *p = NULL;
+       }
+       talloc_free(mem_ctx);
+        return status;
+}
+
+NTSTATUS torture_rpc_init(void)
+{
+    register_torture_op("RPC-LSA", torture_rpc_lsa, 0);
+    register_torture_op("RPC-LSALOOKUP", torture_rpc_lsa_lookup, 0);
+    register_torture_op("RPC-SECRETS", torture_rpc_lsa_secrets, 0);
+    register_torture_op("RPC-ECHO", torture_rpc_echo, 0);
+    register_torture_op("RPC-DFS", torture_rpc_dfs, 0);
+    register_torture_op("RPC-SPOOLSS", torture_rpc_spoolss, 0);
+    register_torture_op("RPC-SAMR", torture_rpc_samr, 0);
+    register_torture_op("RPC-UNIXINFO", torture_rpc_unixinfo, 0);
+    register_torture_op("RPC-NETLOGON", torture_rpc_netlogon, 0);
+    register_torture_op("RPC-SAMLOGON", torture_rpc_samlogon, 0);
+    register_torture_op("RPC-SAMSYNC", torture_rpc_samsync, 0);
+    register_torture_op("RPC-SCHANNEL", torture_rpc_schannel, 0);
+    register_torture_op("RPC-WKSSVC", torture_rpc_wkssvc, 0);
+    register_torture_op("RPC-SRVSVC", torture_rpc_srvsvc, 0);
+    register_torture_op("RPC-SVCCTL", torture_rpc_svcctl, 0);
+    register_torture_op("RPC-ATSVC", torture_rpc_atsvc, 0);
+    register_torture_op("RPC-EVENTLOG", torture_rpc_eventlog, 0);
+    register_torture_op("RPC-EPMAPPER", torture_rpc_epmapper, 0);
+    register_torture_op("RPC-WINREG", torture_rpc_winreg, 0);
+    register_torture_op("RPC-INITSHUTDOWN", torture_rpc_initshutdown, 0);
+    register_torture_op("RPC-OXIDRESOLVE", torture_rpc_oxidresolve, 0);
+    register_torture_op("RPC-REMACT", torture_rpc_remact, 0);
+    register_torture_op("RPC-MGMT", torture_rpc_mgmt, 0);
+    register_torture_op("RPC-SCANNER", torture_rpc_scanner, 0);
+    register_torture_op("RPC-AUTOIDL", torture_rpc_autoidl, 0);
+    register_torture_op("RPC-COUNTCALLS", torture_rpc_countcalls, 0);
+       register_torture_op("RPC-MULTIBIND", torture_multi_bind, 0);
+       register_torture_op("RPC-DRSUAPI", torture_rpc_drsuapi, 0);
+       register_torture_op("RPC-CRACKNAMES", torture_rpc_drsuapi_cracknames, 0);
+       register_torture_op("RPC-ROT", torture_rpc_rot, 0);
+       register_torture_op("RPC-DSSETUP", torture_rpc_dssetup, 0);
+    register_torture_op("RPC-ALTERCONTEXT", torture_rpc_alter_context, 0);
+    register_torture_op("RPC-JOIN", torture_rpc_join, 0);
+    register_torture_op("RPC-DSSYNC", torture_rpc_dssync, 0);
+       register_torture_op("BENCH-RPC", torture_bench_rpc, 0);
+
+       return NT_STATUS_OK;
+}
diff --git a/source/torture/rpc/rpc.h b/source/torture/rpc/rpc.h
new file mode 100644 (file)
index 0000000..e851287
--- /dev/null
@@ -0,0 +1,30 @@
+/* 
+   Unix SMB/CIFS implementation.
+   SMB torture tester
+   Copyright (C) Andrew Tridgell 1997-2003
+   Copyright (C) Jelmer Vernooij 2006
+   
+   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 2 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, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __TORTURE_RPC_H__
+#define __TORTURE_RPC_H__
+
+#include "auth/credentials/credentials.h"
+#include "torture/rpc/drsuapi.h"
+#include "libnet/libnet_join.h"
+#include "torture/rpc/proto.h"
+
+#endif /* __TORTURE_RPC_H__ */
index 9965e5ddbd7a5c09e58278a27837bc6bab3f8c83..ecca8418b8ff307937f071d6c46dfdcf5ffb2a9c 100644 (file)
@@ -27,9 +27,9 @@
 #include "auth/auth.h"
 #include "lib/crypto/crypto.h"
 #include "lib/cmdline/popt_common.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 #include "auth/gensec/schannel_proto.h"
-#include "libcli/auth/proto.h"
+#include "libcli/auth/libcli_auth.h"
 
 #define TEST_MACHINE_NAME "samlogontest"
 #define TEST_USER_NAME "samlogontestuser"
index f5bbed1805166c0417b93e49f554d6f00a1baf88..e518a0782ee524bf2677f1aa32f06276fb3b0741 100644 (file)
@@ -26,9 +26,9 @@
 #include "librpc/gen_ndr/ndr_samr.h"
 #include "smb.h"
 #include "lib/crypto/crypto.h"
-#include "auth/credentials/credentials.h"
-#include "libcli/auth/proto.h"
+#include "libcli/auth/libcli_auth.h"
 #include "libcli/security/proto.h"
+#include "torture/rpc/rpc.h"
 
 #define TEST_ACCOUNT_NAME "samrtorturetest"
 #define TEST_ALIASNAME "samrtorturetestalias"
index 6155b7ac1e011a1bf39384bdfd5d601137543bcd..75a90b8b55dfc575894bc4ef443c9ef79a16766e 100644 (file)
@@ -28,9 +28,9 @@
 #include "dlinklist.h"
 #include "lib/crypto/crypto.h"
 #include "system/time.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 #include "auth/gensec/schannel_proto.h"
-#include "libcli/auth/proto.h"
+#include "libcli/auth/libcli_auth.h"
 #include "libcli/security/proto.h"
 
 #define TEST_MACHINE_NAME "samsynctest"
index 70160438078be90abc2d10a242dc21d40a33cd7a..d714fe54278be1d1ba75707b48e4e70eb84a34ff 100644 (file)
@@ -24,6 +24,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_mgmt.h"
 #include "librpc/rpc/dcerpc_table.h"
+#include "torture/rpc/rpc.h"
 
 /*
   work out how many calls there are for an interface
index 41ad88d10999e198d010d29090a5edc40eba78d1..f48e4c2a08ab23be6872709832641261469835ed 100644 (file)
 #include "includes.h"
 #include "librpc/gen_ndr/ndr_netlogon.h"
 #include "auth/credentials/credentials.h"
-#include "torture/rpc/proto.h"
+#include "torture/rpc/rpc.h"
 #include "lib/cmdline/popt_common.h"
 #include "auth/gensec/schannel_proto.h"
-#include "libcli/auth/proto.h"
+#include "libcli/auth/libcli_auth.h"
 #include "libcli/security/proto.h"
 
 #define TEST_MACHINE_NAME "schannel"
index 448c85c202ba9275a00f7d5f6c5f69c036ca3d93..9656eda054c30ec29cef77c750262ee27c8b5019 100644 (file)
@@ -24,9 +24,8 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_lsa.h"
 
-#include "auth/credentials/credentials.h"
-#include "torture/rpc/proto.h"
-#include "libcli/auth/proto.h"
+#include "libcli/auth/libcli_auth.h"
+#include "torture/rpc/rpc.h"
 
 static void init_lsa_String(struct lsa_String *name, const char *s)
 {
index fa2b7df418a5f51ec904294ffda8bd257aa11573..9cc438d9b88fa0103b427d72ef2cc9afa37b9ebf 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "librpc/gen_ndr/ndr_spoolss.h"
 
 struct test_spoolss_context {
index 2e4f15807082d695a72f23b5ea204ecc7aed7c2e..e5e92217601f0cb723fb0479aeb545c4e80c93f5 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_srvsvc.h"
+#include "torture/rpc/rpc.h"
 
 /**************************/
 /* srvsvc_NetCharDev      */
index 5f1514419ec0b8134217fb47837ee430e29d560c..dddfea961bc36b46bfb29c47920130180b66185f 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_svcctl.h"
+#include "torture/rpc/rpc.h"
 
 static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *h)
 {
index 02b6366b1e5d4fc5a123e9d21f60d8904e3384b2..4df25d2aea0cfc5037bdaf5aa87a1e9040bc1b74 100644 (file)
 #include "smb.h"
 #include "lib/ldb/include/ldb.h"
 
-#include "auth/credentials/credentials.h"
-#include "torture/rpc/proto.h"
+#include "libcli/auth/libcli_auth.h"
+#include "torture/rpc/rpc.h"
 #include "libcli/security/proto.h"
-#include "libcli/auth/proto.h"
 
 struct test_join {
        struct dcerpc_pipe *p;
index 836e5060dfdfbe8a251f4a3c1bfe379da43d9ba6..946d5e18030cf31494a089de65a026d9196e8809 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "includes.h"
 #include "torture/torture.h"
+#include "torture/rpc/rpc.h"
 #include "librpc/gen_ndr/ndr_unixinfo.h"
 
 
index 293cba0ee1d397aa1de8722f2e51022ae2e57d11..88d50f73d7cef7af3df89de1d0788f3e8b9b684f 100644 (file)
@@ -24,6 +24,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_winreg.h"
 #include "libcli/security/proto.h"
+#include "torture/rpc/rpc.h"
 
 #define TEST_KEY_BASE "smbtorture test"
 #define TEST_KEY1 TEST_KEY_BASE "\\spottyfoot"
index 6adda319bb4c1e1db322a49f9ea0ee098ded7093..01e81a8de72b9b4e03734c3dc516910c15a8749f 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "torture/torture.h"
 #include "librpc/gen_ndr/ndr_wkssvc.h"
+#include "torture/rpc/rpc.h"
 
 
 static BOOL test_NetWkstaGetInfo(struct dcerpc_pipe *p, 
index 3236bbb89c39dcfae21e1a5a3a29d6527060c209..0008d348e028c2acd6d076b0dfa378c9c1a98f8a 100644 (file)
@@ -2,6 +2,7 @@
    Unix SMB/CIFS implementation.
    SMB torture tester
    Copyright (C) Andrew Tridgell 1997-2003
+   Copyright (C) Jelmer Vernooij 2006
    
    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
 #include "libcli/raw/ioctl.h"
 #include "libcli/libcli.h"
 #include "lib/ldb/include/ldb.h"
-#include "librpc/rpc/dcerpc_table.h"
 #include "lib/events/events.h"
 #include "libcli/resolve/resolve.h"
 #include "auth/credentials/credentials.h"
+#include "librpc/rpc/dcerpc_table.h"
+#include "libcli/ldap/ldap_client.h"
 
 #include "torture/basic/proto.h"
 #include "torture/raw/proto.h"
 #include "torture/smb2/proto.h"
-#include "torture/rpc/proto.h"
 #include "torture/rap/proto.h"
 #include "torture/auth/proto.h"
 #include "torture/local/proto.h"
@@ -140,63 +141,6 @@ BOOL torture_close_connection(struct smbcli_state *c)
        return ret;
 }
 
-/* open a rpc connection to the chosen binding string */
-NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx, 
-                               struct dcerpc_pipe **p, 
-                               const struct dcerpc_interface_table *table)
-{
-        NTSTATUS status;
-       const char *binding = lp_parm_string(-1, "torture", "binding");
-
-       if (!binding) {
-               printf("You must specify a ncacn binding string\n");
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       status = dcerpc_pipe_connect(parent_ctx, 
-                                    p, binding, table,
-                                    cmdline_credentials, NULL);
-        return status;
-}
-
-/* open a rpc connection to a specific transport */
-NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx, 
-                                         struct dcerpc_pipe **p, 
-                                         const struct dcerpc_interface_table *table,
-                                         enum dcerpc_transport_t transport)
-{
-        NTSTATUS status;
-       const char *binding = lp_parm_string(-1, "torture", "binding");
-       struct dcerpc_binding *b;
-       TALLOC_CTX *mem_ctx = talloc_named(parent_ctx, 0, "torture_rpc_connection_smb");
-
-       if (!binding) {
-               printf("You must specify a ncacn binding string\n");
-               talloc_free(mem_ctx);
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       status = dcerpc_parse_binding(mem_ctx, binding, &b);
-       if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(0,("Failed to parse dcerpc binding '%s'\n", binding));
-               talloc_free(mem_ctx);
-               return status;
-       }
-
-       b->transport = transport;
-
-       status = dcerpc_pipe_connect_b(mem_ctx, p, b, table,
-                                      cmdline_credentials, NULL);
-                                          
-       if (NT_STATUS_IS_OK(status)) {
-               *p = talloc_reference(parent_ctx, *p);
-       } else {
-               *p = NULL;
-       }
-       talloc_free(mem_ctx);
-        return status;
-}
 
 /* check if the server produced the expected error code */
 BOOL check_error(const char *location, struct smbcli_state *c, 
@@ -2242,7 +2186,6 @@ static struct {
        {"BENCH-TORTURE", NULL, run_torture},
        {"BENCH-NBT",     torture_bench_nbt, 0},
        {"BENCH-WINS",    torture_bench_wins, 0},
-       {"BENCH-RPC",     torture_bench_rpc, 0},
        {"BENCH-CLDAP",   torture_bench_cldap, 0},
 
        /* RAW smb tests */
@@ -2295,42 +2238,6 @@ static struct {
        {"SCAN-IOCTL",  torture_ioctl_test, 0},
        {"SCAN-RAP",  torture_rap_scan, 0},
 
-       /* rpc testers */
-        {"RPC-LSA", torture_rpc_lsa, 0},
-        {"RPC-LSALOOKUP", torture_rpc_lsa_lookup, 0},
-        {"RPC-SECRETS", torture_rpc_lsa_secrets, 0},
-        {"RPC-ECHO", torture_rpc_echo, 0},
-        {"RPC-DFS", torture_rpc_dfs, 0},
-        {"RPC-SPOOLSS", torture_rpc_spoolss, 0},
-        {"RPC-SAMR", torture_rpc_samr, 0},
-        {"RPC-UNIXINFO", torture_rpc_unixinfo, 0},
-        {"RPC-NETLOGON", torture_rpc_netlogon, 0},
-        {"RPC-SAMLOGON", torture_rpc_samlogon, 0},
-        {"RPC-SAMSYNC", torture_rpc_samsync, 0},
-        {"RPC-SCHANNEL", torture_rpc_schannel, 0},
-        {"RPC-WKSSVC", torture_rpc_wkssvc, 0},
-        {"RPC-SRVSVC", torture_rpc_srvsvc, 0},
-        {"RPC-SVCCTL", torture_rpc_svcctl, 0},
-        {"RPC-ATSVC", torture_rpc_atsvc, 0},
-        {"RPC-EVENTLOG", torture_rpc_eventlog, 0},
-        {"RPC-EPMAPPER", torture_rpc_epmapper, 0},
-        {"RPC-WINREG", torture_rpc_winreg, 0},
-        {"RPC-INITSHUTDOWN", torture_rpc_initshutdown, 0},
-        {"RPC-OXIDRESOLVE", torture_rpc_oxidresolve, 0},
-        {"RPC-REMACT", torture_rpc_remact, 0},
-        {"RPC-MGMT", torture_rpc_mgmt, 0},
-        {"RPC-SCANNER", torture_rpc_scanner, 0},
-        {"RPC-AUTOIDL", torture_rpc_autoidl, 0},
-        {"RPC-COUNTCALLS", torture_rpc_countcalls, 0},
-       {"RPC-MULTIBIND", torture_multi_bind, 0},
-       {"RPC-DRSUAPI", torture_rpc_drsuapi, 0},
-       {"RPC-CRACKNAMES", torture_rpc_drsuapi_cracknames, 0},
-       {"RPC-ROT", torture_rpc_rot, 0},
-       {"RPC-DSSETUP", torture_rpc_dssetup, 0},
-        {"RPC-ALTERCONTEXT", torture_rpc_alter_context, 0},
-        {"RPC-JOIN", torture_rpc_join, 0},
-        {"RPC-DSSYNC", torture_rpc_dssync, 0},
-
        /* local (no server) testers */
        {"LOCAL-NTLMSSP", torture_ntlmssp_self_check, 0},
        {"LOCAL-ICONV", torture_local_iconv, 0},
diff --git a/source/torture/torture.h b/source/torture/torture.h
new file mode 100644 (file)
index 0000000..689ff04
--- /dev/null
@@ -0,0 +1,28 @@
+/* 
+   Unix SMB/CIFS implementation.
+   SMB torture tester
+   Copyright (C) Andrew Tridgell 1997-2003
+   Copyright (C) Jelmer Vernooij 2006
+   
+   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 2 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, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef __TORTURE_H__
+#define __TORTURE_H__
+
+#include "libcli/libcli.h"
+#include "torture/proto.h"
+
+#endif /* __TORTURE_H__ */