Skip to content

Commit

Permalink
wintest: Try harder to recover from apparent failure to dcpromo
Browse files Browse the repository at this point in the history
Reviewed-by: Jelmer Vernooij <[email protected]>
Signed-off-by: Andrew Bartlett <[email protected]>
  • Loading branch information
abartlet committed Nov 5, 2012
1 parent 0b7bb77 commit abbbbb5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion wintest/wintest.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,12 +852,23 @@ def run_dcpromo_as_first_dc(self, vm, func_level=None):
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 )


Expand Down

0 comments on commit abbbbb5

Please sign in to comment.