pwpolicy: Fix tests for 'minlength: ""'

When clearing minimum length parameter, FreeIPA raises an error, and the
error is different when executing the playbook in server or client
context. Since the error message is evaluated in the text, both errors
must be accepted as "not a failure", since ansible-freeipa did the
correct call.

Once https://pagure.io/freeipa/issue/9297 is fixed, the test must be
updated to not accept any of these error messages.
This commit is contained in:
Rafael Guterres Jeffman
2023-01-16 20:20:52 -03:00
parent e95bec1803
commit 9f773ff5ac

View File

@@ -175,7 +175,13 @@
name: ops
minlength: ""
register: result
failed_when: result.changed or (result.failed and "int() argument must be a string, a bytes-like object" not in result.msg)
failed_when:
result.changed or (
result.failed and not (
"an internal error has occurred" in result.msg
or "int() argument must be" in result.msg
)
)
when: ipa_version is version("4.9", ">=")
- name: Ensure minlength is not cleared due to FreeIPA issue