1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +03:00

r26536: More tests for provisioning code.

(This used to be commit 43c8bfeedf)
This commit is contained in:
Jelmer Vernooij
2007-12-19 23:27:31 +01:00
committed by Stefan Metzmacher
parent 595ec370da
commit 86f91db7d5
6 changed files with 40 additions and 24 deletions

View File

@ -14,7 +14,10 @@ import pwd
import uuid
def regkey_to_dn(name):
"""Convert a registry key to a DN."""
"""Convert a registry key to a DN.
:name: The registry key name.
:return: A matching DN."""
dn = "hive=NONE"
if name == "":
@ -253,8 +256,6 @@ maxVersion: %llu
return ldif
def upgrade_provision(lp, samba3):
subobj = Object()
domainname = samba3.configuration.get("workgroup")
if domainname is None:
@ -272,13 +273,7 @@ def upgrade_provision(lp, samba3):
subobj.realm = realm
subobj.domain = domainname
subobj.hostname = hostname()
assert subobj.realm is not None
assert subobj.domain is not None
assert subobj.hostname is not None
subobj.HOSTIP = hostip()
if domsec is not None:
subobj.DOMAINGUID = domsec.guid
subobj.DOMAINSID = domsec.sid
@ -288,10 +283,7 @@ def upgrade_provision(lp, samba3):
subobj.DOMAINSID = randsid()
if hostsec:
subobj.HOSTGUID = hostsec.guid
else:
subobj.HOSTGUID = uuid.random()
subobj.invocationid = uuid.random()
hostguid = hostsec.guid
subobj.krbtgtpass = randpass(12)
subobj.machinepass = randpass(12)
subobj.adminpass = randpass(12)