blob: a762038c41d11b851138f772da82aa5bc243b792 [file] [log] [blame]
Mike Frysingere58c0e22017-10-04 15:43:30 -04001# -*- coding: utf-8 -*-
Ryan Cuiafd6c5c2012-07-30 17:48:22 -07002# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
Steve Funge984a532013-11-25 17:09:25 -08006"""Unit tests for the deploy_chrome script."""
Ryan Cuiafd6c5c2012-07-30 17:48:22 -07007
Mike Frysinger383367e2014-09-16 15:06:17 -04008from __future__ import print_function
9
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070010import os
David James88e6f032013-03-02 08:13:20 -080011import time
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070012
Mike Frysinger6db648e2018-07-24 19:57:58 -040013import mock
14
David Pursellcfd58872015-03-19 09:15:48 -070015from chromite.cli.cros import cros_chrome_sdk_unittest
Ryan Cuief91e702013-02-04 12:06:36 -080016from chromite.lib import chrome_util
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070017from chromite.lib import cros_build_lib
18from chromite.lib import cros_test_lib
Ryan Cui686ec052013-02-12 16:39:41 -080019from chromite.lib import osutils
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070020from chromite.lib import partial_mock
Robert Flack1dc7ea82014-11-26 13:50:24 -050021from chromite.lib import remote_access
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070022from chromite.lib import remote_access_unittest
23from chromite.scripts import deploy_chrome
24
Ryan Cuief91e702013-02-04 12:06:36 -080025
Mike Frysinger27e21b72018-07-12 14:20:21 -040026# pylint: disable=protected-access
27
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070028
29_REGULAR_TO = ('--to', 'monkey')
30_GS_PATH = 'gs://foon'
31
32
33def _ParseCommandLine(argv):
34 return deploy_chrome._ParseCommandLine(['--log-level', 'debug'] + argv)
35
36
37class InterfaceTest(cros_test_lib.OutputTestCase):
38 """Tests the commandline interface of the script."""
39
Bernie Thompson93b9ee62018-02-21 14:56:16 -080040 BOARD = 'eve'
Ryan Cui686ec052013-02-12 16:39:41 -080041
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070042 def testGsLocalPathUnSpecified(self):
43 """Test no chrome path specified."""
44 with self.OutputCapturer():
45 self.assertRaises2(SystemExit, _ParseCommandLine, list(_REGULAR_TO),
46 check_attrs={'code': 2})
47
48 def testGsPathSpecified(self):
49 """Test case of GS path specified."""
50 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH]
51 _ParseCommandLine(argv)
52
53 def testLocalPathSpecified(self):
54 """Test case of local path specified."""
Mike Frysingerd6e2df02014-11-26 02:55:04 -050055 argv = list(_REGULAR_TO) + ['--local-pkg-path', '/path/to/chrome']
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070056 _ParseCommandLine(argv)
57
58 def testNoTarget(self):
59 """Test no target specified."""
60 argv = ['--gs-path', _GS_PATH]
Ryan Cuief91e702013-02-04 12:06:36 -080061 self.assertParseError(argv)
62
63 def assertParseError(self, argv):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070064 with self.OutputCapturer():
65 self.assertRaises2(SystemExit, _ParseCommandLine, argv,
66 check_attrs={'code': 2})
67
Achuith Bhandarkar31a3eb02018-03-22 16:33:48 -070068 def testNoBoard(self):
69 """Test cases where --board is not specified."""
Ryan Cui686ec052013-02-12 16:39:41 -080070 argv = ['--staging-only', '--build-dir=/path/to/nowhere']
71 self.assertParseError(argv)
72
Achuith Bhandarkar31a3eb02018-03-22 16:33:48 -070073 # Don't need --board if no stripping is necessary.
74 argv_nostrip = argv + ['--nostrip']
75 _ParseCommandLine(argv_nostrip)
76
77 # Don't need --board if strip binary is provided.
78 argv_strip_bin = argv + ['--strip-bin', 'strip.bin']
79 _ParseCommandLine(argv_strip_bin)
80
Thiago Goncales12793312013-05-23 11:26:17 -070081 def testMountOptionSetsTargetDir(self):
82 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount']
Mike Frysingerc3061a62015-06-04 04:16:18 -040083 options = _ParseCommandLine(argv)
Thiago Goncales12793312013-05-23 11:26:17 -070084 self.assertIsNot(options.target_dir, None)
85
86 def testMountOptionSetsMountDir(self):
87 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount']
Mike Frysingerc3061a62015-06-04 04:16:18 -040088 options = _ParseCommandLine(argv)
Thiago Goncales12793312013-05-23 11:26:17 -070089 self.assertIsNot(options.mount_dir, None)
90
91 def testMountOptionDoesNotOverrideTargetDir(self):
92 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount',
93 '--target-dir', '/foo/bar/cow']
Mike Frysingerc3061a62015-06-04 04:16:18 -040094 options = _ParseCommandLine(argv)
Thiago Goncales12793312013-05-23 11:26:17 -070095 self.assertEqual(options.target_dir, '/foo/bar/cow')
96
97 def testMountOptionDoesNotOverrideMountDir(self):
98 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount',
99 '--mount-dir', '/foo/bar/cow']
Mike Frysingerc3061a62015-06-04 04:16:18 -0400100 options = _ParseCommandLine(argv)
Thiago Goncales12793312013-05-23 11:26:17 -0700101 self.assertEqual(options.mount_dir, '/foo/bar/cow')
102
Adrian Eldera2c548a2017-11-07 19:01:29 -0500103 def testSshIdentityOptionSetsOption(self):
104 argv = list(_REGULAR_TO) + ['--private-key', '/foo/bar/key',
105 '--board', 'cedar',
Bernie Thompson93b9ee62018-02-21 14:56:16 -0800106 '--build-dir', '/path/to/nowhere']
Adrian Eldera2c548a2017-11-07 19:01:29 -0500107 options = _ParseCommandLine(argv)
108 self.assertEqual(options.private_key, '/foo/bar/key')
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700109
110class DeployChromeMock(partial_mock.PartialMock):
Steve Funge984a532013-11-25 17:09:25 -0800111 """Deploy Chrome Mock Class."""
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700112
113 TARGET = 'chromite.scripts.deploy_chrome.DeployChrome'
David James88e6f032013-03-02 08:13:20 -0800114 ATTRS = ('_KillProcsIfNeeded', '_DisableRootfsVerification')
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700115
David James88e6f032013-03-02 08:13:20 -0800116 def __init__(self):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700117 partial_mock.PartialMock.__init__(self)
Robert Flack1dc7ea82014-11-26 13:50:24 -0500118 self.remote_device_mock = remote_access_unittest.RemoteDeviceMock()
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700119 # Target starts off as having rootfs verification enabled.
Ryan Cuie18f24f2012-12-03 18:39:55 -0800120 self.rsh_mock = remote_access_unittest.RemoteShMock()
David James88e6f032013-03-02 08:13:20 -0800121 self.rsh_mock.SetDefaultCmdResult(0)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700122 self.MockMountCmd(1)
David Haddock3151d912017-10-24 03:50:32 +0000123 self.rsh_mock.AddCmdResult(
124 deploy_chrome.LSOF_COMMAND % (deploy_chrome._CHROME_DIR,), 1)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700125
126 def MockMountCmd(self, returnvalue):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700127 self.rsh_mock.AddCmdResult(deploy_chrome.MOUNT_RW_COMMAND,
David James88e6f032013-03-02 08:13:20 -0800128 returnvalue)
129
130 def _DisableRootfsVerification(self, inst):
131 with mock.patch.object(time, 'sleep'):
132 self.backup['_DisableRootfsVerification'](inst)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700133
Ryan Cui4d6fca92012-12-13 16:41:56 -0800134 def PreStart(self):
Robert Flack1dc7ea82014-11-26 13:50:24 -0500135 self.remote_device_mock.start()
Ryan Cui4d6fca92012-12-13 16:41:56 -0800136 self.rsh_mock.start()
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700137
Ryan Cui4d6fca92012-12-13 16:41:56 -0800138 def PreStop(self):
139 self.rsh_mock.stop()
Robert Flack1dc7ea82014-11-26 13:50:24 -0500140 self.remote_device_mock.stop()
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700141
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700142 def _KillProcsIfNeeded(self, _inst):
143 # Fully stub out for now.
144 pass
145
146
Ryan Cuief91e702013-02-04 12:06:36 -0800147class DeployTest(cros_test_lib.MockTempDirTestCase):
Steve Funge984a532013-11-25 17:09:25 -0800148 """Setup a deploy object with a GS-path for use in tests."""
149
Ryan Cuief91e702013-02-04 12:06:36 -0800150 def _GetDeployChrome(self, args):
Mike Frysingerc3061a62015-06-04 04:16:18 -0400151 options = _ParseCommandLine(args)
Ryan Cuia56a71e2012-10-18 18:40:35 -0700152 return deploy_chrome.DeployChrome(
153 options, self.tempdir, os.path.join(self.tempdir, 'staging'))
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700154
155 def setUp(self):
Ryan Cuif1416f32013-01-22 18:43:41 -0800156 self.deploy_mock = self.StartPatcher(DeployChromeMock())
Ryan Cuief91e702013-02-04 12:06:36 -0800157 self.deploy = self._GetDeployChrome(
David James88e6f032013-03-02 08:13:20 -0800158 list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--force'])
Luigi Semenzato1bc79b22016-11-22 16:32:17 -0800159 self.remote_reboot_mock = \
160 self.PatchObject(remote_access.RemoteAccess, 'RemoteReboot',
161 return_value=True)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700162
David James88e6f032013-03-02 08:13:20 -0800163class TestDisableRootfsVerification(DeployTest):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700164 """Testing disabling of rootfs verification and RO mode."""
165
David James88e6f032013-03-02 08:13:20 -0800166 def testDisableRootfsVerificationSuccess(self):
167 """Test the working case, disabling rootfs verification."""
168 self.deploy_mock.MockMountCmd(0)
169 self.deploy._DisableRootfsVerification()
Steven Bennettsca73efa2018-07-10 13:36:56 -0700170 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700171
172 def testDisableRootfsVerificationFailure(self):
173 """Test failure to disable rootfs verification."""
Mike Frysinger27e21b72018-07-12 14:20:21 -0400174 # pylint: disable=unused-argument
Shuqian Zhao14e61092017-11-17 00:02:16 +0000175 def RaiseRunCommandError(timeout_sec=None):
Mike Frysinger929f3ba2019-09-12 03:24:59 -0400176 raise cros_build_lib.RunCommandError('Mock RunCommandError')
Luigi Semenzato1bc79b22016-11-22 16:32:17 -0800177 self.remote_reboot_mock.side_effect = RaiseRunCommandError
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700178 self.assertRaises(cros_build_lib.RunCommandError,
David James88e6f032013-03-02 08:13:20 -0800179 self.deploy._DisableRootfsVerification)
Luigi Semenzato1bc79b22016-11-22 16:32:17 -0800180 self.remote_reboot_mock.side_effect = None
Steven Bennettsca73efa2018-07-10 13:36:56 -0700181 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
David James88e6f032013-03-02 08:13:20 -0800182
183
184class TestMount(DeployTest):
185 """Testing mount success and failure."""
186
187 def testSuccess(self):
188 """Test case where we are able to mount as writable."""
Steven Bennettsca73efa2018-07-10 13:36:56 -0700189 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
David James88e6f032013-03-02 08:13:20 -0800190 self.deploy_mock.MockMountCmd(0)
191 self.deploy._MountRootfsAsWritable()
Steven Bennettsca73efa2018-07-10 13:36:56 -0700192 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
David James88e6f032013-03-02 08:13:20 -0800193
194 def testMountError(self):
195 """Test that mount failure doesn't raise an exception by default."""
Steven Bennettsca73efa2018-07-10 13:36:56 -0700196 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
Mike Frysinger74ccd572015-05-21 21:18:20 -0400197 self.PatchObject(remote_access.RemoteDevice, 'IsDirWritable',
Robert Flack1dc7ea82014-11-26 13:50:24 -0500198 return_value=False, autospec=True)
David James88e6f032013-03-02 08:13:20 -0800199 self.deploy._MountRootfsAsWritable()
Steven Bennettsca73efa2018-07-10 13:36:56 -0700200 self.assertTrue(self.deploy._root_dir_is_still_readonly.is_set())
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700201
202 def testMountRwFailure(self):
David James88e6f032013-03-02 08:13:20 -0800203 """Test that mount failure raises an exception if error_code_ok=False."""
204 self.assertRaises(cros_build_lib.RunCommandError,
205 self.deploy._MountRootfsAsWritable, error_code_ok=False)
Steven Bennettsca73efa2018-07-10 13:36:56 -0700206 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
Robert Flack1dc7ea82014-11-26 13:50:24 -0500207
208 def testMountTempDir(self):
209 """Test that mount succeeds if target dir is writable."""
Steven Bennettsca73efa2018-07-10 13:36:56 -0700210 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
Mike Frysinger74ccd572015-05-21 21:18:20 -0400211 self.PatchObject(remote_access.RemoteDevice, 'IsDirWritable',
Robert Flack1dc7ea82014-11-26 13:50:24 -0500212 return_value=True, autospec=True)
213 self.deploy._MountRootfsAsWritable()
Steven Bennettsca73efa2018-07-10 13:36:56 -0700214 self.assertFalse(self.deploy._root_dir_is_still_readonly.is_set())
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700215
216
Ryan Cuief91e702013-02-04 12:06:36 -0800217class TestUiJobStarted(DeployTest):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700218 """Test detection of a running 'ui' job."""
219
Ryan Cuif2d1a582013-02-19 14:08:13 -0800220 def MockStatusUiCmd(self, **kwargs):
David Haddock3151d912017-10-24 03:50:32 +0000221 self.deploy_mock.rsh_mock.AddCmdResult('status ui', **kwargs)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700222
223 def testUiJobStartedFalse(self):
224 """Correct results with a stopped job."""
Ryan Cuif2d1a582013-02-19 14:08:13 -0800225 self.MockStatusUiCmd(output='ui stop/waiting')
226 self.assertFalse(self.deploy._CheckUiJobStarted())
227
228 def testNoUiJob(self):
229 """Correct results when the job doesn't exist."""
230 self.MockStatusUiCmd(error='start: Unknown job: ui', returncode=1)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700231 self.assertFalse(self.deploy._CheckUiJobStarted())
232
233 def testCheckRootfsWriteableTrue(self):
234 """Correct results with a running job."""
Ryan Cuif2d1a582013-02-19 14:08:13 -0800235 self.MockStatusUiCmd(output='ui start/running, process 297')
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700236 self.assertTrue(self.deploy._CheckUiJobStarted())
237
238
Ryan Cuief91e702013-02-04 12:06:36 -0800239class StagingTest(cros_test_lib.MockTempDirTestCase):
240 """Test user-mode and ebuild-mode staging functionality."""
241
242 def setUp(self):
Ryan Cuief91e702013-02-04 12:06:36 -0800243 self.staging_dir = os.path.join(self.tempdir, 'staging')
244 self.build_dir = os.path.join(self.tempdir, 'build_dir')
Ryan Cui686ec052013-02-12 16:39:41 -0800245 self.common_flags = ['--build-dir', self.build_dir,
Bernie Thompson93b9ee62018-02-21 14:56:16 -0800246 '--board=eve', '--staging-only', '--cache-dir',
Ryan Cui686ec052013-02-12 16:39:41 -0800247 self.tempdir]
Ryan Cuia0215a72013-02-14 16:20:45 -0800248 self.sdk_mock = self.StartPatcher(cros_chrome_sdk_unittest.SDKFetcherMock())
Ryan Cui686ec052013-02-12 16:39:41 -0800249 self.PatchObject(
250 osutils, 'SourceEnvironment', autospec=True,
251 return_value={'STRIP': 'x86_64-cros-linux-gnu-strip'})
Ryan Cuief91e702013-02-04 12:06:36 -0800252
David Jamesa6e08892013-03-01 13:34:11 -0800253 def testSingleFileDeployFailure(self):
254 """Default staging enforces that mandatory files are copied"""
Mike Frysingerc3061a62015-06-04 04:16:18 -0400255 options = _ParseCommandLine(self.common_flags)
David Jamesa6e08892013-03-01 13:34:11 -0800256 osutils.Touch(os.path.join(self.build_dir, 'chrome'), makedirs=True)
257 self.assertRaises(
258 chrome_util.MissingPathError, deploy_chrome._PrepareStagingDir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700259 options, self.tempdir, self.staging_dir, chrome_util._COPY_PATHS_CHROME)
Ryan Cuief91e702013-02-04 12:06:36 -0800260
David Jamesa6e08892013-03-01 13:34:11 -0800261 def testSloppyDeployFailure(self):
262 """Sloppy staging enforces that at least one file is copied."""
Mike Frysingerc3061a62015-06-04 04:16:18 -0400263 options = _ParseCommandLine(self.common_flags + ['--sloppy'])
David Jamesa6e08892013-03-01 13:34:11 -0800264 self.assertRaises(
265 chrome_util.MissingPathError, deploy_chrome._PrepareStagingDir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700266 options, self.tempdir, self.staging_dir, chrome_util._COPY_PATHS_CHROME)
David Jamesa6e08892013-03-01 13:34:11 -0800267
268 def testSloppyDeploySuccess(self):
269 """Sloppy staging - stage one file."""
Mike Frysingerc3061a62015-06-04 04:16:18 -0400270 options = _ParseCommandLine(self.common_flags + ['--sloppy'])
David Jamesa6e08892013-03-01 13:34:11 -0800271 osutils.Touch(os.path.join(self.build_dir, 'chrome'), makedirs=True)
Steve Funge984a532013-11-25 17:09:25 -0800272 deploy_chrome._PrepareStagingDir(options, self.tempdir, self.staging_dir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700273 chrome_util._COPY_PATHS_CHROME)
David Jamesa6e08892013-03-01 13:34:11 -0800274
Steve Funge984a532013-11-25 17:09:25 -0800275
276class DeployTestBuildDir(cros_test_lib.MockTempDirTestCase):
Daniel Erat1ae46382014-08-14 10:23:39 -0700277 """Set up a deploy object with a build-dir for use in deployment type tests"""
Steve Funge984a532013-11-25 17:09:25 -0800278
279 def _GetDeployChrome(self, args):
Mike Frysingerc3061a62015-06-04 04:16:18 -0400280 options = _ParseCommandLine(args)
Steve Funge984a532013-11-25 17:09:25 -0800281 return deploy_chrome.DeployChrome(
282 options, self.tempdir, os.path.join(self.tempdir, 'staging'))
283
284 def setUp(self):
285 self.staging_dir = os.path.join(self.tempdir, 'staging')
286 self.build_dir = os.path.join(self.tempdir, 'build_dir')
287 self.deploy_mock = self.StartPatcher(DeployChromeMock())
288 self.deploy = self._GetDeployChrome(
289 list(_REGULAR_TO) + ['--build-dir', self.build_dir,
Bernie Thompson93b9ee62018-02-21 14:56:16 -0800290 '--board=eve', '--staging-only', '--cache-dir',
Steve Funge984a532013-11-25 17:09:25 -0800291 self.tempdir, '--sloppy'])
292
Daniel Erat1ae46382014-08-14 10:23:39 -0700293 def getCopyPath(self, source_path):
294 """Return a chrome_util.Path or None if not present."""
295 paths = [p for p in self.deploy.copy_paths if p.src == source_path]
296 return paths[0] if paths else None
Steve Funge984a532013-11-25 17:09:25 -0800297
Daniel Erat1ae46382014-08-14 10:23:39 -0700298class TestDeploymentType(DeployTestBuildDir):
Steve Funge984a532013-11-25 17:09:25 -0800299 """Test detection of deployment type using build dir."""
300
Daniel Erat1ae46382014-08-14 10:23:39 -0700301 def testAppShellDetection(self):
302 """Check for an app_shell deployment"""
303 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'app_shell'),
Steve Funge984a532013-11-25 17:09:25 -0800304 makedirs=True)
305 self.deploy._CheckDeployType()
Daniel Erat1ae46382014-08-14 10:23:39 -0700306 self.assertTrue(self.getCopyPath('app_shell'))
307 self.assertFalse(self.getCopyPath('chrome'))
Steve Funge984a532013-11-25 17:09:25 -0800308
Daniel Erat1ae46382014-08-14 10:23:39 -0700309 def testChromeAndAppShellDetection(self):
Daniel Eratf53bd3a2016-12-02 11:28:36 -0700310 """Check for a chrome deployment when app_shell also exists."""
Steve Fung63d705d2014-03-16 03:14:03 -0700311 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'chrome'),
312 makedirs=True)
Daniel Erat1ae46382014-08-14 10:23:39 -0700313 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'app_shell'),
Steve Fung63d705d2014-03-16 03:14:03 -0700314 makedirs=True)
315 self.deploy._CheckDeployType()
Daniel Erat1ae46382014-08-14 10:23:39 -0700316 self.assertTrue(self.getCopyPath('chrome'))
Daniel Erat9813f0e2014-11-12 11:00:28 -0700317 self.assertFalse(self.getCopyPath('app_shell'))
Steve Fung63d705d2014-03-16 03:14:03 -0700318
Steve Funge984a532013-11-25 17:09:25 -0800319 def testChromeDetection(self):
320 """Check for a regular chrome deployment"""
321 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'chrome'),
322 makedirs=True)
323 self.deploy._CheckDeployType()
Daniel Erat1ae46382014-08-14 10:23:39 -0700324 self.assertTrue(self.getCopyPath('chrome'))
Daniel Erat9813f0e2014-11-12 11:00:28 -0700325 self.assertFalse(self.getCopyPath('app_shell'))