1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-04 08:23:50 +03:00

r26536: More tests for provisioning code.

This commit is contained in:
Jelmer Vernooij
2007-12-19 23:27:31 +01:00
committed by Stefan Metzmacher
parent 40bf88c8a7
commit 43c8bfeedf
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)