summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-10-17 10:52:23 +0200
committerGünther Deschner <gd@samba.org>2008-10-17 10:54:01 +0200
commite941e4ad5223816d3d022e6d87a8e88a74db2850 (patch)
tree6b57fae2c58a04e3ff3daaf15dfa3aaff5c73a28 /source4/torture
parent6503ffaa04bef3dd40a69d38b9d004abf2e85e92 (diff)
downloadsamba-e941e4ad5223816d3d022e6d87a8e88a74db2850.tar.gz
samba-e941e4ad5223816d3d022e6d87a8e88a74db2850.tar.bz2
samba-e941e4ad5223816d3d022e6d87a8e88a74db2850.zip
s4: merge from s3 drsuapi.idl.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/drsuapi.c49
-rw-r--r--source4/torture/rpc/dssync.c25
2 files changed, 41 insertions, 33 deletions
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index e5cb3d7ddf..da04c64b39 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -237,6 +237,7 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, struct torture_context
{
NTSTATUS status;
struct drsuapi_DsReplicaGetInfo r;
+ union drsuapi_DsReplicaGetInfoRequest req;
bool ret = true;
int i;
struct {
@@ -325,20 +326,21 @@ static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, struct torture_context
r.in.level = array[i].level;
switch(r.in.level) {
case DRSUAPI_DS_REPLICA_GET_INFO:
- r.in.req.req1.info_type = array[i].infotype;
- r.in.req.req1.object_dn = object_dn;
- ZERO_STRUCT(r.in.req.req1.guid1);
+ req.req1.info_type = array[i].infotype;
+ req.req1.object_dn = object_dn;
+ ZERO_STRUCT(req.req1.guid1);
break;
case DRSUAPI_DS_REPLICA_GET_INFO2:
- r.in.req.req2.info_type = array[i].infotype;
- r.in.req.req2.object_dn = object_dn;
- ZERO_STRUCT(r.in.req.req1.guid1);
- r.in.req.req2.unknown1 = 0;
- r.in.req.req2.string1 = NULL;
- r.in.req.req2.string2 = NULL;
- r.in.req.req2.unknown2 = 0;
+ req.req2.info_type = array[i].infotype;
+ req.req2.object_dn = object_dn;
+ ZERO_STRUCT(req.req1.guid1);
+ req.req2.unknown1 = 0;
+ req.req2.string1 = NULL;
+ req.req2.string2 = NULL;
+ req.req2.unknown2 = 0;
break;
}
+ r.in.req = &req;
status = dcerpc_drsuapi_DsReplicaGetInfo(p, tctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -611,20 +613,23 @@ bool test_QuerySitesByCost(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
NTSTATUS status;
struct drsuapi_QuerySitesByCost r;
+ union drsuapi_QuerySitesByCostRequest req;
bool ret = true;
const char *my_site = "Default-First-Site-Name";
const char *remote_site1 = "smbtorture-nonexisting-site1";
const char *remote_site2 = "smbtorture-nonexisting-site2";
+ req.req1.site_from = talloc_strdup(mem_ctx, my_site);
+ req.req1.num_req = 2;
+ req.req1.site_to = talloc_zero_array(mem_ctx, const char *, 2);
+ req.req1.site_to[0] = talloc_strdup(mem_ctx, remote_site1);
+ req.req1.site_to[1] = talloc_strdup(mem_ctx, remote_site2);
+ req.req1.flags = 0;
+
r.in.bind_handle = &priv->bind_handle;
r.in.level = 1;
- r.in.req.req1.site_from = talloc_strdup(mem_ctx, my_site);
- r.in.req.req1.num_req = 2;
- r.in.req.req1.site_to = talloc_zero_array(mem_ctx, const char *, r.in.req.req1.num_req);
- r.in.req.req1.site_to[0] = talloc_strdup(mem_ctx, remote_site1);
- r.in.req.req1.site_to[1] = talloc_strdup(mem_ctx, remote_site2);
- r.in.req.req1.flags = 0;
+ r.in.req = &req;
status = dcerpc_drsuapi_QuerySitesByCost(p, mem_ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -641,17 +646,17 @@ bool test_QuerySitesByCost(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
if (W_ERROR_IS_OK(r.out.result)) {
- if (!W_ERROR_EQUAL(r.out.ctr.ctr1.info[0].error_code, WERR_DS_OBJ_NOT_FOUND) ||
- !W_ERROR_EQUAL(r.out.ctr.ctr1.info[1].error_code, WERR_DS_OBJ_NOT_FOUND)) {
+ if (!W_ERROR_EQUAL(r.out.ctr->ctr1.info[0].error_code, WERR_DS_OBJ_NOT_FOUND) ||
+ !W_ERROR_EQUAL(r.out.ctr->ctr1.info[1].error_code, WERR_DS_OBJ_NOT_FOUND)) {
printf("expected error_code WERR_DS_OBJ_NOT_FOUND, got %s\n",
- win_errstr(r.out.ctr.ctr1.info[0].error_code));
+ win_errstr(r.out.ctr->ctr1.info[0].error_code));
ret = false;
}
- if ((r.out.ctr.ctr1.info[0].site_cost != (uint32_t) -1) ||
- (r.out.ctr.ctr1.info[1].site_cost != (uint32_t) -1)) {
+ if ((r.out.ctr->ctr1.info[0].site_cost != (uint32_t) -1) ||
+ (r.out.ctr->ctr1.info[1].site_cost != (uint32_t) -1)) {
printf("expected site_cost %d, got %d\n",
- (uint32_t) -1, r.out.ctr.ctr1.info[0].site_cost);
+ (uint32_t) -1, r.out.ctr->ctr1.info[0].site_cost);
ret = false;
}
}
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 41bb168619..185e8ef0d4 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -809,6 +809,7 @@ static bool test_FetchNT4Data(struct torture_context *tctx,
NTSTATUS status;
bool ret = true;
struct drsuapi_DsGetNT4ChangeLog r;
+ union drsuapi_DsGetNT4ChangeLogRequest req;
struct GUID null_guid;
struct dom_sid null_sid;
DATA_BLOB cookie;
@@ -821,12 +822,14 @@ static bool test_FetchNT4Data(struct torture_context *tctx,
r.in.bind_handle = &ctx->new_dc.drsuapi.bind_handle;
r.in.level = 1;
- r.in.req.req1.unknown1 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-1", 3);
- r.in.req.req1.unknown2 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-2", 0x00004000);
+ req.req1.unknown1 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-1", 3);
+ req.req1.unknown2 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-2", 0x00004000);
while (1) {
- r.in.req.req1.length = cookie.length;
- r.in.req.req1.data = cookie.data;
+ req.req1.length = cookie.length;
+ req.req1.data = cookie.data;
+
+ r.in.req = &req;
status = dcerpc_drsuapi_DsGetNT4ChangeLog(ctx->new_dc.drsuapi.pipe, ctx, &r);
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
@@ -845,16 +848,16 @@ static bool test_FetchNT4Data(struct torture_context *tctx,
} else if (!W_ERROR_IS_OK(r.out.result)) {
printf("DsGetNT4ChangeLog failed - %s\n", win_errstr(r.out.result));
ret = false;
- } else if (r.out.level != 1) {
- printf("DsGetNT4ChangeLog unknown level - %u\n", r.out.level);
+ } else if (*r.out.level_out != 1) {
+ printf("DsGetNT4ChangeLog unknown level - %u\n", *r.out.level_out);
ret = false;
- } else if (NT_STATUS_IS_OK(r.out.info.info1.status)) {
- } else if (NT_STATUS_EQUAL(r.out.info.info1.status, STATUS_MORE_ENTRIES)) {
- cookie.length = r.out.info.info1.length1;
- cookie.data = r.out.info.info1.data1;
+ } else if (NT_STATUS_IS_OK(r.out.info->info1.status)) {
+ } else if (NT_STATUS_EQUAL(r.out.info->info1.status, STATUS_MORE_ENTRIES)) {
+ cookie.length = r.out.info->info1.length1;
+ cookie.data = r.out.info->info1.data1;
continue;
} else {
- printf("DsGetNT4ChangeLog failed - %s\n", nt_errstr(r.out.info.info1.status));
+ printf("DsGetNT4ChangeLog failed - %s\n", nt_errstr(r.out.info->info1.status));
ret = false;
}