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

gpo: Add gpo tests

Lays down a sysvol gpttmpl.inf with password policies, then runs the samba_gpoupdate command. Verifies policies are applied to the samdb.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
David Mulder
2017-03-03 12:54:30 -07:00
committed by Garming Sam
parent 05235a56e3
commit e750e4a35f
7 changed files with 236 additions and 2 deletions

View File

@ -170,7 +170,7 @@ class gp_sec_ext(gp_ext):
ret = False
inftable = self.populate_inf()
policy = conn.loadfile(path.replace('/', '\\')).decode('utf-16')
policy = conn.loadfile(path.replace('/', '\\'))
current_section = None
# So here we would declare a boolean,
@ -181,7 +181,10 @@ class gp_sec_ext(gp_ext):
inf_conf = ConfigParser()
inf_conf.optionxform=str
inf_conf.readfp(StringIO(policy))
try:
inf_conf.readfp(StringIO(policy))
except:
inf_conf.readfp(StringIO(policy.decode('utf-16')))
for section in inf_conf.sections():
current_section = inftable.get(section)