<s> """<STR_LIT>""" <EOL> import logging <EOL> import os <EOL> import uuid <EOL> from samba . auth import system_session <EOL> from samba . provision import ( setup_samdb , guess_names , make_smbconf , <EOL> provision_paths_from_lp ) <EOL> from samba . provision import DEFAULT_POLICY_GUID , DEFAULT_DC_POLICY_GUID <EOL> from samba . provision . backend import ProvisionBackend <EOL> from samba . tests import TestCaseInTempDir <EOL> from samba . dcerpc import security <EOL> from samba . schema import Schema <EOL> from samba import param <EOL> class SamDBTestCase ( TestCaseInTempDir ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> super ( SamDBTestCase , self ) . setUp ( ) <EOL> invocationid = str ( uuid . uuid4 ( ) ) <EOL> domaindn = "<STR_LIT>" <EOL> self . domaindn = domaindn <EOL> configdn = "<STR_LIT>" + domaindn <EOL> schemadn = "<STR_LIT>" + configdn <EOL> domainguid = str ( uuid . uuid4 ( ) ) <EOL> policyguid = DEFAULT_POLICY_GUID <EOL> domainsid = security . random_sid ( ) <EOL> path = os . path . join ( self . tempdir , "<STR_LIT>" ) <EOL> session_info = system_session ( ) <EOL> hostname = "<STR_LIT:foo>" <EOL> domain = "<STR_LIT>" <EOL> dnsdomain = "<STR_LIT>" <EOL> serverrole = "<STR_LIT>" <EOL> policyguid_dc = DEFAULT_DC_POLICY_GUID <EOL> smbconf = os . path . join ( self . tempdir , "<STR_LIT>" ) <EOL> make_smbconf ( smbconf , hostname , domain , dnsdomain , <EOL> self . tempdir , serverrole = serverrole ) <EOL> self . lp = param . LoadParm ( ) <EOL> self . lp . load ( smbconf ) <EOL> names = guess_names ( lp = self . lp , hostname = hostname , <EOL> domain = domain , dnsdomain = dnsdomain , <EOL> serverrole = serverrole , <EOL> domaindn = self . domaindn , configdn = configdn , <EOL> schemadn = schemadn ) <EOL> paths = provision_paths_from_lp ( self . lp , names . dnsdomain ) <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> provision_backend = ProvisionBackend ( "<STR_LIT>" , paths = paths , <EOL> lp = self . lp , credentials = None , <EOL> names = names , logger = logger ) <EOL> schema = Schema ( domainsid , invocationid = invocationid , <EOL> schemadn = names . schemadn , serverdn = names . serverdn , <EOL> am_rodc = False ) <EOL> self . samdb = setup_samdb ( path , session_info , <EOL> provision_backend , self . lp , names , logger , <EOL> domainsid , domainguid , policyguid , policyguid_dc , False , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , invocationid , "<STR_LIT>" , <EOL> None , "<STR_LIT>" , schema = schema ) <EOL> def tearDown ( self ) : <EOL> for f in [ '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> os . remove ( os . path . join ( self . tempdir , f ) ) <EOL> super ( SamDBTestCase , self ) . tearDown ( ) </s>
