diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-27 12:32:22 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-27 15:17:18 +0100 |
commit | e9f019e28c267b35c1f5e5a232751c2ca920e1e5 (patch) | |
tree | bd498afd8c8969aa1bd85e386e0b76ab307be365 /source4/dsdb/tests/python/ldap_syntaxes.py | |
parent | 7545b5b3db77d3696fb725b1655b82c164647289 (diff) | |
download | samba-e9f019e28c267b35c1f5e5a232751c2ca920e1e5.tar.gz samba-e9f019e28c267b35c1f5e5a232751c2ca920e1e5.tar.bz2 samba-e9f019e28c267b35c1f5e5a232751c2ca920e1e5.zip |
s4:dsdb tests - make use of "ldb.get_domain_sid()"
Diffstat (limited to 'source4/dsdb/tests/python/ldap_syntaxes.py')
-rw-r--r-- | source4/dsdb/tests/python/ldap_syntaxes.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source4/dsdb/tests/python/ldap_syntaxes.py b/source4/dsdb/tests/python/ldap_syntaxes.py index f1f30c738d..54198d7fc4 100644 --- a/source4/dsdb/tests/python/ldap_syntaxes.py +++ b/source4/dsdb/tests/python/ldap_syntaxes.py @@ -51,10 +51,6 @@ creds = credopts.get_credentials(lp) class SyntaxTests(unittest.TestCase): - def _find_domain_sid(self): - res = self.ldb.search(base=self.base_dn, expression="(objectClass=*)", scope=SCOPE_BASE) - return ndr_unpack( security.dom_sid,res[0]["objectSid"][0]) - def setUp(self): super(SyntaxTests, self).setUp() self.ldb = ldb @@ -62,7 +58,6 @@ class SyntaxTests(unittest.TestCase): self.schema_dn = ldb.get_schema_basedn().get_linearized() self._setup_dn_string_test() self._setup_dn_binary_test() - self.domain_sid = self._find_domain_sid() def _setup_dn_string_test(self): """Testing DN+String syntax""" @@ -279,7 +274,7 @@ name: """ + object_name + """ # add object with SID instead of DN object_name4 = "obj-DN-String4" + time.strftime("%s", time.gmtime()) ldif = self._get_object_ldif(object_name4, self.dn_string_class_name, self.dn_string_class_ldap_display_name, - self.dn_string_attribute, ": S:5:ABCDE:<SID=%s>" % self.domain_sid) + self.dn_string_attribute, ": S:5:ABCDE:<SID=%s>" % self.ldb.get_domain_sid()) try: self.ldb.add_ldif(ldif) except LdbError, (num, _): @@ -365,7 +360,7 @@ name: """ + object_name + """ # add object with SID instead of DN object_name4 = "obj-DN-Binary4" + time.strftime("%s", time.gmtime()) ldif = self._get_object_ldif(object_name4, self.dn_binary_class_name, self.dn_binary_class_ldap_display_name, - self.dn_binary_attribute, ": B:4:1234:<SID=%s>" % self.domain_sid) + self.dn_binary_attribute, ": B:4:1234:<SID=%s>" % self.ldb.get_domain_sid()) try: self.ldb.add_ldif(ldif) except LdbError, (num, _): |