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

Side by Side Diff: utils/site_test_importer_attributes.py

Issue 6124004: Revert "Merge remote branch 'cros/upstream' into autotest-rebase" (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 9 years, 11 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 | « utils/run_pylint.py ('k') | utils/test_importer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright 2010 Google Inc. All Rights Reserved. 3 # Copyright 2010 Google Inc. All Rights Reserved.
4 """ 4 """
5 This allows a site to customize the test creation attributes. 5 This allows a site to customize the test creation attributes.
6 6
7 """ 7 """
8 8
9 9
10 import common, re 10 import common, re
11 from autotest_lib.frontend.afe import models
11 12
12 13
13 def _set_attributes_custom(test, data): 14 def _set_attributes_custom(test, data):
14 # We set the test name to the dirname of the control file. 15 # We set the test name to the dirname of the control file.
15 test_new_name = test.path.split('/') 16 test_new_name = test.path.split('/')
16 if test_new_name[-1] == 'control' or test_new_name[-1] == 'control.srv': 17 if test_new_name[-1] == 'control' or test_new_name[-1] == 'control.srv':
17 test.name = test_new_name[-2] 18 test.name = test_new_name[-2]
18 else: 19 else:
19 control_name = "%s:%s" 20 control_name = "%s:%s"
20 control_name %= (test_new_name[-2], 21 control_name %= (test_new_name[-2],
21 test_new_name[-1]) 22 test_new_name[-1])
22 test.name = re.sub('control.*\.', '', control_name) 23 test.name = re.sub('control.*\.', '', control_name)
23 24
24 # We set verify to always False (0). 25 # We set verify to always False (0).
25 test.run_verify = 0 26 test.run_verify = 0
27
28 if hasattr(data, 'test_parameters'):
29 for para_name in data.test_parameters:
30 test_parameter = models.TestParameter.objects.get_or_create(
31 test=test, name=para_name)[0]
32 test_parameter.save()
OLDNEW
« no previous file with comments | « utils/run_pylint.py ('k') | utils/test_importer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698