summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-11-05 19:35:51 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-11-06 08:27:44 +1100
commitabbbbb5cdc39b71c0f243ff1e660d1f35a4923e3 (patch)
treee117bc5182fb3ea903872ae8efe94fc5bab021cc
parent0b7bb774ce836722d219d6e466a76b12c1a03de3 (diff)
downloadsamba-abbbbb5cdc39b71c0f243ff1e660d1f35a4923e3.tar.gz
samba-abbbbb5cdc39b71c0f243ff1e660d1f35a4923e3.tar.bz2
samba-abbbbb5cdc39b71c0f243ff1e660d1f35a4923e3.zip
wintest: Try harder to recover from apparent failure to dcpromo
Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--wintest/wintest.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/wintest/wintest.py b/wintest/wintest.py
index c0f1eebebf..61664ae87d 100644
--- a/wintest/wintest.py
+++ b/wintest/wintest.py
@@ -852,12 +852,23 @@ RebootOnCompletion=No
child.expect("C:")
child.expect("C:")
child.sendline("dcpromo /answer:answers.txt")
- i = child.expect(["You must restart this computer", "failed", "Active Directory Domain Services was not installed", "C:"], timeout=240)
+ i = child.expect(["You must restart this computer", "failed", "Active Directory Domain Services was not installed", "C:", pexpect.TIMEOUT], timeout=240)
if i == 1 or i == 2:
raise Exception("dcpromo failed")
+ if i == 4: # timeout
+ child = self.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}")
+
child.sendline("shutdown -r -t 0")
self.port_wait("${WIN_IP}", 139, wait_for_fail=True)
self.port_wait("${WIN_IP}", 139)
+
+ child = self.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}")
+ # Check if we became a DC by now
+ if not self.get_is_dc(child):
+ raise Exception("dcpromo failed (and wasn't a DC even after rebooting)")
+ # Give DNS registration a kick
+ child.sendline("ipconfig /registerdns")
+
self.retry_cmd("host -t SRV _ldap._tcp.${WIN_REALM} ${WIN_IP}", ['has SRV record'], retries=60, delay=5 )