From 0a33b20f70506d0a01b4c543ab57ca2488187ee9 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jan 2010 00:46:19 +0100 Subject: s4:torture: create new test_SetDomainInfo_ntstatus() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit for checking for SetDomainInfo giving a desired return code. Michael Signed-off-by: Günther Deschner --- source4/torture/rpc/samr.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'source4') diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index ebbeecbb7c..7aab956589 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -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; -- cgit