summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-12-09 14:57:34 -0500
committerSimo Sorce <ssorce@redhat.com>2010-12-17 17:01:57 -0500
commitffc967b47ab0c38c361ce7a60283ed0b8c618d81 (patch)
treeb9e498c3c6d4a3e1eb291f6137b11bbc5b3989dc /tests/test_xmlrpc
parent623abc6bdff15a77fc14eac9dc1af975e9d98b2f (diff)
downloadfreeipa-ffc967b47ab0c38c361ce7a60283ed0b8c618d81.tar.gz
freeipa-ffc967b47ab0c38c361ce7a60283ed0b8c618d81.tar.xz
freeipa-ffc967b47ab0c38c361ce7a60283ed0b8c618d81.zip
Fix a slew of tests.
- Skip the DNS tests if DNS isn't configured - Add new attributes to user entries (displayname, cn and initials) - Make the nsaccountlock value consistent - Fix the cert subject for cert tests
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r--tests/test_xmlrpc/test_cert.py2
-rw-r--r--tests/test_xmlrpc/test_dns_plugin.py14
-rw-r--r--tests/test_xmlrpc/test_group_plugin.py3
-rw-r--r--tests/test_xmlrpc/test_nesting.py6
-rw-r--r--tests/test_xmlrpc/test_netgroup_plugin.py6
-rw-r--r--tests/test_xmlrpc/test_user_plugin.py12
6 files changed, 42 insertions, 1 deletions
diff --git a/tests/test_xmlrpc/test_cert.py b/tests/test_xmlrpc/test_cert.py
index 9ea1744a0..2f83eead3 100644
--- a/tests/test_xmlrpc/test_cert.py
+++ b/tests/test_xmlrpc/test_cert.py
@@ -92,7 +92,7 @@ class test_cert(XMLRPC_test):
"""
host_fqdn = u'ipatestcert.%s' % api.env.domain
service_princ = u'test/%s@%s' % (host_fqdn, api.env.realm)
- subject = 'CN=%s,O=IPA' % host_fqdn
+ subject = 'CN=%s,O=%s' % (host_fqdn, api.env.realm)
def test_1_cert_add(self):
"""
diff --git a/tests/test_xmlrpc/test_dns_plugin.py b/tests/test_xmlrpc/test_dns_plugin.py
index 1ceee9850..dcaa0658c 100644
--- a/tests/test_xmlrpc/test_dns_plugin.py
+++ b/tests/test_xmlrpc/test_dns_plugin.py
@@ -20,6 +20,7 @@
Test the `ipalib/plugins/dns.py` module.
"""
+import nose
from ipalib import api, errors
from tests.test_xmlrpc import objectclasses
from xmlrpc_test import Declarative, fuzzy_digits, fuzzy_uuid
@@ -29,6 +30,19 @@ dnsres1 = u'testdnsres'
class test_dns(Declarative):
+ def setUp(self):
+ super(test_dns, self).setUp()
+ try:
+ api.Command['dnszone_add'](dnszone1,
+ idnssoamname = u'ns1.%s' % dnszone1,
+ idnssoarname = u'root.%s' % dnszone1,
+ )
+ api.Command['dnszone_del'](dnszone1)
+ except errors.NotFound:
+ raise nose.SkipTest('DNS is not configured')
+ except errors.DuplicateEntry:
+ pass
+
cleanup_commands = [
('dnszone_del', [dnszone1], {}),
('dnsrecord_del', [dnszone1, dnsres1], {}),
diff --git a/tests/test_xmlrpc/test_group_plugin.py b/tests/test_xmlrpc/test_group_plugin.py
index acfaa6c45..961b4fd03 100644
--- a/tests/test_xmlrpc/test_group_plugin.py
+++ b/tests/test_xmlrpc/test_group_plugin.py
@@ -585,6 +585,9 @@ class test_group(Declarative):
sn=[u'User1'],
uid=[user1],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User1'],
+ cn=[u'Test User1'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=%s,cn=users,cn=accounts,%s' % (user1, api.env.basedn),
),
diff --git a/tests/test_xmlrpc/test_nesting.py b/tests/test_xmlrpc/test_nesting.py
index 8c9e4b25f..a5aa43281 100644
--- a/tests/test_xmlrpc/test_nesting.py
+++ b/tests/test_xmlrpc/test_nesting.py
@@ -125,6 +125,9 @@ class test_group(Declarative):
sn=[u'User1'],
uid=[user1],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User1'],
+ cn=[u'Test User1'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=%s,cn=users,cn=accounts,%s' % (user1, api.env.basedn)
),
@@ -150,6 +153,9 @@ class test_group(Declarative):
sn=[u'User2'],
uid=[user2],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User2'],
+ cn=[u'Test User2'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=%s,cn=users,cn=accounts,%s' % (user2, api.env.basedn)
),
diff --git a/tests/test_xmlrpc/test_netgroup_plugin.py b/tests/test_xmlrpc/test_netgroup_plugin.py
index f5b4f1e1f..3afeac63a 100644
--- a/tests/test_xmlrpc/test_netgroup_plugin.py
+++ b/tests/test_xmlrpc/test_netgroup_plugin.py
@@ -207,6 +207,9 @@ class test_netgroup(Declarative):
sn=[u'User1'],
uid=[user1],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User1'],
+ cn=[u'Test User1'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=%s,cn=users,cn=accounts,%s' % (user1, api.env.basedn),
),
@@ -231,6 +234,9 @@ class test_netgroup(Declarative):
sn=[u'User2'],
uid=[user2],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User2'],
+ cn=[u'Test User2'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=%s,cn=users,cn=accounts,%s' % (user2, api.env.basedn),
),
diff --git a/tests/test_xmlrpc/test_user_plugin.py b/tests/test_xmlrpc/test_user_plugin.py
index 18bdc7788..8dc715c9e 100644
--- a/tests/test_xmlrpc/test_user_plugin.py
+++ b/tests/test_xmlrpc/test_user_plugin.py
@@ -93,6 +93,9 @@ class test_user(Declarative):
sn=[u'User1'],
uid=[user1],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User1'],
+ cn=[u'Test User1'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=tuser1,cn=users,cn=accounts,' + api.env.basedn,
),
@@ -156,6 +159,9 @@ class test_user(Declarative):
'mepmanagedentry': [u'cn=%s,cn=groups,cn=accounts,%s' % (user1, api.env.basedn)],
'krbpwdpolicyreference': [u'cn=global_policy,cn=%s,cn=kerberos,%s' % (api.env.realm, api.env.basedn)],
'nsaccountlock': [u'False'],
+ 'displayname': [u'Test User1'],
+ 'cn': [u'Test User1'],
+ 'initials': [u'TU'],
},
],
summary=u'1 user matched',
@@ -396,6 +402,9 @@ class test_user(Declarative):
sn=[u'User1'],
uid=[user1],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User1'],
+ cn=[u'Test User1'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=tuser1,cn=users,cn=accounts,' + api.env.basedn,
),
@@ -420,6 +429,9 @@ class test_user(Declarative):
sn=[u'User2'],
uid=[user2],
uidnumber=[fuzzy_digits],
+ displayname=[u'Test User2'],
+ cn=[u'Test User2'],
+ initials=[u'TU'],
ipauniqueid=[fuzzy_uuid],
dn=u'uid=tuser2,cn=users,cn=accounts,' + api.env.basedn,
),