From be2efc12d37018794200fee874f27d83e0442ea4 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Sat, 26 Sep 2020 19:40:02 -0400 Subject: [PATCH] Add a raiseonerr option to ldappasswd_user_change This is so on tests for bad password one can catch the error message. https://pagure.io/freeipa/issue/6964 https://pagure.io/freeipa/issue/5948 https://pagure.io/freeipa/issue/2445 https://pagure.io/freeipa/issue/298 Signed-off-by: Rob Crittenden Reviewed-By: Alexander Bokovoy Reviewed-By: Christian Heimes --- ipatests/pytest_ipa/integration/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py index e2a764a2e..288a01a11 100755 --- a/ipatests/pytest_ipa/integration/tasks.py +++ b/ipatests/pytest_ipa/integration/tasks.py @@ -1751,7 +1751,8 @@ def get_host_ip_with_hostmask(host): return None -def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False): +def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False, + raiseonerr=True): container_user = dict(DEFAULT_CONFIG)['container_user'] basedn = master.domain.basedn @@ -1766,7 +1767,7 @@ def ldappasswd_user_change(user, oldpw, newpw, master, use_dirman=False): else: args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw, '-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri] - master.run_command(args) + return master.run_command(args, raiseonerr=raiseonerr) def ldappasswd_sysaccount_change(user, oldpw, newpw, master, use_dirman=False):