summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_host_plugin.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-08-22 16:24:07 -0400
committerMartin Kosek <mkosek@redhat.com>2011-08-24 14:12:01 +0200
commit109b79a7acf871b28e5b4cce2fd3b119f0fdd249 (patch)
treed16109dea1c28daa16d74442bc404767f64cd323 /tests/test_xmlrpc/test_host_plugin.py
parent0147ef5b73c5b5345dd9bdb5d273ffcf8cb20cab (diff)
downloadfreeipa-109b79a7acf871b28e5b4cce2fd3b119f0fdd249.tar.gz
freeipa-109b79a7acf871b28e5b4cce2fd3b119f0fdd249.tar.xz
freeipa-109b79a7acf871b28e5b4cce2fd3b119f0fdd249.zip
Change the way has_keytab is determined, also check for password.
We need an indicator to see if a keytab has been set on host and service entries. We also need a way to know if a one-time password is set on a host. This adds an ACI that grants search on userPassword and krbPrincipalKey so we can do an existence search on them. This way we can tell if the attribute is set and create a fake attribute accordingly. When a userPassword is set on a host a keytab is generated against that password so we always set has_keytab to False if a password exists. This is fine because when keytab gets generated for the host the password is removed (hence one-time). This adds has_keytab/has_password to the user, host and service plugins. ticket https://fedorahosted.org/freeipa/ticket/1538
Diffstat (limited to 'tests/test_xmlrpc/test_host_plugin.py')
-rw-r--r--tests/test_xmlrpc/test_host_plugin.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 87eb93768..f7746407b 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -109,6 +109,8 @@ class test_host(Declarative):
objectclass=objectclasses.host,
ipauniqueid=[fuzzy_uuid],
managedby_host=[fqdn1],
+ has_keytab=False,
+ has_password=False,
),
),
),
@@ -140,6 +142,7 @@ class test_host(Declarative):
l=[u'Undisclosed location 1'],
krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)],
has_keytab=False,
+ has_password=False,
managedby_host=[fqdn1],
),
),
@@ -168,7 +171,8 @@ class test_host(Declarative):
managedby_host=[fqdn1],
managing_host=[fqdn1],
ipauniqueid=[fuzzy_uuid],
- has_keytab=False
+ has_keytab=False,
+ has_password=False,
),
),
),
@@ -189,6 +193,8 @@ class test_host(Declarative):
l=[u'Undisclosed location 1'],
krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)],
managedby_host=[u'%s' % fqdn1],
+ has_keytab=False,
+ has_password=False,
),
],
),
@@ -219,6 +225,8 @@ class test_host(Declarative):
ipauniqueid=[fuzzy_uuid],
managedby_host=[u'%s' % fqdn1],
managing_host=[u'%s' % fqdn1],
+ has_keytab=False,
+ has_password=False,
),
],
),
@@ -265,6 +273,7 @@ class test_host(Declarative):
l=[u'Undisclosed location 1'],
krbprincipalname=[u'host/%s@%s' % (fqdn1, api.env.realm)],
has_keytab=False,
+ has_password=False,
managedby_host=[u'%s' % fqdn1],
usercertificate=[base64.b64decode(servercert)],
valid_not_before=fuzzy_date,
@@ -300,6 +309,8 @@ class test_host(Declarative):
objectclass=objectclasses.host,
ipauniqueid=[fuzzy_uuid],
managedby_host=[u'%s' % fqdn3],
+ has_keytab=False,
+ has_password=False,
),
),
),
@@ -326,6 +337,8 @@ class test_host(Declarative):
objectclass=objectclasses.host,
ipauniqueid=[fuzzy_uuid],
managedby_host=[u'%s' % fqdn4],
+ has_keytab=False,
+ has_password=False,
),
),
),
@@ -369,6 +382,7 @@ class test_host(Declarative):
l=[u'Undisclosed location 2'],
krbprincipalname=[u'host/%s@%s' % (fqdn3, api.env.realm)],
has_keytab=False,
+ has_password=False,
managedby_host=[u'%s' % fqdn3, u'%s' % fqdn1],
),
),
@@ -468,6 +482,8 @@ class test_host(Declarative):
objectclass=objectclasses.host,
ipauniqueid=[fuzzy_uuid],
managedby_host=[u'%s' % fqdn1],
+ has_keytab=False,
+ has_password=False,
),
),
),
@@ -479,7 +495,7 @@ class test_host(Declarative):
value=service1,
summary=u'Added service "%s"' % service1,
result=dict(
- dn=service1dn,
+ dn=lambda x: DN(x) == service1dn,
krbprincipalname=[service1],
objectclass=objectclasses.service,
managedby_host=[fqdn1],
@@ -539,6 +555,8 @@ class test_host(Declarative):
objectclass=objectclasses.host,
ipauniqueid=[fuzzy_uuid],
managedby_host=[u'%s' % fqdn2],
+ has_keytab=False,
+ has_password=False,
),
),
),