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

Side by Side Diff: client/site_tests/factory_Verify/factory_Verify.py

Issue 3323018: Fix for new status_map convention. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Created 10 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import time 6 import time
7 7
8 from autotest_lib.client.bin import factory 8 from autotest_lib.client.bin import factory
9 from autotest_lib.client.bin import factory_ui_lib as ful 9 from autotest_lib.client.bin import factory_ui_lib as ful
10 from autotest_lib.client.bin import test, utils 10 from autotest_lib.client.bin import test, utils
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 def check_google_required_tests(self, do_check, status_file, test_list): 64 def check_google_required_tests(self, do_check, status_file, test_list):
65 """ Checks if all previous and Google Required Tests are passed. """ 65 """ Checks if all previous and Google Required Tests are passed. """
66 if not do_check: 66 if not do_check:
67 self.alert_bypassed('REQUIRED TESTS') 67 self.alert_bypassed('REQUIRED TESTS')
68 return 68 return
69 69
70 # check if all previous tests are passed. 70 # check if all previous tests are passed.
71 db = factory.TestDatabase(test_list) 71 db = factory.TestDatabase(test_list)
72 status_map = factory.StatusMap(test_list, status_file, db) 72 status_map = factory.StatusMap(test_list, status_file, db)
73 failed_list = status_map.filter(ful.FAILED) 73 failed_list = status_map.filter_by_status(ful.FAILED)
74 if failed_list: 74 if failed_list:
75 failed = ','.join([db.get_unique_id_str(t) for t in failed_list]) 75 failed = ','.join([db.get_unique_id_str(t) for t in failed_list])
76 raise error.TestFail('Some previous tests failed: %s' % failed) 76 raise error.TestFail('Some previous tests failed: %s' % failed)
77 77
78 # check if all Google Required Tests are passed 78 # check if all Google Required Tests are passed
79 missing = [] 79 missing = []
80 for g in GOOGLE_REQUIRED_TESTS: 80 for g in GOOGLE_REQUIRED_TESTS:
81 t = db.get_test_by_unique_name(g) 81 t = db.get_test_by_unique_name(g)
82 if status_map.lookup_status(t) != ful.PASSED: 82 if status_map.lookup_status(t) != ful.PASSED:
83 missing.append('%s(%s)' % (g, db.get_unique_id_str(t))) 83 missing.append('%s(%s)' % (g, db.get_unique_id_str(t)))
84 if missing: 84 if missing:
85 missing_msg = ', '.join(missing) 85 missing_msg = ', '.join(missing)
86 raise error.TestFail('You need to execute following ' + 86 raise error.TestFail('You need to execute following ' +
87 'Google Required Tests: %s' % missing_msg) 87 'Google Required Tests: %s' % missing_msg)
88 88
89 def run_once(self, 89 def run_once(self,
90 check_required_tests=True, 90 check_required_tests=True,
91 check_developer_switch=True, 91 check_developer_switch=True,
92 check_and_enable_write_protect=True, 92 check_and_enable_write_protect=True,
93 status_file_path=None, 93 status_file_path=None,
94 test_list=None): 94 test_list=None):
95 95
96 # apply each final tests 96 # apply each final tests
97 self.check_google_required_tests(check_required_tests, 97 self.check_google_required_tests(check_required_tests,
98 status_file_path, 98 status_file_path,
99 test_list) 99 test_list)
100 self.check_developer_switch(check_developer_switch) 100 self.check_developer_switch(check_developer_switch)
101 self.check_flashrom_write_protect(check_and_enable_write_protect) 101 self.check_flashrom_write_protect(check_and_enable_write_protect)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698