the patch changes the check on the Tracker.dn setter, allowing to use
an instance of ipatests.util.Fuzzy to ease writing Trackers for plugins
like CA ACL, which use ipaUniqueID as their primary key.

>From 0d586dffbb424f8292faa90ea92021b075b34926 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Milan=20Kub=C3=ADk?= <mku...@redhat.com>
Date: Mon, 27 Jul 2015 11:08:46 +0200
Subject: [PATCH] tests: Allow Tracker.dn be an instance of Fuzzy

Some of the IPA LDAP entries are using ipaUniqueID as
the "primary key". To match this UUID based attribute
in assert_deepequal, an instance of Fuzzy class must
be used. This change adds the possibility to assign
the Fuzzy object as the DN for the tracked entry.

The user may need to override the rdn and name
properties for the class using the Fuzzy DN.
 ipatests/test_xmlrpc/ldaptracker.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_xmlrpc/ldaptracker.py b/ipatests/test_xmlrpc/ldaptracker.py
index d9763e116d43daa16fa21cc808968bb8d8b1dcc3..9cc44f8a6ba688a1b76c385498b0893d434ae60f 100644
--- a/ipatests/test_xmlrpc/ldaptracker.py
+++ b/ipatests/test_xmlrpc/ldaptracker.py
@@ -11,6 +11,7 @@ import functools
 from ipalib import api, errors
 from ipapython.dn import DN
 from ipapython.version import API_VERSION
+from ipatests.util import Fuzzy
 class Tracker(object):
@@ -88,8 +89,8 @@ class Tracker(object):
     def dn(self, value):
-        if not isinstance(value, DN):
-            raise ValueError('The value must be an instance of DN.')
+        if not (isinstance(value, DN) or isinstance(value, Fuzzy)):
+            raise ValueError('The value must be an instance of DN or Fuzzy.')
         self._dn = value

Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to