summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-06-14 11:02:16 +0200
committerMartin Kosek <mkosek@redhat.com>2012-06-14 12:21:18 +0200
commit0c96f5935607e3825ed76330d3375dec9689c8ba (patch)
tree73598587abda00f06e4782ba08f834e781e07b8e
parent9960149e3f84564ab324bfb9db7c50063d87a7bd (diff)
downloadfreeipa-0c96f5935607e3825ed76330d3375dec9689c8ba.zip
freeipa-0c96f5935607e3825ed76330d3375dec9689c8ba.tar.gz
freeipa-0c96f5935607e3825ed76330d3375dec9689c8ba.tar.xz
Remove trust work unit test failures
Trust work that was pushed recently requires few changes in unit tests to prevent test failures. This patch also removes repetitive construction of group DN in group unit tests.
-rw-r--r--tests/test_xmlrpc/objectclasses.py1
-rw-r--r--tests/test_xmlrpc/test_group_plugin.py99
-rw-r--r--tests/test_xmlrpc/test_service_plugin.py2
3 files changed, 35 insertions, 67 deletions
diff --git a/tests/test_xmlrpc/objectclasses.py b/tests/test_xmlrpc/objectclasses.py
index 346d52c..a036b34 100644
--- a/tests/test_xmlrpc/objectclasses.py
+++ b/tests/test_xmlrpc/objectclasses.py
@@ -93,6 +93,7 @@ service = [
u'ipaobject',
u'ipaservice',
u'pkiuser',
+ u'ipakrbprincipal',
u'top',
]
diff --git a/tests/test_xmlrpc/test_group_plugin.py b/tests/test_xmlrpc/test_group_plugin.py
index abee7ba..9597992 100644
--- a/tests/test_xmlrpc/test_group_plugin.py
+++ b/tests/test_xmlrpc/test_group_plugin.py
@@ -33,6 +33,8 @@ user1 = u'tuser1'
invalidgroup1=u'+tgroup1'
+def get_group_dn(cn):
+ return DN(('cn', cn), api.env.container_group, api.env.basedn)
class test_group(Declarative):
cleanup_commands = [
@@ -86,9 +88,7 @@ class test_group(Declarative):
description=[u'Test desc 1'],
objectclass=objectclasses.group,
ipauniqueid=[fuzzy_uuid],
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup1'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup1'),
),
),
),
@@ -113,9 +113,7 @@ class test_group(Declarative):
result=dict(
cn=[group1],
description=[u'Test desc 1'],
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup1'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup1'),
),
),
),
@@ -145,9 +143,7 @@ class test_group(Declarative):
result=dict(
cn=[group1],
description=[u'New desc 1'],
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup1'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup1'),
),
summary=None,
),
@@ -180,9 +176,7 @@ class test_group(Declarative):
result=dict(
cn=[group1],
description=(u'New desc 1',),
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup1'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup1'),
gidnumber=[fuzzy_digits],
),
summary=None,
@@ -198,9 +192,7 @@ class test_group(Declarative):
truncated=False,
result=[
dict(
- dn=lambda x: DN(x) == \
- DN(('cn',group1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn(group1),
cn=[group1],
description=[u'New desc 1'],
gidnumber=[fuzzy_digits],
@@ -249,9 +241,7 @@ class test_group(Declarative):
gidnumber=[fuzzy_digits],
objectclass=objectclasses.group + [u'posixgroup'],
ipauniqueid=[fuzzy_uuid],
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup2'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup2'),
),
),
),
@@ -277,9 +267,7 @@ class test_group(Declarative):
cn=[group2],
description=[u'Test desc 2'],
gidnumber=[fuzzy_digits],
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup2'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup2'),
),
),
),
@@ -311,9 +299,7 @@ class test_group(Declarative):
cn=[group2],
description=[u'New desc 2'],
gidnumber=[fuzzy_digits],
- dn=lambda x: DN(x) == \
- DN(('cn','testgroup2'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup2'),
),
summary=None,
),
@@ -328,9 +314,7 @@ class test_group(Declarative):
truncated=False,
result=[
dict(
- dn=lambda x: DN(x) == \
- DN(('cn',group2),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn('testgroup2'),
cn=[group2],
description=[u'New desc 2'],
gidnumber=[fuzzy_digits],
@@ -345,50 +329,46 @@ class test_group(Declarative):
desc='Search for all groups',
command=('group_find', [], {}),
expected=dict(
- summary=u'5 groups matched',
- count=5,
+ summary=u'6 groups matched',
+ count=6,
truncated=False,
result=[
{
- 'dn': lambda x: DN(x) == \
- DN(('cn','admins'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn('admins'),
'member_user': [u'admin'],
'gidnumber': [fuzzy_digits],
'cn': [u'admins'],
'description': [u'Account administrators group'],
},
{
- 'dn': lambda x: DN(x) == \
- DN(('cn','editors'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn('editors'),
'gidnumber': [fuzzy_digits],
'cn': [u'editors'],
'description': [u'Limited admins who can edit other users'],
},
{
- 'dn': lambda x: DN(x) == \
- DN(('cn','ipausers'),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn('ipausers'),
'cn': [u'ipausers'],
'description': [u'Default group for all users'],
},
dict(
- dn=lambda x: DN(x) == \
- DN(('cn',group1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn(group1),
cn=[group1],
description=[u'New desc 1'],
gidnumber=[fuzzy_digits],
),
dict(
- dn=lambda x: DN(x) == \
- DN(('cn',group2),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn(group2),
cn=[group2],
description=[u'New desc 2'],
gidnumber=[fuzzy_digits],
),
+ {
+ 'dn': lambda x: DN(x) == get_group_dn('trust admins'),
+ 'member_user': [u'admin'],
+ 'cn': [u'trust admins'],
+ 'description': [u'Trusts administrators group'],
+ },
],
),
),
@@ -411,9 +391,7 @@ class test_group(Declarative):
),
),
result={
- 'dn': lambda x: DN(x) == \
- DN(('cn',group1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn(group1),
'member_group': (group2,),
'gidnumber': [fuzzy_digits],
'cn': [group1],
@@ -437,9 +415,7 @@ class test_group(Declarative):
),
),
result={
- 'dn': lambda x: DN(x) == \
- DN(('cn',group1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn(group1),
'member_group': (group2,),
'gidnumber': [fuzzy_digits],
'cn': [group1],
@@ -462,9 +438,7 @@ class test_group(Declarative):
),
),
result={
- 'dn': lambda x: DN(x) == \
- DN(('cn',group1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn(group1),
'cn': [group1],
'gidnumber': [fuzzy_digits],
'description': [u'New desc 1'],
@@ -487,9 +461,7 @@ class test_group(Declarative):
),
),
result={
- 'dn': lambda x: DN(x) == \
- DN(('cn',group1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn(group1),
'cn': [group1],
'gidnumber': [fuzzy_digits],
'description': [u'New desc 1'],
@@ -658,8 +630,7 @@ class test_group(Declarative):
[DN(('cn','global_policy'),('cn',api.env.realm),
('cn','kerberos'),api.env.basedn)],
mepmanagedentry=lambda x: [DN(i) for i in x] == \
- [DN(('cn',user1),('cn','groups'),('cn','accounts'),
- api.env.basedn)],
+ [get_group_dn(user1)],
memberof_group=[u'ipausers'],
dn=lambda x: DN(x) == \
DN(('uid',user1),('cn','users'),('cn','accounts'),
@@ -681,9 +652,7 @@ class test_group(Declarative):
cn=[user1],
description=[u'User private group for %s' % user1],
gidnumber=[fuzzy_digits],
- dn=lambda x: DN(x) == \
- DN(('cn',user1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn(user1),
),
),
),
@@ -697,9 +666,7 @@ class test_group(Declarative):
truncated=False,
result=[
dict(
- dn=lambda x: DN(x) == \
- DN(('cn',user1),('cn','groups'),('cn','accounts'),
- api.env.basedn),
+ dn=lambda x: DN(x) == get_group_dn(user1),
cn=[user1],
description=[u'User private group for %s' % user1],
gidnumber=[fuzzy_digits],
@@ -816,9 +783,7 @@ class test_group(Declarative):
),
),
result={
- 'dn': lambda x: DN(x) == \
- DN(('cn', 'admins'), ('cn', 'groups'),
- ('cn', 'accounts'), api.env.basedn),
+ 'dn': lambda x: DN(x) == get_group_dn('admins'),
'member_user': [u'admin', user1],
'gidnumber': [fuzzy_digits],
'cn': [u'admins'],
diff --git a/tests/test_xmlrpc/test_service_plugin.py b/tests/test_xmlrpc/test_service_plugin.py
index 494a9fc..5f089fb 100644
--- a/tests/test_xmlrpc/test_service_plugin.py
+++ b/tests/test_xmlrpc/test_service_plugin.py
@@ -222,6 +222,7 @@ class test_service(Declarative):
result=dict(
dn=lambda x: DN(x) == service1dn,
krbprincipalname=[service1],
+ ipakrbprincipalalias=[service1],
objectclass=objectclasses.service,
ipauniqueid=[fuzzy_uuid],
managedby_host=[fqdn1],
@@ -261,6 +262,7 @@ class test_service(Declarative):
dict(
dn=lambda x: DN(x) == service1dn,
krbprincipalname=[service1],
+ ipakrbprincipalalias=[service1],
objectclass=objectclasses.service,
ipauniqueid=[fuzzy_uuid],
has_keytab=False,