svn commit: samba r2182 - in branches/SAMBA_4_0/source/torture: . rpc

tridge at samba.org tridge at samba.org
Thu Sep 2 11:26:59 GMT 2004


Author: tridge
Date: 2004-09-02 11:26:58 +0000 (Thu, 02 Sep 2004)
New Revision: 2182

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture&rev=2182&nolog=1

Log:
force the torture test domain join to happen on SMB to prevent the
LSAKEY problem holding up other tests

Modified:
   branches/SAMBA_4_0/source/torture/rpc/testjoin.c
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/testjoin.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/testjoin.c	2004-09-02 11:06:23 UTC (rev 2181)
+++ branches/SAMBA_4_0/source/torture/rpc/testjoin.c	2004-09-02 11:26:58 UTC (rev 2182)
@@ -123,12 +123,12 @@
 
 	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;
 	}

Modified: branches/SAMBA_4_0/source/torture/torture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/torture.c	2004-09-02 11:06:23 UTC (rev 2181)
+++ branches/SAMBA_4_0/source/torture/torture.c	2004-09-02 11:26:58 UTC (rev 2182)
@@ -136,7 +136,7 @@
 }
 
 
-/* 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 @@
         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)
 {



More information about the samba-cvs mailing list