r12608: Remove some unused #include lines.
[samba.git] / source4 / torture / rpc / join.c
1 #include "includes.h"
2 #include "libnet/libnet.h"
3
4 #define TORTURE_NETBIOS_NAME "smbtorturejoin"
5
6
7 BOOL torture_rpc_join(void)
8 {  
9         struct test_join *tj;
10         struct cli_credentials *machine_account;
11
12         /* Join domain as a member server. */
13         tj = torture_join_domain(TORTURE_NETBIOS_NAME,
14                                  ACB_WSTRUST,
15                                  &machine_account);
16
17         if (!tj) {
18                 DEBUG(0, ("%s failed to join domain\n",
19                           TORTURE_NETBIOS_NAME));
20                 return False;
21         }
22         
23         /* Leave domain. */                          
24         torture_leave_domain(tj);
25         
26         /* Join domain as a domain controller. */
27         tj = torture_join_domain(TORTURE_NETBIOS_NAME,
28                                  ACB_SVRTRUST,
29                                  &machine_account);
30         if (!tj) {
31                 DEBUG(0, ("%s failed to join domain\n",
32                           TORTURE_NETBIOS_NAME));
33                 return False;
34         }
35
36         /* Leave domain. */
37         torture_leave_domain(tj);
38
39         return True;
40 }
41