From ffc967b47ab0c38c361ce7a60283ed0b8c618d81 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 9 Dec 2010 14:57:34 -0500 Subject: 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 --- tests/test_xmlrpc/test_cert.py | 2 +- tests/test_xmlrpc/test_dns_plugin.py | 14 ++++++++++++++ tests/test_xmlrpc/test_group_plugin.py | 3 +++ tests/test_xmlrpc/test_nesting.py | 6 ++++++ tests/test_xmlrpc/test_netgroup_plugin.py | 6 ++++++ tests/test_xmlrpc/test_user_plugin.py | 12 ++++++++++++ 6 files changed, 42 insertions(+), 1 deletion(-) (limited to 'tests') 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, ), -- cgit