diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-11-27 14:20:47 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-11-27 16:05:06 +1100 |
commit | d5387edb88ce29ad1a6f864415c19486a20269af (patch) | |
tree | 2b1914186b98b184530b600a193a8d7c580b6fad /source4/lib/ldb/tests | |
parent | 7ea485a1d20c1bf41926ebb4b0ae8f37a2d909f7 (diff) | |
download | samba-d5387edb88ce29ad1a6f864415c19486a20269af.tar.gz samba-d5387edb88ce29ad1a6f864415c19486a20269af.tar.bz2 samba-d5387edb88ce29ad1a6f864415c19486a20269af.zip |
s4-ldb: improve detection of whether the server has a GC port
We were trying to open $SERVER:3268 regardless, which could result in
creating a file called "localdc1:3268", which led to subsequent test
failures
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-x | source4/lib/ldb/tests/python/ldap.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index a5a9d7cda6..408246b45c 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -1366,10 +1366,11 @@ member: cn=ldaptestuser2,cn=users,""" + self.base_dn + """ print "Testing ldb.search for (&(cn=ldaptestuser)(objectCategory=PerSon)) in with 'phantom root' control" - res3control = gc_ldb.search(self.base_dn, expression="(&(cn=ldaptestuser)(objectCategory=PerSon))", scope=SCOPE_SUBTREE, attrs=["cn"], controls=["search_options:1:2"]) - self.assertEquals(len(res3control), 1, "Could not find (&(cn=ldaptestuser)(objectCategory=PerSon)) in Global Catalog") + if gc_ldb is not None: + res3control = gc_ldb.search(self.base_dn, expression="(&(cn=ldaptestuser)(objectCategory=PerSon))", scope=SCOPE_SUBTREE, attrs=["cn"], controls=["search_options:1:2"]) + self.assertEquals(len(res3control), 1, "Could not find (&(cn=ldaptestuser)(objectCategory=PerSon)) in Global Catalog") - self.assertEquals(res[0].dn, res3control[0].dn) + self.assertEquals(res[0].dn, res3control[0].dn) ldb.delete(res[0].dn) @@ -2038,8 +2039,11 @@ if not "://" in host: host = "ldap://%s" % host ldb = Ldb(host, credentials=creds, session_info=system_session(), lp=lp) -gc_ldb = Ldb("%s:3268" % host, credentials=creds, - session_info=system_session(), lp=lp) +if not "tdb://" in host: + gc_ldb = Ldb("%s:3268" % host, credentials=creds, + session_info=system_session(), lp=lp) +else: + gc_ldb = None runner = SubunitTestRunner() rc = 0 |