diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-04-22 10:37:45 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-27 15:24:42 +1000 |
commit | ca1f7c9b7332be2f7136094953eef43c65ee1462 (patch) | |
tree | 8f756206683dab75396c8d05fcb814e7e249fd98 | |
parent | 4686305feb13f6c824843cb2ab8d55f59254303c (diff) | |
download | samba-ca1f7c9b7332be2f7136094953eef43c65ee1462.tar.gz samba-ca1f7c9b7332be2f7136094953eef43c65ee1462.tar.bz2 samba-ca1f7c9b7332be2f7136094953eef43c65ee1462.zip |
s4:torture - DsRGetDcSiteCoverageW - adapt test to check for the sitename
Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r-- | source4/torture/rpc/netlogon.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 567dec6b39..9b8f9b7800 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -2309,11 +2309,27 @@ static bool test_netr_DsRGetDCNameEx2(struct torture_context *tctx, static bool test_netr_DsrGetDcSiteCoverageW(struct torture_context *tctx, struct dcerpc_pipe *p) { + char *url; + struct ldb_context *sam_ctx = NULL; NTSTATUS status; struct netr_DsrGetDcSiteCoverageW r; struct DcSitesCtr *ctr = NULL; struct dcerpc_binding_handle *b = p->binding_handle; + torture_comment(tctx, "This does only pass with the default site\n"); + + /* We won't double-check this when we are over 'local' transports */ + if (dcerpc_server_name(p)) { + /* Set up connection to SAMDB on DC */ + url = talloc_asprintf(tctx, "ldap://%s", dcerpc_server_name(p)); + sam_ctx = ldb_wrap_connect(tctx, tctx->ev, tctx->lp_ctx, url, + NULL, + cmdline_credentials, + 0); + + torture_assert(tctx, sam_ctx, "Connection to the SAMDB on DC failed!"); + } + r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.out.ctr = &ctr; @@ -2321,6 +2337,14 @@ static bool test_netr_DsrGetDcSiteCoverageW(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "failed"); torture_assert_werr_ok(tctx, r.out.result, "failed"); + torture_assert(tctx, ctr->num_sites == 1, + "we should per default only get the default site"); + if (sam_ctx != NULL) { + torture_assert_casestr_equal(tctx, ctr->sites[0].string, + samdb_server_site_name(sam_ctx, tctx), + "didn't return default site"); + } + return true; } |