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

Side by Side Diff: bin/cros_au_test_harness.py

Issue 5597004: Create the latest_download dir if it doesn't exist. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 10 years 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 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import optparse 7 import optparse
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 """Abstract interface that defines an Auto Update test.""" 42 """Abstract interface that defines an Auto Update test."""
43 source_image = '' 43 source_image = ''
44 use_delta_updates = False 44 use_delta_updates = False
45 45
46 def setUp(self): 46 def setUp(self):
47 unittest.TestCase.setUp(self) 47 unittest.TestCase.setUp(self)
48 # Set these up as they are used often. 48 # Set these up as they are used often.
49 self.crosutils = os.path.join(os.path.dirname(__file__), '..') 49 self.crosutils = os.path.join(os.path.dirname(__file__), '..')
50 self.crosutilsbin = os.path.join(os.path.dirname(__file__)) 50 self.crosutilsbin = os.path.join(os.path.dirname(__file__))
51 self.download_folder = os.path.join(self.crosutilsbin, 'latest_download') 51 self.download_folder = os.path.join(self.crosutilsbin, 'latest_download')
52 if not os.path.exists(self.download_folder):
53 os.makedirs(self.download_folder)
sosa 2010/12/06 19:42:15 Can you switch to using self.crosutils?
dgarrett 2010/12/06 19:51:28 Do you mean put the downloaded files directly into
52 54
53 def GetStatefulChangeFlag(self, stateful_change): 55 def GetStatefulChangeFlag(self, stateful_change):
54 """Returns the flag to pass to image_to_vm for the stateful change.""" 56 """Returns the flag to pass to image_to_vm for the stateful change."""
55 stateful_change_flag = '' 57 stateful_change_flag = ''
56 if stateful_change: 58 if stateful_change:
57 stateful_change_flag = '--stateful_update_flag=%s' % stateful_change 59 stateful_change_flag = '--stateful_update_flag=%s' % stateful_change
58 60
59 return stateful_change_flag 61 return stateful_change_flag
60 62
61 def ParseGenerateTestReportOutput(self, output): 63 def ParseGenerateTestReportOutput(self, output):
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 else: 474 else:
473 remote = options.remote 475 remote = options.remote
474 476
475 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest) 477 suite = unittest.TestLoader().loadTestsFromTestCase(RealAUTest)
476 test_result = unittest.TextTestRunner(verbosity=2).run(suite) 478 test_result = unittest.TextTestRunner(verbosity=2).run(suite)
477 else: 479 else:
478 parser.error('Could not parse harness type %s.' % options.type) 480 parser.error('Could not parse harness type %s.' % options.type)
479 481
480 if not test_result.wasSuccessful(): 482 if not test_result.wasSuccessful():
481 Die('Test harness was not successful') 483 Die('Test harness was not successful')
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