summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-12-13 10:29:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:22 -0500
commite08e2645de81a89902adcd84e405bfc5baf1fab6 (patch)
treeae6288bb7dda23c9297c35d11f5b36bf7c4dfca6 /source4
parent72273b5046106bd5a97ffbf821a6794f56705ede (diff)
downloadsamba-e08e2645de81a89902adcd84e405bfc5baf1fab6.tar.gz
samba-e08e2645de81a89902adcd84e405bfc5baf1fab6.tar.bz2
samba-e08e2645de81a89902adcd84e405bfc5baf1fab6.zip
r4172: commit a DsReplicaSync() torture test
this not make much sense as we don't send the correct nc_name but it shows that doesn't get a NDR_FAULT anymore, we just need handle the conformant strings in pidl metze (This used to be commit be449f628faf85a163852d18bc724984d3afefd2)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/drsuapi.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index e5b7e2ca0c..0b1377c740 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -755,6 +755,65 @@ static BOOL test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return ret;
}
+static BOOL test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
+ struct DsPrivate *priv)
+{
+ NTSTATUS status;
+ BOOL ret = True;
+ int i;
+ struct drsuapi_DsReplicaSync r;
+ struct drsuapi_DsReplicaSyncRequest1Info info1;
+
+ struct {
+ int32 level;
+ } array[] = {
+ {
+ 1
+ }
+ };
+
+ r.in.bind_handle = &priv->bind_handle;
+
+ for (i=0; i < ARRAY_SIZE(array); i++) {
+ printf("testing DsReplicaGetInfo level %d\n",
+ array[i].level);
+
+ r.in.level = array[i].level;
+ switch(r.in.level) {
+ case 1: {
+ uint16_t string[] = { 0x0064, 0x0063, 0x003d, 0x0073, 0x0039, 0x0000};
+ ZERO_STRUCT(r.in.req.req1);
+ r.in.req.req1.info = &info1;
+ r.in.req.req1.info->unknown1 = 32;
+ r.in.req.req1.info->unknown2 = 120;
+ ZERO_STRUCT(r.in.req.req1.info->guid1);
+ ZERO_ARRAY(r.in.req.req1.info->unknown3);
+ r.in.req.req1.info->length = ARRAY_SIZE(string)-1;
+ r.in.req.req1.info->nc_dn = string;/*priv->domain_obj_dn*/;
+ r.in.req.req1.guid1 = priv->dcinfo.ntds_guid;
+ r.in.req.req1.string1 = NULL;
+ r.in.req.req1.unknown1 = 16;
+ break;
+ }
+ }
+
+ status = dcerpc_drsuapi_DsReplicaSync(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status)) {
+ const char *errstr = nt_errstr(status);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
+ errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
+ }
+ printf("dcerpc_drsuapi_DsReplicaSync failed - %s\n", errstr);
+ ret = False;
+ } else if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("DsReplicaSync failed - %s\n", win_errstr(r.out.result));
+ ret = False;
+ }
+ }
+
+ return ret;
+}
+
static BOOL test_DsUnbind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct DsPrivate *priv)
{
@@ -825,6 +884,10 @@ BOOL torture_rpc_drsuapi(void)
ret = False;
}
+ if (!test_DsReplicaSync(p, mem_ctx, &priv)) {
+ ret = False;
+ }
+
if (!test_DsUnbind(p, mem_ctx, &priv)) {
ret = False;
}