wintest Return debug info when dcpromo fails from the log
authorAndrew Bartlett <abartlet@samba.org>
Wed, 2 Feb 2011 00:48:44 +0000 (11:48 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 2 Feb 2011 04:21:13 +0000 (15:21 +1100)
wintest/test-s4-howto.py

index cb9862b8b92bc303a8224a9715035c6a37d4daf0..bb000c1218da45f061b5c1a63694d33f8c8e67b7 100755 (executable)
@@ -166,6 +166,11 @@ SafeModeAdminPassword=${PASSWORD1}
     child.sendline("dcpromo /answer:answers.txt")
     i = child.expect(["You must restart this computer", "failed", "Active Directory Domain Services was not installed", "C:"], timeout=120)
     if i == 1 or i == 2:
+        child.sendline("echo off")
+        child.sendline("echo START DCPROMO log")
+        child.sendline("more c:\windows\debug\dcpromoui.log")
+        child.sendline("echo END DCPROMO log")
+        child.expect("END DCPROMO")
         raise Exception("dcpromo failed")
     t.wait_reboot()
 
@@ -317,8 +322,13 @@ RebootOnCompletion=No
 ''')
     child.expect("copied.")
     child.sendline("dcpromo /answer:answers.txt")
-    i = child.expect(["You must restart this computer", "failed"], timeout=120)
+    i = child.expect(["You must restart this computer", "failed", "could not be located in this domain"], timeout=120)
     if i != 0:
+        child.sendline("echo off")
+        child.sendline("echo START DCPROMO log")
+        child.sendline("more c:\windows\debug\dcpromoui.log")
+        child.sendline("echo END DCPROMO log")
+        child.expect("END DCPROMO")
         raise Exception("dcpromo failed")
     child.sendline("shutdown -r -t 0")
     t.wait_reboot()