Skip to content

Commit

Permalink
tests: Add LDAP URI to ldappasswd explicitly
Browse files Browse the repository at this point in the history
Tests should always rely on api.env.* values when possible.
Without this running the tests remotely can result in errors such
as ldap{search,modify,passwd} attempting to connect to the
wrong URI and failing.

https://fedorahosted.org/freeipa/ticket/6622

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
  • Loading branch information
David Kupka authored and Tomas Krizek committed Oct 16, 2017
1 parent 4e74685 commit d0a7319
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ipatests/pytest_plugins/integration/tasks.py
Expand Up @@ -1314,7 +1314,8 @@ def ldappasswd_user_change(user, oldpw, newpw, master):
basedn = master.domain.basedn

userdn = "uid={},{},{}".format(user, container_user, basedn)
master_ldap_uri = "ldap://{}".format(master.external_hostname)

args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw,
'-s', newpw, '-x']
'-s', newpw, '-x', '-H', master_ldap_uri]
master.run_command(args)
2 changes: 1 addition & 1 deletion ipatests/util.py
Expand Up @@ -732,7 +732,7 @@ def unlock_principal_password(user, oldpw, newpw):
user, api.env.container_user, api.env.basedn)

args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw,
'-s', newpw, '-x']
'-s', newpw, '-x', '-H', api.env.ldap_uri]
return run(args)


Expand Down

0 comments on commit d0a7319

Please sign in to comment.