torture-samr: Lock accounts for 5 seconds in rpc.samr.passwords.badpwdcount test...
authorAndrew Bartlett <abartlet@samba.org>
Thu, 5 Dec 2013 03:57:49 +0000 (16:57 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Apr 2014 15:12:46 +0000 (17:12 +0200)
For "samba3" we use 60 seconds as in test_Password_lockout().

Change-Id: I886eb83d4c620e4d719a38ec47b45bacd1406b9d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/torture/rpc/samr.c

index 00da5fe24387b23aeb727992040b6af7f7ad5edc..c1c4dbdbb59d80c80b6c745dc38680a5ef65764d 100644 (file)
@@ -3770,8 +3770,14 @@ static bool test_Password_badpwdcount(struct dcerpc_pipe *p,
        uint32_t badpwdcount, tmp;
        uint32_t password_history_length = 12;
        uint32_t lockout_threshold = 15;
+       uint32_t lockout_seconds = 5;
+       uint64_t delta_time_factor = 10 * 1000 * 1000;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
+       if (torture_setting_bool(tctx, "samba3", false)) {
+               lockout_seconds = 60;
+       }
+
        torture_comment(tctx, "\nTesting bad pwd count with: %s\n", comment);
 
        torture_assert(tctx, password_history_length < lockout_threshold,
@@ -3792,6 +3798,10 @@ static bool test_Password_badpwdcount(struct dcerpc_pipe *p,
        info.info12 = *info12;
        info.info12.lockout_threshold = lockout_threshold;
 
+       /* set lockout duration of 5 seconds */
+       info.info12.lockout_duration = ~(lockout_seconds * delta_time_factor);
+       info.info12.lockout_window = ~(lockout_seconds * delta_time_factor);
+
        torture_assert(tctx,
                       test_SetDomainInfo(b, tctx, domain_handle,
                                          DomainLockoutInformation, &info),