Skip to content

Commit 8f79096

Browse files
committed
Tests validity of LockoutDuration zero value
1 parent 4e18d97 commit 8f79096

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/integration/modules/test_win_lgpo.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,27 @@ def test_set_computer_policy_ClipboardRedirection(self):
559559
],
560560
)
561561

562+
@destructiveTest
563+
def test_set_computer_policy_LockoutDuration(self):
564+
"""
565+
Test setting LockoutDuration
566+
"""
567+
# For LockoutDuration to be meaningful, first configure
568+
# LockoutThreshold
569+
self._testSeceditPolicy("LockoutThreshold", 3, [r"^LockoutBadCount = 3"])
570+
571+
# Next set the LockoutDuration non-zero value, as this is required
572+
# before setting LockoutWindow
573+
self._testSeceditPolicy("LockoutDuration", 60, [r"^LockoutDuration = 60"])
574+
575+
# Now set LockoutWindow to a valid value <= LockoutDuration. If this
576+
# is not set, then the LockoutDuration zero value is ignored by the
577+
# Windows API (leading to a false sense of accomplishment)
578+
self._testSeceditPolicy("LockoutWindow", 60, [r"^ResetLockoutCount = 60"])
579+
580+
# set LockoutDuration zero value, the secedit zero value is -1
581+
self._testSeceditPolicy("LockoutDuration", 0, [r"^LockoutDuration = -1"])
582+
562583
@destructiveTest
563584
def test_set_computer_policy_GuestAccountStatus(self):
564585
"""

0 commit comments

Comments
 (0)