[Freeipa-devel] [PATCH 0070] Remove hardcoded values from idrange plugin tests

Tomas Babej tbabej at redhat.com
Wed Jun 19 13:13:03 UTC 2013


On 06/19/2013 02:36 PM, Alexander Bokovoy wrote:
> On Wed, 19 Jun 2013, Tomas Babej wrote:
>> On 06/11/2013 01:15 PM, Tomas Babej wrote:
>>> On 06/11/2013 12:59 PM, Alexander Bokovoy wrote:
>>>> On Tue, 11 Jun 2013, Tomas Babej wrote:
>>>>> On 06/10/2013 01:13 PM, Tomas Babej wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Hardcoded values for range parameters such as base RID or range
>>>>>> size could be the reason the tests produced incorrect results,
>>>>>> as the ranges could get in conflict with already existing ranges
>>>>>> on the server.
>>>>>>
>>>>>> Patch dynamically chooses ID and RID range space at the end of
>>>>>> all ranges already present on the server.
>>>>>>
>>>>>> https://fedorahosted.org/freeipa/ticket/3662
>>>>>>
>>>>>> Tomas
>>>>>
>>>>> Patch altered to incorporate minor fixes for recent idrange 
>>>>> objectclass changes.
>>>>>
>>>>> Tomas
>>>>
>>>>> From b35b10f1356c9714776f16aadec7ffbe95e2f41e Mon Sep 17 00:00:00 
>>>>> 2001
>>>>> From: Tomas Babej <tbabej at redhat.com>
>>>>> Date: Mon, 10 Jun 2013 13:08:50 +0200
>>>>> Subject: [PATCH] Remove hardcoded values from idrange plugin tests
>>>>>
>>>>> Hardcoded values for range parameters such as base RID or range
>>>>> size could be the reason the tests produced incorrect results,
>>>>> as the ranges could get in conflict with already existing ranges
>>>>> on the server.
>>>>>
>>>>> Patch dynamically chooses ID and RID range space at the end of
>>>>> all ranges already present on the server.
>>>>>
>>>>> https://fedorahosted.org/freeipa/ticket/3662
>>>>> ---
>>>>> ipalib/plugins/idrange.py              |  2 +-
>>>>> tests/test_xmlrpc/test_range_plugin.py | 90 
>>>>> ++++++++++++++++++++++------------
>>>>> 2 files changed, 60 insertions(+), 32 deletions(-)
>>>>>
>>>>> diff --git a/ipalib/plugins/idrange.py b/ipalib/plugins/idrange.py
>>>>> index 
>>>>> abca492978d04c71b78a89df8e5c2d1d51c06398..54b835e244fb60ee212a9c00223d4294ff8f4363 
>>>>> 100644
>>>>> --- a/ipalib/plugins/idrange.py
>>>>> +++ b/ipalib/plugins/idrange.py
>>>>> @@ -224,7 +224,7 @@ class idrange(LDAPObject):
>>>>>         if not any((options.get('pkey_only', False),
>>>>>                     options.get('raw', False))):
>>>>>             range_type = entry_attrs['iparangetype'][0]
>>>>> -            entry_attrs['iparangetype'] = 
>>>>> self.range_types.get(range_type, None)
>>>>> +            entry_attrs['iparangetype'] = 
>>>>> [self.range_types.get(range_type, None)]
>>>>>
>>>>>         # Remove the objectclass
>>>>>         if not keep_objectclass:
>>>> Could you please extract this change into an independent patch? I'm
>>>> thinking purely from possible backporting perspective.
>>>>
>>>> Otherwise looks good.
>>>
>>> Sure. Patches 0070 and 0071 attached.
>>>
>>> I'll link 0071 to the ticket for extending ID range types once it's 
>>> pushed, for record's sake.
>>>
>>> Tomas
>>>
>> Patches needed rebase.
> The tests now pass on a machine with existing trusts.
>
> However, I'm getting following errors in dirsrv's error log:
>
> [19/Jun/2013:15:34:58 +0300] find_sid_for_ldap_entry - [file 
> ipa_sidgen_common.c, line 522]: Cannot convert Posix ID [1447902850]
> into an unused SID.
> [19/Jun/2013:15:34:58 +0300] ipa_sidgen_add_post_op - [file 
> ipa_sidgen.c, line 149]: Cannot add SID to new entry.
> [19/Jun/2013:15:34:59 +0300] find_sid_for_ldap_entry - [file 
> ipa_sidgen_common.c, line 522]: Cannot convert Posix ID [1447902950]
> into an unused SID.
> [19/Jun/2013:15:34:59 +0300] ipa_sidgen_add_post_op - [file 
> ipa_sidgen.c, line 149]: Cannot add SID to new entry.
> [19/Jun/2013:15:35:01 +0300] ipa_range_check_pre_op - [file 
> ipa_range_check.c, line 417]: New primary rid range overlaps with
> existing primary rid range.
> [19/Jun/2013:15:35:01 +0300] ipa_range_check_pre_op - [file 
> ipa_range_check.c, line 417]: New secondary rid range overlaps with
> existing secondary rid range.
> [19/Jun/2013:15:35:01 +0300] ipa_range_check_pre_op - [file 
> ipa_range_check.c, line 417]: New primary rid range overlaps with
> existing secondary rid range.
> [19/Jun/2013:15:35:01 +0300] ipa_range_check_pre_op - [file 
> ipa_range_check.c, line 417]: New base range overlaps with existing base
> range.
>
> I think we still need to improve RID part of calculating the test range..
>

Aren't those logs that were produced by negative tests?

Overlaps are handled by DS plugin, and only then the errors are 
propagated back to the IPA framework.

Tomas




More information about the Freeipa-devel mailing list