2 #include "libnet/libnet.h"
3 #include "libcli/libcli.h"
5 #include "auth/credentials/credentials.h"
6 #include "torture/rpc/rpc.h"
8 #define TORTURE_NETBIOS_NAME "smbtorturejoin"
11 bool torture_rpc_join(struct torture_context *torture)
15 struct cli_credentials *machine_account;
16 struct smbcli_state *cli;
17 const char *host = torture_setting_string(torture, "host", NULL);
19 /* Join domain as a member server. */
20 tj = torture_join_domain(TORTURE_NETBIOS_NAME,
25 DEBUG(0, ("%s failed to join domain as workstation\n",
26 TORTURE_NETBIOS_NAME));
30 status = smbcli_full_connection(tj, &cli, host,
34 if (!NT_STATUS_IS_OK(status)) {
35 DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
36 TORTURE_NETBIOS_NAME));
42 torture_leave_domain(tj);
44 /* Join domain as a domain controller. */
45 tj = torture_join_domain(TORTURE_NETBIOS_NAME,
49 DEBUG(0, ("%s failed to join domain as domain controller\n",
50 TORTURE_NETBIOS_NAME));
54 status = smbcli_full_connection(tj, &cli, host,
58 if (!NT_STATUS_IS_OK(status)) {
59 DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
60 TORTURE_NETBIOS_NAME));
67 torture_leave_domain(tj);