mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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>
This commit is contained in:
parent
5fc7118675
commit
2780a18a9f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user