[Freeipa-devel] [PATCH] Fix a bunch of unit tests.
Pavel Zuna
pzuna at redhat.com
Mon Nov 16 16:59:51 UTC 2009
Rob Crittenden wrote:
> Pavel Zuna wrote:
>> Only pwpolicy test is still broken - I'm looking into it.
>>
>> Pavel
>
> This brings up the return values question again. I thought we had
> decided that any attribute that had only one value would be returned as
> a scalar. In this case userCertificate is being returned as a list which
> is causing things to fail. Now arguably userCertificate is a
> multi-valued attribute but we will only store one certificate at a time
> there so I think we're ok.
Yeah, I remember, but I'm not sure if we agreed on the logic.
There are 2 ways of doing this:
1) Make ldap backend check the schema. If it's multi-value - leave it as a list.
If it's single-value - convert it to a scalar.
2) Make ldap backend check if the attribute contains 1 or more values. If
there's only one, convert it to a scalar.
With 1) plugin authors can depend on the schema when manipulating attributes,
but they have to know the schema and handle multi/single attributes differently.
With 2) plugin authors have to always check, if the attribute is a list or a scalar.
I think that having attributes always returned as list makes things easier on
plugin authors - no checks required, everything is handled the same way. What's
the advantage of returning attribute values as 2 different types?
>
> Also, why the change to the principal name in the service tests?
At first I didn't know where the problem in this test was. So, I tried a few
different things and this is a leftover. Doesn't hurt anything, but I can always
change it back.
> rob
Pavel
More information about the Freeipa-devel
mailing list