diff options
author | Michael Adam <obnox@samba.org> | 2010-01-22 00:46:19 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-01-27 11:24:42 +0100 |
commit | 0a33b20f70506d0a01b4c543ab57ca2488187ee9 (patch) | |
tree | 6a485213dade9d52a949987541e53d5b32e88c56 /source4/torture | |
parent | c1d157a48102c50c72a85b60fba5237436377ffd (diff) | |
download | samba-0a33b20f70506d0a01b4c543ab57ca2488187ee9.tar.gz samba-0a33b20f70506d0a01b4c543ab57ca2488187ee9.tar.bz2 samba-0a33b20f70506d0a01b4c543ab57ca2488187ee9.zip |
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>
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/samr.c | 38 |
1 files changed, 26 insertions, 12 deletions
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; |