summaryrefslogtreecommitdiff
path: root/source4/torture/rpc/frsapi.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-10-18 21:23:25 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:19 +0100
commitbd2bf8990a3bb3bbb91c9d1abcc2d424143ebeb5 (patch)
tree568af6400e125b6edd072badc1d77129152514e2 /source4/torture/rpc/frsapi.c
parentdf3f31d2d57d86144c36dbedec6d322857847285 (diff)
downloadsamba-bd2bf8990a3bb3bbb91c9d1abcc2d424143ebeb5.tar.gz
samba-bd2bf8990a3bb3bbb91c9d1abcc2d424143ebeb5.tar.bz2
samba-bd2bf8990a3bb3bbb91c9d1abcc2d424143ebeb5.zip
r25699: Add ForceReplication test.
Guenther (This used to be commit 0bab602b8e38ca758d3795db3d33a92eb162bb92)
Diffstat (limited to 'source4/torture/rpc/frsapi.c')
-rw-r--r--source4/torture/rpc/frsapi.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/source4/torture/rpc/frsapi.c b/source4/torture/rpc/frsapi.c
index a382b1e415..9ea139bf40 100644
--- a/source4/torture/rpc/frsapi.c
+++ b/source4/torture/rpc/frsapi.c
@@ -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;
}