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..c418cea4072049c7689cdbce0adf3b3dcad67ec0 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 |
|
petkov
2010/11/24 20:36:53
sort
thieule
2010/11/30 23:05:08
Done.
|
| 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) |
| + utils.save_vm_state(checkpoint_name) |
| + |
| # Save the exception while we run our cleanup() before |
| # reraising it. |
| exc_info = sys.exc_info() |