Author: abartlet Date: 2005-09-25 12:38:07 +0000 (Sun, 25 Sep 2005) New Revision: 10488
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10488 Log: (Missing file from previous commit, adding a new RPC-JOIN test) This is a merge of Brad Henry's 'net join' rework, to better perform an ADS join, particularly as a DC. This represents the bulk of his Google SOC work, and I'm very pleased to intergrate it into the tree. (Metze will intergrate the DRSUAPI work later). Both metze and myself have also put a lot of time into this patch, and in mentoring Brad in general. In return, Brad has been a very good student, and has taken the comments well. Since it's last appearance on samba-technical@, I have made correctness and valgrind fixups, as well as adding a new 'BINDING' mode to the libnet_rpc routines. This allows the exact binding string to be passed down from the torture code, including options and exact target host. Added: branches/SAMBA_4_0/source/torture/rpc/join.c Changeset: Added: branches/SAMBA_4_0/source/torture/rpc/join.c =================================================================== --- branches/SAMBA_4_0/source/torture/rpc/join.c 2005-09-25 12:27:36 UTC (rev 10487) +++ branches/SAMBA_4_0/source/torture/rpc/join.c 2005-09-25 12:38:07 UTC (rev 10488) @@ -0,0 +1,43 @@ +#include "includes.h" +#include "lib/cmdline/popt_common.h" +#include "libnet/libnet.h" +#include "lib/ldb/include/ldb.h" + +#define TORTURE_NETBIOS_NAME "smbtorturejoin" + + +BOOL torture_rpc_join(void) +{ + struct test_join *tj; + const char *machine_password; + + /* Join domain as a member server. */ + tj = torture_join_domain(TORTURE_NETBIOS_NAME, + ACB_WSTRUST, + &machine_password); + + if (!tj) { + DEBUG(0, ("%s failed to join domain\n", + TORTURE_NETBIOS_NAME)); + return False; + } + + /* Leave domain. */ + torture_leave_domain(tj); + + /* Join domain as a domain controller. */ + tj = torture_join_domain(TORTURE_NETBIOS_NAME, + ACB_SVRTRUST, + &machine_password); + if (!tj) { + DEBUG(0, ("%s failed to join domain %s.\n", + TORTURE_NETBIOS_NAME, lp_workgroup())); + return False; + } + + /* Leave domain. */ + torture_leave_domain(tj); + + return True; +} +
