summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-06-14 08:15:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:39 -0500
commit02781a30bf9ef476ead20890611c94774d0d713e (patch)
treefa8614d406877e9b0048b3b0ac5a61731e2bf838 /source4/torture/rpc
parentbccac81d8792f85ae37d4a6617a92e2fae75aa50 (diff)
downloadsamba-02781a30bf9ef476ead20890611c94774d0d713e.tar.gz
samba-02781a30bf9ef476ead20890611c94774d0d713e.tar.bz2
samba-02781a30bf9ef476ead20890611c94774d0d713e.zip
r1137: - added torture test for netr_LogonGetDomainInfo() call
(This used to be commit fdf6e4169d531c4a7d4e1b937abd3eb3af03c860)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/netlogon.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index a336ef7acb..2505868af6 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -1513,6 +1513,61 @@ static BOOL test_DsrEnumerateDomainTrusts(struct dcerpc_pipe *p, TALLOC_CTX *mem
}
+static BOOL test_GetDomainInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct netr_LogonGetDomainInfo r;
+ struct netr_DomainQuery1 q1;
+ struct netr_Authenticator a;
+ uint32_t i1;
+ struct creds_CredentialState creds;
+
+ if (!test_SetupCredentials(p, mem_ctx, &creds)) {
+ return False;
+ }
+
+ ZERO_STRUCT(r);
+
+ creds_client_authenticator(&creds, &a);
+
+ r.in.server_name = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
+ r.in.computer_name = TEST_MACHINE_NAME;
+ r.in.unknown1 = 512;
+ r.in.level = 1;
+ r.in.credential = &a;
+ r.out.credential = &a;
+
+ i1 = 0;
+ r.in.i1 = &i1;
+
+ r.in.query.query1 = &q1;
+ ZERO_STRUCT(q1);
+
+ /* this should really be the fully qualified name */
+ q1.workstation_domain = TEST_MACHINE_NAME;
+ q1.workstation_site = "Default-First-Site-Name";
+ q1.foo2 = "foo";
+ q1.blob2.length = 0;
+ q1.blob2.size = 0;
+ q1.blob2.data = NULL;
+ q1.product.string = "product string";
+ q1.p4 = NULL;
+ q1.pp = 0x00000000;
+
+ printf("Testing netr_LogonGetDomainInfo\n");
+
+ status = dcerpc_netr_LogonGetDomainInfo(p, mem_ctx, &r);
+
+ if (!creds_client_check(&creds, &a.cred)) {
+ printf("Credential chaining failed\n");
+ }
+
+ printf("fault code 0x%x status=%s\n", p->last_fault_code, nt_errstr(status));
+
+ return True;
+}
+
+
BOOL torture_rpc_netlogon(int dummy)
{
@@ -1539,6 +1594,10 @@ BOOL torture_rpc_netlogon(int dummy)
return False;
}
+ if (!test_GetDomainInfo(p, mem_ctx)) {
+ ret = False;
+ }
+
if (!test_LogonUasLogon(p, mem_ctx)) {
ret = False;
}