mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-06 09:11:29 -07:00
[aws] New module: iam_password_policy (#36200)
* Adding iam_password_policy module * fixing various issues -- error handling, bugs * fixing various issues based on tests * renaming dummy var * fixing type reference in documentation * adding int tests and other updates * removing typo * fixing auth for int tests * removing int tests for now * readding integration tests w/ unsupported designation * removing conflicting group * Update aliases * Fix unused variable
This commit is contained in:
parent
e685027fb8
commit
9c08ff7a94
4 changed files with 307 additions and 0 deletions
25
test/units/modules/cloud/amazon/test_iam_password_policy.py
Normal file
25
test/units/modules/cloud/amazon/test_iam_password_policy.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import boto3
|
||||
import pytest
|
||||
|
||||
from units.modules.utils import set_module_args
|
||||
from ansible.module_utils.ec2 import HAS_BOTO3
|
||||
from ansible.modules.cloud.amazon import iam_password_policy
|
||||
|
||||
if not HAS_BOTO3:
|
||||
pytestmark = pytest.mark.skip("iam_password_policy.py requires the `boto3` and `botocore` modules")
|
||||
|
||||
|
||||
def test_warn_if_state_not_specified():
|
||||
set_module_args({
|
||||
"min_pw_length": "8",
|
||||
"require_symbols": "false",
|
||||
"require_numbers": "true",
|
||||
"require_uppercase": "true",
|
||||
"require_lowercase": "true",
|
||||
"allow_pw_change": "true",
|
||||
"pw_max_age": "60",
|
||||
"pw_reuse_prevent": "5",
|
||||
"pw_expire": "false"
|
||||
})
|
||||
with pytest.raises(SystemExit):
|
||||
print(iam_password_policy.main())
|
Loading…
Add table
Add a link
Reference in a new issue