summaryrefslogtreecommitdiffstats
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-03-16 21:14:51 +1300
committerStefan Metzmacher <metze@samba.org>2014-04-02 17:12:48 +0200
commit6a4bedd36ad9877f35489ffa28eb38a458d4f01b (patch)
tree2c7c5bcd783a5f1348f4f64f797855f59c8bda54 /source4/torture
parent3c731783e0e9ee4a7b4b9289544d4d8a465940b9 (diff)
downloadsamba-6a4bedd36ad9877f35489ffa28eb38a458d4f01b.tar.gz
samba-6a4bedd36ad9877f35489ffa28eb38a458d4f01b.tar.xz
samba-6a4bedd36ad9877f35489ffa28eb38a458d4f01b.zip
torture-samr: Add test for lockout with and without a password history
Change-Id: I6f4b3e92feabe4ff09839329b0db3d33cc6c73b4 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/samr.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 551cd4539fd..ff96dc52428 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -4115,13 +4115,13 @@ static bool test_Password_lockout(struct dcerpc_pipe *p,
const char *comment,
bool disable,
bool interactive,
+ uint32_t password_history_length,
NTSTATUS expected_success_status,
struct samr_DomInfo1 *info1,
struct samr_DomInfo12 *info12)
{
union samr_DomainInfo info;
uint32_t badpwdcount;
- uint32_t password_history_length = 1;
uint64_t lockout_threshold = 1;
uint32_t lockout_seconds = 5;
uint64_t delta_time_factor = 10 * 1000 * 1000;
@@ -4137,7 +4137,7 @@ static bool test_Password_lockout(struct dcerpc_pipe *p,
info.info1 = *info1;
- torture_comment(tctx, "setting password history length.\n");
+ torture_comment(tctx, "setting password history length to %d.\n", password_history_length);
info.info1.password_history_length = password_history_length;
torture_comment(tctx, "setting min password again.\n");
@@ -4315,6 +4315,7 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
const char *comment;
bool disabled;
bool interactive;
+ uint32_t password_history_length;
NTSTATUS expected_success_status;
} creds[] = {
{
@@ -4330,6 +4331,13 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
.expected_success_status= NT_STATUS_OK
},
{
+ .comment = "network logon (enabled account, history len = 1)",
+ .disabled = false,
+ .interactive = false,
+ .expected_success_status= NT_STATUS_OK,
+ .password_history_length = 1
+ },
+ {
.comment = "interactive logon (disabled account)",
.disabled = true,
.interactive = true,
@@ -4341,6 +4349,13 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
.interactive = true,
.expected_success_status= NT_STATUS_OK
},
+ {
+ .comment = "interactive logon (enabled account, history len = 1)",
+ .disabled = false,
+ .interactive = true,
+ .expected_success_status= NT_STATUS_OK,
+ .password_history_length = 1
+ },
};
torture_assert(tctx, setup_schannel_netlogon_pipe(tctx, machine_credentials, &np), "");
@@ -4380,6 +4395,7 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
creds[i].comment,
creds[i].disabled,
creds[i].interactive,
+ creds[i].password_history_length,
creds[i].expected_success_status,
&_info1, &_info12);
ret &= test_passed;