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

Tomas Babej tbabej at redhat.com
Tue Jun 11 11:15:51 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-tbabej-0071-Return-ipaRangeType-as-a-list-in-idrange-commands.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130611/8322b83b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-tbabej-0070-3-Remove-hardcoded-values-from-idrange-plugin-tests.patch
Type: text/x-patch
Size: 6363 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130611/8322b83b/attachment-0001.bin>


More information about the Freeipa-devel mailing list