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

s4:torture: create new test_SetDomainInfo_ntstatus()

for checking for SetDomainInfo giving a desired return code.

Michael

Signed-off-by: Günther Deschner <gd@samba.org>
This commit is contained in:
Michael Adam 2010-01-22 00:46:19 +01:00 committed by Günther Deschner
parent c1d157a481
commit 0a33b20f70

View File

@ -3466,6 +3466,27 @@ static bool test_SetDomainInfo(struct dcerpc_pipe *p,
return true;
}
static bool test_SetDomainInfo_ntstatus(struct dcerpc_pipe *p,
struct torture_context *tctx,
struct policy_handle *domain_handle,
enum samr_DomainInfoClass level,
union samr_DomainInfo *info,
NTSTATUS expected)
{
struct samr_SetDomainInfo r;
r.in.domain_handle = domain_handle;
r.in.level = level;
r.in.info = info;
torture_assert_ntstatus_equal(tctx,
dcerpc_samr_SetDomainInfo(p, tctx, &r),
expected,
"");
return true;
}
static bool test_Password_badpwdcount(struct dcerpc_pipe *p,
struct dcerpc_pipe *np,
@ -3853,18 +3874,11 @@ static bool test_Password_lockout(struct dcerpc_pipe *p,
info.info12.lockout_duration = ~(lockout_seconds * delta_time_factor);
info.info12.lockout_window = ~((lockout_seconds + 1) * delta_time_factor);
{
struct samr_SetDomainInfo r;
r.in.domain_handle = domain_handle;
r.in.level = DomainLockoutInformation;
r.in.info = &info;
torture_assert_ntstatus_equal(tctx,
dcerpc_samr_SetDomainInfo(p, tctx, &r),
NT_STATUS_INVALID_PARAMETER,
"succeeded setting lockout duration < lockout window");
}
torture_assert(tctx,
test_SetDomainInfo_ntstatus(p, tctx, domain_handle,
DomainLockoutInformation, &info,
NT_STATUS_INVALID_PARAMETER),
"setting lockout duration < lockout window gave unexpected result");
info.info12.lockout_duration = 0;
info.info12.lockout_window = 0;