Re: [Freeipa-devel] [PATCH] jderose 037 Fix broken unit tests

2010-02-03 Thread Rob Crittenden

Jason Gerard DeRose wrote:

This patch gets (almost) all the XML-RPC tests working again under
Fedora12.  Some may not pass under Fedora11 due to 389 schema changes,
but Fedora12 should be our primary test target at this point, IHMO.
Does anyone disagree?

3 cert tests still fail, but I'm not familiar enough with the cert
plugins to confidently decide whether the tests need to be updated or
whether something is broken.  Rob or John, could you take a look at
these when you get a chance?

We really need to get strict about patches with regard to tests.  If a
patch breaks a test, the test needs to be updated in that same patch (or
if the test is correct, the code needs to be updated).  If a patch
introduces new functionality, it must be accompanied by tests.

Rob and Pavel, I'm looking at you.  If tests no passy, no acky-acky.  ;)

I know I've been at fault too, but I've already scolded myself off-list.


I'd rather you simply remove the extra attributes rather than commenting 
them out. If we aren't going to be providing them to the end-user we 
should eliminate them from the tests as well.


But there seems to be a deeper problem here, the question is: why aren't 
these attributes appearing?


In the case of 'l' or 'localityname' it seems to be a bug. It is in the 
default_attributes list in the host plugin but it isn't being returned 
by host_show().


I also wonder if we really should be returning uidnumber and gidnumber, 
they seem kinda handy. IIRC I based the output of the v1 ipa-finduser on 
finger which doesn't include these values.


So nack for now until we can figure out what is going on under the hood.

rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] jderose 037 Fix broken unit tests

2010-01-27 Thread Jason Gerard DeRose
This patch gets (almost) all the XML-RPC tests working again under
Fedora12.  Some may not pass under Fedora11 due to 389 schema changes,
but Fedora12 should be our primary test target at this point, IHMO.
Does anyone disagree?

3 cert tests still fail, but I'm not familiar enough with the cert
plugins to confidently decide whether the tests need to be updated or
whether something is broken.  Rob or John, could you take a look at
these when you get a chance?

We really need to get strict about patches with regard to tests.  If a
patch breaks a test, the test needs to be updated in that same patch (or
if the test is correct, the code needs to be updated).  If a patch
introduces new functionality, it must be accompanied by tests.

Rob and Pavel, I'm looking at you.  If tests no passy, no acky-acky.  ;)

I know I've been at fault too, but I've already scolded myself off-list.
From b7c5a456693cae3d6ecbb717114c5a6bbf205acd Mon Sep 17 00:00:00 2001
From: Jason Gerard DeRose jder...@redhat.com
Date: Wed, 27 Jan 2010 07:16:06 -0700
Subject: [PATCH] Fix broken XML-RPC tests

---
 tests/test_xmlrpc/objectclasses.py |1 +
 tests/test_xmlrpc/test_group_plugin.py |6 --
 tests/test_xmlrpc/test_host_plugin.py  |   20 ++--
 tests/test_xmlrpc/test_hostgroup_plugin.py |   17 +
 tests/test_xmlrpc/test_rolegroup_plugin.py |8 +---
 tests/test_xmlrpc/test_taskgroup_plugin.py |9 ++---
 tests/test_xmlrpc/test_user_plugin.py  |8 ++--
 7 files changed, 41 insertions(+), 28 deletions(-)

diff --git a/tests/test_xmlrpc/objectclasses.py b/tests/test_xmlrpc/objectclasses.py
index 5f95cd7..857147d 100644
--- a/tests/test_xmlrpc/objectclasses.py
+++ b/tests/test_xmlrpc/objectclasses.py
@@ -29,6 +29,7 @@ user = [
 u'inetuser',
 u'posixaccount',
 u'krbprincipalaux',
+u'krbticketpolicyaux',
 u'radiusprofile',
 u'ipaobject',
 ]
diff --git a/tests/test_xmlrpc/test_group_plugin.py b/tests/test_xmlrpc/test_group_plugin.py
index a6d98f6..b794f44 100644
--- a/tests/test_xmlrpc/test_group_plugin.py
+++ b/tests/test_xmlrpc/test_group_plugin.py
@@ -110,6 +110,7 @@ class test_group(Declarative):
 ),
 expected=dict(
 result=dict(
+cn=[group1],
 description=[u'New desc 1'],
 ),
 summary=u'Modified group testgroup1',
@@ -143,8 +144,8 @@ class test_group(Declarative):
 result=dict(
 cn=[group1],
 description=[u'New desc 1'],
-objectclass=objectclasses.group + [u'posixgroup'],
-ipauniqueid=[fuzzy_uuid],
+#objectclass=objectclasses.group + [u'posixgroup'],
+#ipauniqueid=[fuzzy_uuid],
 gidnumber=[fuzzy_digits],
 ),
 value=group1,
@@ -261,6 +262,7 @@ class test_group(Declarative):
 ),
 expected=dict(
 result=dict(
+cn=[group2],
 description=[u'New desc 2'],
 ),
 summary=u'Modified group testgroup2',
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 167481a..4127663 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -73,14 +73,13 @@ class test_host(Declarative):
 summary=u'Added host %s' % fqdn1,
 result=dict(
 dn=dn1,
-cn=[fqdn1],  # FIXME: we should only return fqdn
 fqdn=[fqdn1],
 description=[u'Test host 1'],
-localityname=[u'Undisclosed location 1'],
-krbprincipalname=[u'host/%...@%s' % (fqdn1, api.env.realm)],
-serverhostname=[u'testhost1'],
+#localityname=[u'Undisclosed location 1'],
+#krbprincipalname=[u'host/%...@%s' % (fqdn1, api.env.realm)],
+#serverhostname=[u'testhost1'],
 objectclass=objectclasses.host,
-managedby=[dn1],
+#managedby=[dn1],
 ipauniqueid=[fuzzy_uuid],
 ),
 ),
@@ -109,7 +108,7 @@ class test_host(Declarative):
 dn=dn1,
 fqdn=[fqdn1],
 description=[u'Test host 1'],
-localityname=[u'Undisclosed location 1'],
+#localityname=[u'Undisclosed location 1'],
 ),
 ),
 ),
@@ -130,7 +129,7 @@ class test_host(Declarative):
 # It is intuitive for --all to return additional attributes,
 # but not to return existing attributes under different
 # names.
-l=[u'Undisclosed location 1'],
+