summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-09-25 12:38:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:54 -0500
commit6c85fa066c8fc1fbaf1554d76196ede0a64291e4 (patch)
tree7f6f4f23c1ea08f018f6c2b86f3e77a020505dfa /source4/torture/rpc
parent1faf4e331efd5087803e4bc04206b75b6ed58780 (diff)
downloadsamba-6c85fa066c8fc1fbaf1554d76196ede0a64291e4.tar.gz
samba-6c85fa066c8fc1fbaf1554d76196ede0a64291e4.tar.bz2
samba-6c85fa066c8fc1fbaf1554d76196ede0a64291e4.zip
r10488: (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. (This used to be commit ab20533e7db9e64c8fb5e7f971ab5d3a040e00ab)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/join.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c
new file mode 100644
index 0000000000..beb313c3d2
--- /dev/null
+++ b/source4/torture/rpc/join.c
@@ -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;
+}
+