Chromium Code Reviews| Index: client/common_lib/test.py |
| diff --git a/client/common_lib/test.py b/client/common_lib/test.py |
| index 766766b4902e181f2dcca5dbffe51f7071263ba9..72e155877bb1ff0998d070fc1080746d910f46db 100644 |
| --- a/client/common_lib/test.py |
| +++ b/client/common_lib/test.py |
| @@ -19,6 +19,7 @@ |
| import fcntl, getpass, os, re, sys, shutil, tarfile, tempfile, time, traceback |
| import warnings, logging, glob, resource |
| +from datetime import datetime |
| from autotest_lib.client.common_lib import error |
| from autotest_lib.client.bin import utils |
| @@ -418,6 +419,13 @@ class base_test(object): |
| except: |
| pass # don't let logging exceptions here interfere |
| + # Save the VM state immediately after the test failure. |
| + # This is a NOOP if the the test isn't running in a VM or |
| + # if the VM is not properly configured to save state. |
| + now = datetime.now().strftime('%I:%M:%S.%f') |
| + checkpoint_name = "%s-%s" % (self.tagged_testname, now) |
|
sosa
2010/11/24 01:02:54
Don't mix "" and ''
sosa
2010/11/24 01:02:54
It may be more useful to get something about the m
thieule
2010/11/24 18:00:45
Done.
thieule
2010/11/24 18:00:45
The qcow2 file is tied to a particular base image.
|
| + utils.save_vm_state(checkpoint_name) |
| + |
| # Save the exception while we run our cleanup() before |
| # reraising it. |
| exc_info = sys.exc_info() |