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

Alexander Bokovoy abokovoy at redhat.com
Tue Jun 11 10:59:18 UTC 2013


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.
-- 
/ Alexander Bokovoy




More information about the Freeipa-devel mailing list