diff options
Diffstat (limited to 'crosperf/machine_manager_unittest.py')
-rwxr-xr-x | crosperf/machine_manager_unittest.py | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/crosperf/machine_manager_unittest.py b/crosperf/machine_manager_unittest.py index 0f64a714..b267d698 100755 --- a/crosperf/machine_manager_unittest.py +++ b/crosperf/machine_manager_unittest.py @@ -1,10 +1,6 @@ #!/usr/bin/env python2 -# -*- coding: utf-8 -*- - -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. +# Copyright 2012 Google Inc. All Rights Reserved. """Unittest for machine_manager.""" from __future__ import print_function @@ -52,14 +48,14 @@ class MyMachineManager(machine_manager.MachineManager): CHROMEOS_ROOT = '/tmp/chromeos-root' MACHINE_NAMES = ['lumpy1', 'lumpy2', 'lumpy3', 'daisy1', 'daisy2'] -LABEL_LUMPY = label.MockLabel('lumpy', 'build', 'lumpy_chromeos_image', - 'autotest_dir', 'debug_dir', CHROMEOS_ROOT, - 'lumpy', ['lumpy1', 'lumpy2', 'lumpy3', 'lumpy4'], - '', '', False, 'average', 'gcc', False, None) -LABEL_MIX = label.MockLabel('mix', 'build', 'chromeos_image', 'autotest_dir', - 'debug_dir', CHROMEOS_ROOT, 'mix', - ['daisy1', 'daisy2', 'lumpy3', 'lumpy4'], '', '', - False, 'average', 'gcc', False, None) +LABEL_LUMPY = label.MockLabel( + 'lumpy', 'lumpy_chromeos_image', 'autotest_dir', CHROMEOS_ROOT, 'lumpy', + ['lumpy1', 'lumpy2', 'lumpy3', 'lumpy4'], '', '', False, 'average,' + 'gcc', None) +LABEL_MIX = label.MockLabel('mix', 'chromeos_image', 'autotest_dir', + CHROMEOS_ROOT, 'mix', + ['daisy1', 'daisy2', 'lumpy3', + 'lumpy4'], '', '', False, 'average', 'gcc', None) class MachineManagerTest(unittest.TestCase): @@ -251,6 +247,8 @@ class MachineManagerTest(unittest.TestCase): @mock.patch.object(command_executer.CommandExecuter, 'CrosRunCommandWOutput') def test_try_to_lock_machine(self, mock_cros_runcmd): + self.assertRaises(self.mm._TryToLockMachine, None) + mock_cros_runcmd.return_value = [0, 'false_lock_checksum', ''] self.mock_cmd_exec.CrosRunCommandWOutput = mock_cros_runcmd self.mm._machines = [] @@ -456,7 +454,7 @@ class MachineManagerTest(unittest.TestCase): suite='telemetry_Crosperf') # suite test_run = MockBenchmarkRun('test run', bench, LABEL_LUMPY, 1, [], self.mm, - mock_logger, 'verbose', '', {}, False) + mock_logger, 'verbose', '') self.mm._machines = [ self.mock_lumpy1, self.mock_lumpy2, self.mock_lumpy3, self.mock_daisy1, @@ -486,9 +484,9 @@ class MachineManagerTest(unittest.TestCase): def test_get_all_cpu_info(self): info = self.mm.GetAllCPUInfo([LABEL_LUMPY, LABEL_MIX]) - self.assertEqual( - info, 'lumpy\n-------------------\nlumpy_cpu_info\n\n\nmix\n-' - '------------------\ndaisy_cpu_info\n\n\n') + self.assertEqual(info, + 'lumpy\n-------------------\nlumpy_cpu_info\n\n\nmix\n-' + '------------------\ndaisy_cpu_info\n\n\n') MEMINFO_STRING = """MemTotal: 3990332 kB |