summaryrefslogtreecommitdiff
path: root/wintest/wintest.py
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-12-09 22:05:14 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-12-09 13:33:00 +0100
commit377b3995b168779d994138848f0ebc6059bba31c (patch)
treec7651714585563574543238861d68e06aada10d7 /wintest/wintest.py
parent57f2f1d72a70a80e61a2ed6f1abc63a177a590ab (diff)
downloadsamba-377b3995b168779d994138848f0ebc6059bba31c.tar.gz
samba-377b3995b168779d994138848f0ebc6059bba31c.tar.bz2
samba-377b3995b168779d994138848f0ebc6059bba31c.zip
wintest Remove the password expiry as the first step
This is particularly important before dcpromo, as the password will otherwise be expired in the new domain. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Thu Dec 9 13:33:00 CET 2010 on sn-devel-104
Diffstat (limited to 'wintest/wintest.py')
-rw-r--r--wintest/wintest.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/wintest/wintest.py b/wintest/wintest.py
index ec2624bde5..0d65116562 100644
--- a/wintest/wintest.py
+++ b/wintest/wintest.py
@@ -371,6 +371,12 @@ class wintest():
if hostname.upper() == self.getvar("WIN_HOSTNAME").upper():
return True
+ def set_noexpire(self, child, username):
+ '''Ensure this user's password does not expire'''
+ child.sendline('wmic useraccount where name="%s" set PasswordExpires=FALSE' % username)
+ child.expect("update successful")
+ child.expect("C:")
+
def run_tlntadmn(self, child):
'''remove the annoying telnet restrictions'''
child.sendline('tlntadmn config maxconn=1024')
@@ -438,7 +444,7 @@ class wintest():
def open_telnet(self, hostname, username, password, retries=60, delay=5, set_time=False, set_ip=False,
- disable_firewall=True, run_tlntadmn=True):
+ disable_firewall=True, run_tlntadmn=True, set_noexpire=False):
'''open a telnet connection to a windows server, return the pexpect child'''
set_route = False
set_dns = False
@@ -491,6 +497,9 @@ class wintest():
if run_tlntadmn:
self.run_tlntadmn(child)
run_tlntadmn = False
+ if set_noexpire:
+ self.set_noexpire(child, username)
+ set_noexpire = False
if disable_firewall:
self.disable_firewall(child)
disable_firewall = False