summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python/ldap.py
diff options
context:
space:
mode:
authorNadezhda Ivanova <nivanova@samba.org>2010-09-21 09:10:54 -0700
committerNadezhda Ivanova <nivanova@samba.org>2010-09-21 09:10:54 -0700
commitaa57fd8224a09f26a0f6127024fe739b84eadf49 (patch)
treee7d0488a84018261c6a7abe2defe1955a72c85f5 /source4/dsdb/tests/python/ldap.py
parent24cac1366644279be55dfce6e286f19da605e78e (diff)
downloadsamba-aa57fd8224a09f26a0f6127024fe739b84eadf49.tar.gz
samba-aa57fd8224a09f26a0f6127024fe739b84eadf49.tar.bz2
samba-aa57fd8224a09f26a0f6127024fe739b84eadf49.zip
s4-ldap: Fixed a problem with NC's having a parentGUID attribute
NC's other than default NC had a parentGUID, due to an incorrect check of whether the object has a parent. Fixed by checking object's instanceType instead.
Diffstat (limited to 'source4/dsdb/tests/python/ldap.py')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index e108e38135..1bdf6f13a1 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -1038,11 +1038,15 @@ objectClass: container
attrs=["objectGUID"]);
res3 = ldb.search(base=self.base_dn, scope=SCOPE_BASE,
attrs=["parentGUID"]);
+ res4 = ldb.search(base=self.configuration_dn, scope=SCOPE_BASE,
+ attrs=["parentGUID"]);
+ res5 = ldb.search(base=self.schema_dn, scope=SCOPE_BASE,
+ attrs=["parentGUID"]);
"""Check if the parentGUID is valid """
self.assertEquals(res1[0]["parentGUID"], res2[0]["objectGUID"]);
- """Check if it returns nothing when there is no parent object"""
+ """Check if it returns nothing when there is no parent object - default NC"""
has_parentGUID = False
for key in res3[0].keys():
if key == "parentGUID":
@@ -1050,6 +1054,22 @@ objectClass: container
break
self.assertFalse(has_parentGUID);
+ """Check if it returns nothing when there is no parent object - configuration NC"""
+ has_parentGUID = False
+ for key in res4[0].keys():
+ if key == "parentGUID":
+ has_parentGUID = True
+ break
+ self.assertFalse(has_parentGUID);
+
+ """Check if it returns nothing when there is no parent object - schema NC"""
+ has_parentGUID = False
+ for key in res5[0].keys():
+ if key == "parentGUID":
+ has_parentGUID = True
+ break
+ self.assertFalse(has_parentGUID);
+
"""Ensures that if you look for another object attribute after the constructed
parentGUID, it will return correctly"""
has_another_attribute = False