summaryrefslogtreecommitdiffstats
path: root/tests/test_ipaserver
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2011-11-01 08:58:05 -0400
committerSimo Sorce <ssorce@redhat.com>2012-01-11 12:04:22 -0500
commit40a8ecf28c6192e20c837f8ead836885b1b1147c (patch)
treedb174fdd5ef15f71b0f4aed5f374f17c30e3ec32 /tests/test_ipaserver
parent18fa8baded287fd7c811eb3e60e065e2d2d5f776 (diff)
downloadfreeipa.git-40a8ecf28c6192e20c837f8ead836885b1b1147c.tar.gz
freeipa.git-40a8ecf28c6192e20c837f8ead836885b1b1147c.tar.xz
freeipa.git-40a8ecf28c6192e20c837f8ead836885b1b1147c.zip
Fix attempted write to attribute of read-only object.
Add new class "cachedproperty" for creating property-like attributes that cache the return value of a method call. Also fix few issues in the unit tests to enable them to succeed. ticket 1959
Diffstat (limited to 'tests/test_ipaserver')
-rw-r--r--tests/test_ipaserver/test_ldap.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_ipaserver/test_ldap.py b/tests/test_ipaserver/test_ldap.py
index abfd1be7..1bbd94fb 100644
--- a/tests/test_ipaserver/test_ldap.py
+++ b/tests/test_ipaserver/test_ldap.py
@@ -112,7 +112,15 @@ class test_ldap(object):
myapi.register(service)
myapi.register(service_show)
myapi.finalize()
- myapi.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw='password')
+
+ pwfile = api.env.dot_ipa + os.sep + ".dmpw"
+ if ipautil.file_exists(pwfile):
+ fp = open(pwfile, "r")
+ dm_password = fp.read().rstrip()
+ fp.close()
+ else:
+ raise nose.SkipTest("No directory manager password in %s" % pwfile)
+ myapi.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)
result = myapi.Command['service_show']('ldap/%s@%s' % (api.env.host, api.env.realm,))
entry_attrs = result['result']