t.setwinvars(vm)
t.info("Configuring a windows VM ${WIN_VM} at the first DC in the domain using dcpromo")
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_time=True)
- child.sendline("dcdiag");
if t.get_is_dc(child):
return
t.setvar("FUNCTION_LEVEL_INT", str(0))
child = t.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}", set_ip=True)
- child.sendline("dcdiag");
"""This server must therefore not yet be a directory server, so we must promote it"""
child.sendline("copy /Y con answers.txt")
child.expect("C:")
def get_is_dc(self, child):
+ '''check if a windows machine is a domain controller'''
child.sendline("dcdiag")
- i = child.expect(["is not a Directory Server", "is not recognized as an internal or external command", "Home Server = "])
+ i = child.expect(["is not a Directory Server",
+ "is not recognized as an internal or external command",
+ "Home Server = ",
+ "passed test Replications"])
if i == 0:
return False
- if i == 1:
+ if i == 1 or i == 3:
child.expect("C:")
child.sendline("net config Workstation")
child.expect("Workstation domain")