When waiting for windows to boot, also check that the Windows VM
process is up.
self.out.success("started (console on vnc display: %d)." % display)
self.out.output("Waiting for OS to boot ...", False)
self.out.success("started (console on vnc display: %d)." % display)
self.out.output("Waiting for OS to boot ...", False)
- if not self._wait_on_file(monitor, token):
- raise FatalError("Windows booting timed out.")
- else:
- time.sleep(10) # Just to be sure everything is up
- self.out.success('done')
+ self._wait_vm_boot(vm, monitor, token)
+ self.out.success('done')
self.out.output("Disabling automatic logon ...", False)
self._disable_autologon()
self.out.output("Disabling automatic logon ...", False)
self._disable_autologon()
"""Shuts down the windows VM"""
self._guest_exec(r'shutdown /s /t 5')
"""Shuts down the windows VM"""
self._guest_exec(r'shutdown /s /t 5')
- def _wait_on_file(self, fname, msg):
- """Wait until a message appears on a file"""
+ def _wait_vm_boot(self, vm, fname, msg):
+ """Wait until a message appears on a file or the vm process dies"""
for i in range(BOOT_TIMEOUT):
time.sleep(1)
for i in range(BOOT_TIMEOUT):
time.sleep(1)
for line in f:
if line.startswith(msg):
return True
for line in f:
if line.startswith(msg):
return True
+ if not vm.process.alive:
+ raise FatalError("Windows VM died unexpectedly!")
+ raise FatalError("Windows booting timed out!")
def _disable_autologon(self):
"""Disable automatic logon on the windows image"""
def _disable_autologon(self):
"""Disable automatic logon on the windows image"""