diff options
author | Günther Deschner <gd@samba.org> | 2008-10-17 19:10:22 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-10-18 23:06:24 +0200 |
commit | ca84c406d3a2335beb27006c54b68820f7a5594a (patch) | |
tree | fb81eca64ec08016d12a168be4fde6acbc22bf5c /source4/torture | |
parent | 32a1d55797f96e043310004bb091ef5887aa501d (diff) | |
download | samba-ca84c406d3a2335beb27006c54b68820f7a5594a.tar.gz samba-ca84c406d3a2335beb27006c54b68820f7a5594a.tar.bz2 samba-ca84c406d3a2335beb27006c54b68820f7a5594a.zip |
s4-drsuapi: merge drsuapi_DsGetDomainControllerInfo from s3 drsuapi idl.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/drsuapi.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c index fb0e6d9d4c..5b0af7b0a8 100644 --- a/source4/torture/rpc/drsuapi.c +++ b/source4/torture/rpc/drsuapi.c @@ -62,6 +62,8 @@ static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture { NTSTATUS status; struct drsuapi_DsGetDomainControllerInfo r; + union drsuapi_DsGetDCInfoCtr ctr; + int32_t level_out = 0; bool found = false; int i, j, k; @@ -91,16 +93,21 @@ static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture for (i=0; i < ARRAY_SIZE(levels); i++) { for (j=0; j < ARRAY_SIZE(names); j++) { + union drsuapi_DsGetDCInfoRequest req; level = levels[i]; r.in.bind_handle = &priv->bind_handle; r.in.level = 1; + r.in.req = &req; - r.in.req.req1.domain_name = names[j].name; - r.in.req.req1.level = level; + r.in.req->req1.domain_name = names[j].name; + r.in.req->req1.level = level; + + r.out.ctr = &ctr; + r.out.level_out = &level_out; torture_comment(torture, "testing DsGetDomainControllerInfo level %d on domainname '%s'\n", - r.in.req.req1.level, r.in.req.req1.domain_name); + r.in.req->req1.level, r.in.req->req1.domain_name); status = dcerpc_drsuapi_DsGetDomainControllerInfo(p, torture, &r); torture_assert_ntstatus_ok(torture, status, @@ -115,13 +122,13 @@ static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture } torture_assert_int_equal(torture, - r.in.req.req1.level, r.out.level_out, + r.in.req->req1.level, *r.out.level_out, "dcerpc_drsuapi_DsGetDomainControllerInfo level"); switch (level) { case 1: - for (k=0; k < r.out.ctr.ctr1.count; k++) { - if (strcasecmp_m(r.out.ctr.ctr1.array[k].netbios_name, + for (k=0; k < r.out.ctr->ctr1.count; k++) { + if (strcasecmp_m(r.out.ctr->ctr1.array[k].netbios_name, torture_join_netbios_name(priv->join)) == 0) { found = true; break; @@ -129,11 +136,11 @@ static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture } break; case 2: - for (k=0; k < r.out.ctr.ctr2.count; k++) { - if (strcasecmp_m(r.out.ctr.ctr2.array[k].netbios_name, + for (k=0; k < r.out.ctr->ctr2.count; k++) { + if (strcasecmp_m(r.out.ctr->ctr2.array[k].netbios_name, torture_join_netbios_name(priv->join)) == 0) { found = true; - priv->dcinfo = r.out.ctr.ctr2.array[k]; + priv->dcinfo = r.out.ctr->ctr2.array[k]; break; } } @@ -146,12 +153,15 @@ static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture r.in.bind_handle = &priv->bind_handle; r.in.level = 1; - - r.in.req.req1.domain_name = "__UNKNOWN_DOMAIN__"; /* This is clearly ignored for this level */ - r.in.req.req1.level = -1; + + r.out.ctr = &ctr; + r.out.level_out = &level_out; + + r.in.req->req1.domain_name = "__UNKNOWN_DOMAIN__"; /* This is clearly ignored for this level */ + r.in.req->req1.level = -1; printf("testing DsGetDomainControllerInfo level %d on domainname '%s'\n", - r.in.req.req1.level, r.in.req.req1.domain_name); + r.in.req->req1.level, r.in.req->req1.domain_name); status = dcerpc_drsuapi_DsGetDomainControllerInfo(p, torture, &r); @@ -164,8 +174,8 @@ static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture const char *dc_account = talloc_asprintf(torture, "%s\\%s$", torture_join_dom_netbios_name(priv->join), priv->dcinfo.netbios_name); - for (k=0; k < r.out.ctr.ctr01.count; k++) { - if (strcasecmp_m(r.out.ctr.ctr01.array[k].client_account, + for (k=0; k < r.out.ctr->ctr01.count; k++) { + if (strcasecmp_m(r.out.ctr->ctr01.array[k].client_account, dc_account)) { found = true; break; |