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

Side by Side Diff: bin/au_test_harness/dummy_au_worker.py

Issue 6717011: Remove au_test_harness code and change symlinks to point to new location (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Created 9 years, 9 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 | « bin/au_test_harness/dev_server_wrapper.py ('k') | bin/au_test_harness/parallel_test_job.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Module containing a fake au worker class."""
6
7 import unittest
8
9 import au_worker
10
11 class DummyAUWorker(au_worker.AUWorker):
12 """AU worker that emulates work for an au_worker without actually doing work.
13
14 Collects different updates that would be generated that can be obtained
15 from the class object delta_list.
16 """
17
18 # Class variable that stores the list of payloads that would be needed.
19 delta_list = {}
20
21 def __init__(self, options, test_results_root):
22 au_worker.AUWorker.__init__(self, options, test_results_root)
23 self.au_type = options.type
24
25 def PrepareBase(self, image_path):
26 """Copy how the actual worker would prepare the base image."""
27 if self.au_type == 'vm':
28 self.PrepareVMBase(image_path)
29 else:
30 self.PrepareRealBase(image_path)
31
32 def UpdateImage(self, image_path, src_image_path='', stateful_change='old',
33 proxy_port=None, private_key_path=None):
34 """Emulate Update and record the update payload in delta_list."""
35 if self.au_type == 'vm' and src_image_path and self._first_update:
36 src_image_path = self.vm_image_path
37 self._first_update = False
38
39 # Generate a value that combines delta with private key path.
40 val = src_image_path
41 if private_key_path: val = '%s+%s' % (val, private_key_path)
42 if not self.delta_list.has_key(image_path):
43 self.delta_list[image_path] = set([val])
44 else:
45 self.delta_list[image_path].add(val)
OLDNEW
« no previous file with comments | « bin/au_test_harness/dev_server_wrapper.py ('k') | bin/au_test_harness/parallel_test_job.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698