summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorMilan KubĂ­k <mkubik@redhat.com>2016-07-25 13:24:51 +0200
committerMartin Basti <mbasti@redhat.com>2016-07-29 09:04:42 +0200
commite17ec08daef521b33dcc5db131f36f4269edcdb2 (patch)
tree54bf706a7fc54928441e0430e37d5b10a4b2008f /ipatests
parent8e83b9715a04fab8d7864b6e02e1210df885119c (diff)
downloadfreeipa-e17ec08daef521b33dcc5db131f36f4269edcdb2.tar.gz
freeipa-e17ec08daef521b33dcc5db131f36f4269edcdb2.tar.xz
freeipa-e17ec08daef521b33dcc5db131f36f4269edcdb2.zip
ipatests: Allow change_principal context manager to use canonicalization
The context manager has been extended to optionally request principal canonicalization and indicate that the enterprise principal is being used. This allows to change the user during the test to an user using the alias and to test behavior related to enterprise principals. https://fedorahosted.org/freeipa/ticket/6142 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/util.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipatests/util.py b/ipatests/util.py
index 27b939e25..8878993e1 100644
--- a/ipatests/util.py
+++ b/ipatests/util.py
@@ -693,7 +693,8 @@ def unlock_principal_password(user, oldpw, newpw):
@contextmanager
-def change_principal(user, password, client=None, path=None):
+def change_principal(user, password, client=None, path=None,
+ canonicalize=False, enterprise=False):
if path:
ccache_name = path
@@ -708,7 +709,8 @@ def change_principal(user, password, client=None, path=None):
try:
with private_ccache(ccache_name):
- kinit_password(user, password, ccache_name)
+ kinit_password(user, password, ccache_name,
+ canonicalize=canonicalize, enterprise=enterprise)
client.Backend.rpcclient.connect()
try: