summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando J V da Silva <fernandojvsilva@yahoo.com.br>2009-11-27 12:25:18 -0200
committerAndrew Tridgell <tridge@samba.org>2009-11-30 21:17:28 +1100
commit7399c04fd0b509079117426b28853a0aa3f87d2d (patch)
tree1fb4e2e4f93c25ee186218a1acc4281ee73e2c26
parent71e29cbf56048791057ccf07b859654312f3882e (diff)
downloadsamba-7399c04fd0b509079117426b28853a0aa3f87d2d.tar.gz
samba-7399c04fd0b509079117426b28853a0aa3f87d2d.tar.bz2
samba-7399c04fd0b509079117426b28853a0aa3f87d2d.zip
s4-drs: Test situations for runtime constructed parentGUID
Includes the following verifications for the constructed parentGUID: - Checks if it returns nothing when there is no parent object - Ensures that attributes mentioned after the parentGUID are returned correctly (this avoid a bug pointed out by Tridge during sync constructed parentGUID development) Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rwxr-xr-xsource4/lib/ldb/tests/python/ldap.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py
index 408246b45c..0292422741 100755
--- a/source4/lib/ldb/tests/python/ldap.py
+++ b/source4/lib/ldb/tests/python/ldap.py
@@ -566,11 +566,34 @@ objectClass: container
"objectclass":"user",
"samaccountname":"parentguidtest"});
res1 = ldb.search(base="cn=parentguidtest,cn=users," + self.base_dn, scope=SCOPE_BASE,
- attrs=["parentGUID"]);
+ attrs=["parentGUID", "samaccountname"]);
res2 = ldb.search(base="cn=users," + self.base_dn,scope=SCOPE_BASE,
attrs=["objectGUID"]);
+ res3 = ldb.search(base=self.base_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"""
+ has_parentGUID = False
+ for key in res3[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
+ for key in res1[0].keys():
+ if key == "sAMAccountName":
+ has_another_attribute = True
+ break
+ self.assertTrue(has_another_attribute)
+ self.assertTrue(len(res1[0]["samaccountname"]) == 1)
+ self.assertEquals(res1[0]["samaccountname"][0], "parentguidtest");
+
print "Testing parentGUID behaviour on rename\n"
self.ldb.add({