s4-samba3samtest: use system credentials for creating users
[ira/wip.git] / source4 / dsdb / samdb / ldb_modules / tests / samba3sam.py
index 2478043eb46126bcfc5dc10445277ba8d8017cd4..a46afb1a72c1fc7205f9206a4ec1bd0a75f9ce56 100644 (file)
@@ -29,6 +29,7 @@ from samba import Ldb, substitute_var
 from samba.tests import LdbTestCase, TestCaseInTempDir, cmdline_loadparm
 import samba.dcerpc.security
 import samba.ndr
+from samba.auth import system_session
 
 datadir = os.path.join(os.path.dirname(__file__), 
                        "../../../../../testdata/samba3")
@@ -75,7 +76,7 @@ class MapBaseTestCase(TestCaseInTempDir):
             """Simple helper class that contains data for a specific SAM 
             connection."""
             def __init__(self, basedn, dn):
-                self.db = Ldb(lp=cmdline_loadparm)
+                self.db = Ldb(lp=cmdline_loadparm, session_info=system_session())
                 self.basedn = basedn
                 self.basedn_casefold = ldb.Dn(self.db, basedn).get_casefold()
                 self.substvars = {"BASEDN": self.basedn}
@@ -124,13 +125,13 @@ class Samba3SamTestCase(MapBaseTestCase):
 
     def setUp(self):
         super(Samba3SamTestCase, self).setUp()
-        ldb = Ldb(self.ldburl, lp=cmdline_loadparm)
+        ldb = Ldb(self.ldburl, lp=cmdline_loadparm, session_info=system_session())
         self.samba3.setup_data("samba3.ldif")
         ldif = read_datafile("provision_samba3sam.ldif")
         ldb.add_ldif(self.samba4.subst(ldif))
         self.setup_modules(ldb, self.samba3, self.samba4)
         del ldb
-        self.ldb = Ldb(self.ldburl, lp=cmdline_loadparm)
+        self.ldb = Ldb(self.ldburl, lp=cmdline_loadparm, session_info=system_session())
 
     def test_search_non_mapped(self):
         """Looking up by non-mapped attribute"""
@@ -291,12 +292,12 @@ class MapTestCase(MapBaseTestCase):
 
     def setUp(self):
         super(MapTestCase, self).setUp()
-        ldb = Ldb(self.ldburl, lp=cmdline_loadparm)
+        ldb = Ldb(self.ldburl, lp=cmdline_loadparm, session_info=system_session())
         ldif = read_datafile("provision_samba3sam.ldif")
         ldb.add_ldif(self.samba4.subst(ldif))
         self.setup_modules(ldb, self.samba3, self.samba4)
         del ldb
-        self.ldb = Ldb(self.ldburl, lp=cmdline_loadparm)
+        self.ldb = Ldb(self.ldburl, lp=cmdline_loadparm, session_info=system_session())
 
     def test_map_search(self):
         """Running search tests on mapped data."""