r13658: More moving around of files:
[bbaumbach/samba-autobuild/.git] / source4 / torture / torture.c
index 3c4c916b0fce9791cbd51c72c055140a4bddde20..26137b18908820016ca03a652adafe2c3deb054d 100644 (file)
 */
 
 #include "includes.h"
-#include "clilist.h"
 #include "lib/cmdline/popt_common.h"
 #include "libcli/raw/libcliraw.h"
 #include "system/time.h"
 #include "system/wait.h"
 #include "system/filesys.h"
-#include "ioctl.h"
-#include "librpc/gen_ndr/ndr_security.h"
+#include "libcli/raw/ioctl.h"
+#include "libcli/libcli.h"
+#include "librpc/rpc/dcerpc_table.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"
+#include "torture/nbench/proto.h"
+#include "torture/ldap/proto.h"
+#include "torture/com/proto.h"
+#include "torture/nbt/proto.h"
+#include "torture/libnet/proto.h"
 
 int torture_nprocs=4;
-int torture_numops=100;
+int torture_numops=10;
 int torture_entries=1000;
 int torture_failures=1;
 int torture_seed=0;
@@ -122,9 +135,7 @@ BOOL torture_close_connection(struct smbcli_state *c)
 /* open a rpc connection to the chosen binding string */
 NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx, 
                                struct dcerpc_pipe **p, 
-                               const char *pipe_name,
-                               const char *pipe_uuid, 
-                               uint32_t pipe_version)
+                               const struct dcerpc_interface_table *table)
 {
         NTSTATUS status;
        const char *binding = lp_parm_string(-1, "torture", "binding");
@@ -135,7 +146,7 @@ NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx,
        }
 
        status = dcerpc_pipe_connect(parent_ctx, 
-                                    p, binding, pipe_uuid, pipe_version,
+                                    p, binding, table,
                                     cmdline_credentials, NULL);
  
         return status;
@@ -144,9 +155,7 @@ NTSTATUS torture_rpc_connection(TALLOC_CTX *parent_ctx,
 /* open a rpc connection to a specific transport */
 NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx, 
                                          struct dcerpc_pipe **p, 
-                                         const char *pipe_name,
-                                         const char *pipe_uuid, 
-                                         uint32_t pipe_version,
+                                         const struct dcerpc_interface_table *table,
                                          enum dcerpc_transport_t transport)
 {
         NTSTATUS status;
@@ -169,7 +178,7 @@ NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx,
 
        b->transport = transport;
 
-       status = dcerpc_pipe_connect_b(mem_ctx, p, b, pipe_uuid, pipe_version,
+       status = dcerpc_pipe_connect_b(mem_ctx, p, b, table,
                                       cmdline_credentials, NULL);
                                           
        if (NT_STATUS_IS_OK(status)) {
@@ -2255,7 +2264,11 @@ static struct {
        {"SMB2-CONNECT", torture_smb2_connect, 0},
        {"SMB2-SCAN", torture_smb2_scan, 0},
        {"SMB2-SCANGETINFO", torture_smb2_getinfo_scan, 0},
+       {"SMB2-SCANSETINFO", torture_smb2_setinfo_scan, 0},
+       {"SMB2-SCANFIND", torture_smb2_find_scan, 0},
        {"SMB2-GETINFO", torture_smb2_getinfo, 0},
+       {"SMB2-SETINFO", torture_smb2_setinfo, 0},
+       {"SMB2-FIND", torture_smb2_find, 0},
 
        /* protocol scanners */
        {"SCAN-TRANS2", torture_trans2_scan, 0},
@@ -2271,6 +2284,7 @@ static struct {
 
        /* 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},
@@ -2298,7 +2312,6 @@ static struct {
        {"RPC-MULTIBIND", torture_multi_bind, 0},
        {"RPC-DRSUAPI", torture_rpc_drsuapi, 0},
        {"RPC-CRACKNAMES", torture_rpc_drsuapi_cracknames, 0},
-       {"RPC-LOGIN", torture_rpc_login, 0},
        {"RPC-ROT", torture_rpc_rot, 0},
        {"RPC-DSSETUP", torture_rpc_dssetup, 0},
         {"RPC-ALTERCONTEXT", torture_rpc_alter_context, 0},
@@ -2319,6 +2332,8 @@ static struct {
        {"LOCAL-PAC", torture_pac, 0},
        {"LOCAL-REGISTRY", torture_registry, 0},
        {"LOCAL-RESOLVE", torture_local_resolve, 0},
+       {"LOCAL-SDDL", torture_local_sddl, 0},
+       {"LOCAL-NDR", torture_local_ndr, 0},
 
        /* COM (Component Object Model) testers */
        {"COM-SIMPLE", torture_com_simple, 0 },
@@ -2331,8 +2346,10 @@ static struct {
        {"NBT-REGISTER", torture_nbt_register, 0},
        {"NBT-WINS", torture_nbt_wins, 0},
        {"NBT-DGRAM", torture_nbt_dgram, 0},
-       {"NBT-WINSREPLICATION-QUICK", torture_nbt_winsreplication_quick, 0},
-       {"NBT-WINSREPLICATION", torture_nbt_winsreplication, 0},
+       {"NBT-BROWSE", torture_nbt_browse, 0},
+       {"NBT-WINSREPLICATION-SIMPLE", torture_nbt_winsreplication_simple, 0},
+       {"NBT-WINSREPLICATION-REPLICA", torture_nbt_winsreplication_replica, 0},
+       {"NBT-WINSREPLICATION-OWNED", torture_nbt_winsreplication_owned, 0},
        
        /* libnet tests */
        {"NET-USERINFO", torture_userinfo, 0},
@@ -2541,10 +2558,12 @@ static void max_runtime_handler(int sig)
        int argc_new;
        char **argv_new;
        poptContext pc;
-       enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,OPT_DANGEROUS};
+       enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,
+           OPT_DANGEROUS,OPT_SMB_PORTS};
+
        struct poptOption long_options[] = {
                POPT_AUTOHELP
-               {"smb-ports",   'p', POPT_ARG_STRING, NULL,             0,      "SMB ports",    NULL},
+               {"smb-ports",   'p', POPT_ARG_STRING, NULL,     OPT_SMB_PORTS,  "SMB ports",    NULL},
                {"seed",          0, POPT_ARG_INT,  &torture_seed,      0,      "seed",         NULL},
                {"num-progs",     0, POPT_ARG_INT,  &torture_nprocs,    0,      "num progs",    NULL},
                {"num-ops",       0, POPT_ARG_INT,  &torture_numops,    0,      "num ops",      NULL},
@@ -2592,6 +2611,9 @@ static void max_runtime_handler(int sig)
                case OPT_DANGEROUS:
                        lp_set_cmdline("torture:dangerous", "Yes");
                        break;
+               case OPT_SMB_PORTS:
+                       lp_set_cmdline("smb ports", poptGetOptArg(pc));
+                       break;
                default:
                        d_printf("Invalid option %s: %s\n", 
                                 poptBadOption(pc, 0), poptStrerror(opt));
@@ -2610,8 +2632,9 @@ static void max_runtime_handler(int sig)
                alarm(max_runtime);
        }
 
-       smbtorture_init_subsystems;
+       dcerpc_init();
 
+       dcerpc_table_init();
 
        if (torture_seed == 0) {
                torture_seed = time(NULL);