diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-04-20 16:59:48 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-27 15:24:41 +1000 |
commit | 2780a18a9fc3aac355c141fe0393e1f8008e242f (patch) | |
tree | 374c8384dab37ce6e821f7772f9f2965b0b577df /source4/torture | |
parent | 5fc71186751da3fc2388021630b16279cb949017 (diff) | |
download | samba-2780a18a9fc3aac355c141fe0393e1f8008e242f.tar.gz samba-2780a18a9fc3aac355c141fe0393e1f8008e242f.tar.bz2 samba-2780a18a9fc3aac355c141fe0393e1f8008e242f.zip |
s4:torture - GetAnyDCName - adaptions
- Check for the various domainname set modes (on NULL and "" the domain should
be the default domain on the server)
- support return value "WERR_NO_SUCH_DOMAIN" (the server is the PDC of the
domain)
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/netlogon.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index a5388656c9..4b05c8ca79 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -1787,18 +1787,39 @@ static bool test_GetAnyDCName(struct torture_context *tctx, const char *dcname = NULL; struct dcerpc_binding_handle *b = p->binding_handle; - r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.domainname = lp_workgroup(tctx->lp_ctx); + r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.out.dcname = &dcname; status = dcerpc_netr_GetAnyDCName_r(b, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName"); - torture_assert_werr_ok(tctx, r.out.result, "GetAnyDCName"); + if ((!W_ERROR_IS_OK(r.out.result)) && + (!W_ERROR_EQUAL(r.out.result, WERR_NO_SUCH_DOMAIN))) { + return false; + } if (dcname) { torture_comment(tctx, "\tDC is at '%s'\n", dcname); } + r.in.domainname = NULL; + + status = dcerpc_netr_GetAnyDCName_r(b, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName"); + if ((!W_ERROR_IS_OK(r.out.result)) && + (!W_ERROR_EQUAL(r.out.result, WERR_NO_SUCH_DOMAIN))) { + return false; + } + + r.in.domainname = ""; + + status = dcerpc_netr_GetAnyDCName_r(b, tctx, &r); + torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName"); + if ((!W_ERROR_IS_OK(r.out.result)) && + (!W_ERROR_EQUAL(r.out.result, WERR_NO_SUCH_DOMAIN))) { + return false; + } + return true; } |