r2182: force the torture test domain join to happen on SMB to prevent the
authorAndrew Tridgell <tridge@samba.org>
Thu, 2 Sep 2004 11:26:58 +0000 (11:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:58:29 +0000 (12:58 -0500)
LSAKEY problem holding up other tests
(This used to be commit ad8d54fd7dd93cb984d23acecfc1c611b63a5d58)

source4/torture/rpc/testjoin.c
source4/torture/torture.c

index 32ea6c5ce4993d1401e3a6e557a53680287bda02..a4a4979895fd7b7a810c0443ed79f255dc05449f 100644 (file)
@@ -123,12 +123,12 @@ void *torture_join_domain(const char *machine_name,
 
        join->mem_ctx = mem_ctx;
 
-       printf("Connecting to SAMR\n");
+       printf("Connecting to SAMR (forced ncacn_np)\n");
 
-       status = torture_rpc_connection(&join->p, 
-                                       DCERPC_SAMR_NAME,
-                                       DCERPC_SAMR_UUID,
-                                       DCERPC_SAMR_VERSION);
+       status = torture_rpc_connection_smb(&join->p, 
+                                           DCERPC_SAMR_NAME,
+                                           DCERPC_SAMR_UUID,
+                                           DCERPC_SAMR_VERSION);
        if (!NT_STATUS_IS_OK(status)) {
                goto failed;
        }
index e3a7d8e5d88935730ff6dcee510ec4eab8d2fffc..b1e6695e9e0efd3d0cf2e4ea6b7487c3a01696b9 100644 (file)
@@ -136,7 +136,7 @@ BOOL torture_close_connection(struct smbcli_state *c)
 }
 
 
-/* open a rpc connection to a named pipe */
+/* open a rpc connection to the chosen binding string */
 NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p, 
                                const char *pipe_name,
                                const char *pipe_uuid, 
@@ -158,6 +158,39 @@ NTSTATUS torture_rpc_connection(struct dcerpc_pipe **p,
         return status;
 }
 
+/* open a rpc connection to a named pipe */
+NTSTATUS torture_rpc_connection_smb(struct dcerpc_pipe **p, 
+                                   const char *pipe_name,
+                                   const char *pipe_uuid, 
+                                   uint32_t pipe_version)
+{
+        NTSTATUS status;
+       const char *binding = lp_parm_string(-1, "torture", "binding");
+       struct dcerpc_binding b;
+       TALLOC_CTX *mem_ctx = talloc_init("torture_rpc_connection_smb");
+
+       if (!binding) {
+               printf("You must specify a ncacn binding string\n");
+               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_destroy(mem_ctx);
+               return status;
+       }
+
+       b.transport = NCACN_NP;
+
+       status = dcerpc_pipe_connect_b(p, &b, pipe_uuid, pipe_version,
+                                      lp_parm_string(-1, "torture", "userdomain"), 
+                                      lp_parm_string(-1, "torture", "username"),
+                                      lp_parm_string(-1, "torture", "password"));
+        return status;
+}
+
 /* close a rpc connection to a named pipe */
 NTSTATUS torture_rpc_close(struct dcerpc_pipe *p)
 {