cyberark / ansible-security-automation-collection

CyberArk Ansible Security Automation Collection
MIT License
60 stars 39 forks source link

Sanity tests failing in cyberark.pas #44

Closed dmsimard closed 1 year ago

dmsimard commented 2 years ago
SUMMARY

We are running sanity tests across every collection included in the Ansible community package (as part of this issue) and found that ansible-test sanity --docker against cyberpark.pas 1.0.13 fails with ansible-core 2.13.0rc1 in ansible 6.0.0a2.

ISSUE TYPE
COMPONENT NAME

n/a

ANSIBLE VERSION
ansible [core 2.13.0rc1]
COLLECTION VERSION
1.0.13
STEPS TO REPRODUCE
ansible-test sanity --docker
EXPECTED RESULTS

Tests are either passing or ignored.

ACTUAL RESULTS
ERROR: Found 29 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/cyberark_account.py:0:0: doc-default-does-not-match-spec: Argument 'automatic_management_enabled' in argument_spec found in secret_management defines default as (None) but documentation defines default as (False)
ERROR: plugins/modules/cyberark_account.py:0:0: doc-required-mismatch: Argument 'api_base_url' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/cyberark_account.py:0:0: doc-required-mismatch: Argument 'logging_level' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/cyberark_account.py:0:0: doc-required-mismatch: Argument 'state' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/cyberark_account.py:0:0: invalid-documentation: DOCUMENTATION.version_added: expected str for dictionary value @ data['version_added']. Got 2.4
ERROR: plugins/modules/cyberark_account.py:0:0: invalid-documentation-markup: DOCUMENTATION.options.cyberark_session.description: Directive "M(cyberark_authentication)" must contain a FQCN for dictionary value @ data['options']['cyberark_session']['description']. Got ['Dictionary set by a CyberArk authentication containing the different values to perform actions on a logged-on CyberArk session, please see M(cyberark_authentication) module for an example of cyberark_session.']
ERROR: plugins/modules/cyberark_account.py:0:0: no-default-for-required-parameter: DOCUMENTATION.options.state: Argument is marked as required but specifies a default. Arguments with a default should not be marked as required for dictionary value @ data['options']['state']. Got {'description': ['Assert the desired state of the account C(present) to creat or update and account object. Set to C(absent) for deletion of an account object.'], 'required': True, 'default': 'present', 'choices': ['present', 'absent'], 'type': 'str'}
ERROR: plugins/modules/cyberark_account.py:0:0: no-log-needed: Argument 'secret_management' in argument_spec could be a secret, though doesn't have `no_log` set
ERROR: plugins/modules/cyberark_account.py:0:0: return-syntax-error: RETURN.result.contains.secretManagement.contains: required key not provided @ data['result']['contains']['secretManagement']['contains']. Got None
ERROR: plugins/modules/cyberark_authentication.py:0:0: doc-default-does-not-match-spec: Argument 'concurrentSession' in argument_spec defines default as (False) but documentation defines default as (None)
ERROR: plugins/modules/cyberark_authentication.py:0:0: invalid-documentation: DOCUMENTATION.author: Invalid author for dictionary value @ data['author']. Got ['Edward Nunez (@enunez-cyberark) CyberArk BizDev', 'Cyberark Bizdev (@cyberark-bizdev)', 'Edgar Mota']
ERROR: plugins/modules/cyberark_authentication.py:0:0: invalid-documentation: DOCUMENTATION.version_added: expected str for dictionary value @ data['version_added']. Got 2.4
ERROR: plugins/modules/cyberark_authentication.py:0:0: parameter-type-not-in-doc: Argument 'concurrentSession' in argument_spec defines type as 'bool' but documentation doesn't define type
ERROR: plugins/modules/cyberark_authentication.py:0:0: undocumented-parameter: Argument 'concurrentSession' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/cyberark_credential.py:0:0: invalid-documentation: DOCUMENTATION.version_added: expected str for dictionary value @ data['version_added']. Got 2.4
ERROR: plugins/modules/cyberark_credential.py:0:0: no-log-needed: Argument 'client_key' in argument_spec could be a secret, though doesn't have `no_log` set
ERROR: plugins/modules/cyberark_credential.py:0:0: return-syntax-error: RETURN.result.contains.Safe.type: not a valid value for dictionary value @ data['result']['contains']['Safe']['type']. Got 'string'
ERROR: plugins/modules/cyberark_user.py:0:0: doc-default-does-not-match-spec: Argument 'change_password_on_the_next_logon' in argument_spec defines default as (None) but documentation defines default as (False)
ERROR: plugins/modules/cyberark_user.py:0:0: doc-default-does-not-match-spec: Argument 'disabled' in argument_spec defines default as (None) but documentation defines default as (False)
ERROR: plugins/modules/cyberark_user.py:0:0: doc-required-mismatch: Argument 'logging_level' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/cyberark_user.py:0:0: invalid-documentation: DOCUMENTATION.version_added: expected str for dictionary value @ data['version_added']. Got 2.4
ERROR: plugins/modules/cyberark_user.py:0:0: invalid-documentation-markup: DOCUMENTATION.options.cyberark_session.description: Directive "M(cyberark_authentication)" must contain a FQCN for dictionary value @ data['options']['cyberark_session']['description']. Got ['Dictionary set by a CyberArk authentication containing the different values to perform actions on a logged-on CyberArk session, please see M(cyberark_authentication) module for an example of cyberark_session.']
ERROR: plugins/modules/cyberark_user.py:0:0: no-default-for-required-parameter: DOCUMENTATION.options.logging_level: Argument is marked as required but specifies a default. Arguments with a default should not be marked as required for dictionary value @ data['options']['logging_level']. Got {'description': ['Parameter used to define the level of troubleshooting output to the C(logging_file) value.'], 'required': True, 'choices': ['NOTSET', 'DEBUG', 'INFO'], 'default': 'NOTSET', 'type': 'str'}
ERROR: plugins/modules/cyberark_user.py:0:0: parameter-list-no-elements: Argument 'authorization' in argument_spec defines type as list but elements is not defined
ERROR: plugins/modules/cyberark_user.py:0:0: parameter-list-no-elements: DOCUMENTATION.options.authorization: Argument defines type as list but elements is not defined for dictionary value @ data['options']['authorization']. Got {'description': ['A list of authorization options for this user.', 'Options can include AddSafes and AuditUsers', 'The default provides backwards compatability with older versions of the collection'], 'type': 'list', 'default': ['AddSafes', 'AuditUsers']}
ERROR: plugins/modules/cyberark_user.py:0:0: parameter-type-not-in-doc: Argument 'domain_name' in argument_spec defines type as 'str' but documentation doesn't define type
ERROR: plugins/modules/cyberark_user.py:0:0: parameter-type-not-in-doc: Argument 'member_type' in argument_spec defines type as 'str' but documentation doesn't define type
ERROR: plugins/modules/cyberark_user.py:0:0: undocumented-parameter: Argument 'domain_name' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/cyberark_user.py:0:0: undocumented-parameter: Argument 'member_type' is listed in the argument_spec, but not documented in the module documentation
ERROR: The 1 sanity test(s) listed below (out of 43) failed. See error output above for details.
validate-modules
ERROR: Command "podman exec ansible-test-controller-6Yf4ICQQ /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible_collections/cyberark/pas LC_ALL=en_US.UTF-8 /usr/bin/python3.10 /root/ansible/bin/ansible-test sanity --containers '{}' --skip-test pylint --metadata tests/output/.tmp/metadata-7cv3_z7e.json --truncate 0 --color no --host-path tests/output/.tmp/host-ganac95w" returned exit status 1.
Andersson007 commented 1 year ago

Dear maintainers, To be a part of Ansible package, the collection requirements say that the collection should have CI and run at least sanity tests. You could use this GHA matrix template https://github.com/ansible-collections/collection_template/blob/main/.github/workflows/ansible-test.yml Please let us know when it's done.

Be sure the collection adheres to all the collection requirements

szh commented 1 year ago

@cyberark-bizdev @infamousjoeg @jtuttle Please take a look at this.