Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: client/common_lib/test.py

Issue 5303005: Add support for saving VM state after test failure (Closed) Base URL: http://git.chromium.org/git/autotest.git@master
Patch Set: Fix code review feedbacks Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« client/bin/site_utils.py ('K') | « client/bin/site_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« client/bin/site_utils.py ('K') | « client/bin/site_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698