1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r25699: Add ForceReplication test.

Guenther
(This used to be commit 0bab602b8e)
This commit is contained in:
Günther Deschner 2007-10-18 21:23:25 +02:00 committed by Stefan Metzmacher
parent df3f31d2d5
commit bd2bf8990a
2 changed files with 35 additions and 6 deletions

View File

@ -94,8 +94,8 @@ interface frsapi
/* Function 0x0a */
/* not supported before w2k3 sp2 */
WERROR frsapi_ForceReplication(
[in] uint32 unknown1,
[in] uint32 unknown2,
[in,unique] GUID *guid1,
[in,unique] GUID *guid2,
[in,unique] [charset(UTF16),string] uint16 *replica_set,
[in,unique] [charset(UTF16),string] uint16 *partner_name
);

View File

@ -24,6 +24,7 @@
#include "torture/rpc/rpc.h"
#include "librpc/gen_ndr/ndr_frsapi_c.h"
#include "torture/util.h"
#include "param/param.h"
static bool test_GetDsPollingIntervalW(struct torture_context *tctx,
struct dcerpc_pipe *p,
@ -150,16 +151,17 @@ static bool test_IsPathReplicated(struct torture_context *tctx,
FRSAPI_REPLICA_SET_TYPE_DOMAIN,
FRSAPI_REPLICA_SET_TYPE_DFS };
int i;
bool ret = true;
if (!test_IsPathReplicated_err(tctx, p, NULL, 0,
WERR_FRS_INVALID_SERVICE_PARAMETER)) {
return false;
ret = false;
}
for (i=0; i<ARRAY_SIZE(lvls); i++) {
if (!_test_IsPathReplicated(tctx, p, dcerpc_server_name(p),
lvls[i])) {
return false;
ret = false;
}
}
@ -167,7 +169,7 @@ static bool test_IsPathReplicated(struct torture_context *tctx,
const char *path = talloc_asprintf(tctx, "\\\\%s\\SYSVOL",
dcerpc_server_name(p));
if (!_test_IsPathReplicated(tctx, p, path, lvls[i])) {
return false;
ret = false;
}
}
@ -175,10 +177,33 @@ static bool test_IsPathReplicated(struct torture_context *tctx,
if (!_test_IsPathReplicated(tctx, p,
"C:\\windows\\sysvol\\domain",
lvls[i])) {
return false;
ret = false;
}
}
return ret;
}
static bool test_ForceReplication(struct torture_context *tctx,
struct dcerpc_pipe *p)
{
struct frsapi_ForceReplication r;
ZERO_STRUCT(r);
r.in.guid1 = NULL;
r.in.guid2 = NULL;
r.in.replica_set = talloc_asprintf(tctx, "%s",
lp_realm(global_loadparm));
r.in.partner_name = dcerpc_server_name(p);
torture_assert_ntstatus_ok(tctx,
dcerpc_frsapi_ForceReplication(p, tctx, &r),
"ForceReplication failed");
torture_assert_werr_ok(tctx, r.out.result,
"ForceReplication failed");
return true;
}
@ -197,5 +222,9 @@ struct torture_suite *torture_rpc_frsapi(TALLOC_CTX *mem_ctx)
test = torture_rpc_tcase_add_test(tcase, "IsPathReplicated",
test_IsPathReplicated);
test = torture_rpc_tcase_add_test(tcase, "ForceReplication",
test_ForceReplication);
return suite;
}