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

Unified Diff: client/site_tests/factory_Wipe/factory_Wipe.py

Issue 3181026: allow force execution of factory_Wipe test. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: fix messages and adjust default parameters Created 10 years, 4 months 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
« no previous file with comments | « no previous file | client/site_tests/factory_Wipe/force_run » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/factory_Wipe/factory_Wipe.py
diff --git a/client/site_tests/factory_Wipe/factory_Wipe.py b/client/site_tests/factory_Wipe/factory_Wipe.py
index 95252af5ccb033b379cbd5b72fc5017174c312d7..ac4ca581599c8930ffe9199ceb85d5044c55195c 100644
--- a/client/site_tests/factory_Wipe/factory_Wipe.py
+++ b/client/site_tests/factory_Wipe/factory_Wipe.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import os
+import time
from autotest_lib.client.bin import factory
from autotest_lib.client.bin import factory_ui_lib as ful
@@ -81,19 +82,34 @@ class factory_Wipe(test.test):
write_protect=True,
check_developer_switch=True,
status_file_path=None,
- test_list=None):
- # first, check if all previous tests are passed.
- status_map = ful.StatusMap(status_file_path, test_list)
- failed = status_map.filter(ful.FAILED)
- if failed:
- raise error.TestFail('Some tests were failed. Cannot start wipe.')
-
- # check if all Google Required Tests are passed
- passed = [t.formal_name for t in status_map.filter(ful.PASSED)]
- if not set(GOOGLE_REQUIRED_TESTS).issubset(passed):
- missing = list(set(GOOGLE_REQUIRED_TESTS).difference(passed))
- raise error.TestFail('You need to execute following Google Required'
- ' Tests: %s' % (','.join(missing)))
+ test_list=None,
+ force_skip_required_test_check=False):
+
+ if force_skip_required_test_check:
+ # alert user what he is doing
+ alert_seconds = 3
+ for i in range(alert_seconds):
+ factory.log('WARNING: REQUIRED TEST CHECK IS BYPASSED. ' +
+ 'THIS DEVICE CANNOT BE QUALIFIED.')
+ factory.log("Waiting %d seconds before test start." % alert_seconds)
+ for i in range(alert_seconds, 0, -1):
+ factory.log(">> wipe test will start in %d seconds..." % i)
+ time.sleep(1)
+ else:
+ # first, check if all previous tests are passed.
+ status_map = ful.StatusMap(status_file_path, test_list)
+ failed = status_map.filter(ful.FAILED)
+ if failed:
+ raise error.TestFail('Some tests were failed. ' +
+ 'Cannot start wipe.')
+
+ # check if all Google Required Tests are passed
+ passed = [t.formal_name for t in status_map.filter(ful.PASSED)]
+ if not set(GOOGLE_REQUIRED_TESTS).issubset(passed):
+ missing = list(set(GOOGLE_REQUIRED_TESTS).difference(passed))
+ raise error.TestFail('You need to execute following ' +
+ 'Google Required Tests: %s' %
+ (','.join(missing)))
# apply each final tests
self.check_developer_switch(check_developer_switch)
« no previous file with comments | « no previous file | client/site_tests/factory_Wipe/force_run » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698