Sometimes, the VM might segfault in the middle of the unattended install test. If that happens today, the unattended install will keep waiting until the timeout is reached. So check if the VM is alive during the main unattended install loop.
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- client/tests/kvm/scripts/unattended.py | 6 ++++-- client/tests/kvm/tests/unattended_install.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/scripts/unattended.py b/client/tests/kvm/scripts/unattended.py index 0377d83..d9b8912 100755 --- a/client/tests/kvm/scripts/unattended.py +++ b/client/tests/kvm/scripts/unattended.py @@ -129,7 +129,7 @@ class UnattendedInstall(object): else: print ("WARNING: 'cdkey' required but not specified for " "this unattended installation") - + dummy_re = r'\bKVM_TEST_MEDIUM\b' if self.medium == "cdrom": content = "cdrom" @@ -139,9 +139,11 @@ class UnattendedInstall(object): content = "nfs --server=%s --dir=%s" % (self.nfs_server, self.nfs_dir) else: raise SetupError("Unexpected installation medium %s" % self.url) - + unattended_contents = re.sub(dummy_re, content, unattended_contents) + print + print "Unattended install %s contents:" % dest_fname print unattended_contents # Write the unattended file contents to 'dest' open(dest, 'w').write(unattended_contents) diff --git a/client/tests/kvm/tests/unattended_install.py b/client/tests/kvm/tests/unattended_install.py index 8928575..471ab56 100644 --- a/client/tests/kvm/tests/unattended_install.py +++ b/client/tests/kvm/tests/unattended_install.py @@ -29,6 +29,8 @@ def run_unattended_install(test, params, env): start_time = time.time() time_elapsed = 0 while time_elapsed < install_timeout: + if not vm.is_alive(): + raise error.TestError("Guest died before end of OS install") client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) addr = vm.get_address() if addr is not None: -- 1.7.0.1 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
