blob: 42076c833eb4ddcbadf303ece38a6152d9c0b34a [file] [log] [blame]
Ryan Cuiafd6c5c2012-07-30 17:48:22 -07001# Copyright (c) 2012 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
Steve Funge984a532013-11-25 17:09:25 -08005"""Unit tests for the deploy_chrome script."""
Ryan Cuiafd6c5c2012-07-30 17:48:22 -07006
Mike Frysinger383367e2014-09-16 15:06:17 -04007from __future__ import print_function
8
Mike Frysingerea838d12014-12-08 11:55:32 -05009import mock
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
David Pursellcfd58872015-03-19 09:15:48 -070013from chromite.cli.cros import cros_chrome_sdk_unittest
Ryan Cuief91e702013-02-04 12:06:36 -080014from chromite.lib import chrome_util
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070015from chromite.lib import cros_build_lib
16from chromite.lib import cros_test_lib
Ryan Cui686ec052013-02-12 16:39:41 -080017from chromite.lib import osutils
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070018from chromite.lib import partial_mock
Robert Flack1dc7ea82014-11-26 13:50:24 -050019from chromite.lib import remote_access
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070020from chromite.lib import remote_access_unittest
Ryan Cuicbd9bb62013-04-30 11:17:02 -070021from chromite.lib import stats
22from chromite.lib import stats_unittest
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070023from chromite.scripts import deploy_chrome
24
Ryan Cuief91e702013-02-04 12:06:36 -080025
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070026# pylint: disable=W0212
27
28_REGULAR_TO = ('--to', 'monkey')
29_GS_PATH = 'gs://foon'
30
31
32def _ParseCommandLine(argv):
33 return deploy_chrome._ParseCommandLine(['--log-level', 'debug'] + argv)
34
35
36class InterfaceTest(cros_test_lib.OutputTestCase):
37 """Tests the commandline interface of the script."""
38
Ryan Cui686ec052013-02-12 16:39:41 -080039 BOARD = 'lumpy'
40
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070041 def testGsLocalPathUnSpecified(self):
42 """Test no chrome path specified."""
43 with self.OutputCapturer():
44 self.assertRaises2(SystemExit, _ParseCommandLine, list(_REGULAR_TO),
45 check_attrs={'code': 2})
46
47 def testGsPathSpecified(self):
48 """Test case of GS path specified."""
49 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH]
50 _ParseCommandLine(argv)
51
52 def testLocalPathSpecified(self):
53 """Test case of local path specified."""
Mike Frysingerd6e2df02014-11-26 02:55:04 -050054 argv = list(_REGULAR_TO) + ['--local-pkg-path', '/path/to/chrome']
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070055 _ParseCommandLine(argv)
56
57 def testNoTarget(self):
58 """Test no target specified."""
59 argv = ['--gs-path', _GS_PATH]
Ryan Cuief91e702013-02-04 12:06:36 -080060 self.assertParseError(argv)
61
62 def assertParseError(self, argv):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -070063 with self.OutputCapturer():
64 self.assertRaises2(SystemExit, _ParseCommandLine, argv,
65 check_attrs={'code': 2})
66
Ryan Cuief91e702013-02-04 12:06:36 -080067 def testStagingFlagsNoStrict(self):
68 """Errors out when --staging-flags is set without --strict."""
69 argv = ['--staging-only', '--build-dir=/path/to/nowhere',
Ryan Cui686ec052013-02-12 16:39:41 -080070 '--board=%s' % self.BOARD, '--staging-flags=highdpi']
Ryan Cuief91e702013-02-04 12:06:36 -080071 self.assertParseError(argv)
72
73 def testStrictNoBuildDir(self):
74 """Errors out when --strict is set without --build-dir."""
75 argv = ['--staging-only', '--strict', '--gs-path', _GS_PATH]
76 self.assertParseError(argv)
77
Ryan Cui686ec052013-02-12 16:39:41 -080078 def testNoBoardBuildDir(self):
79 argv = ['--staging-only', '--build-dir=/path/to/nowhere']
80 self.assertParseError(argv)
81
Thiago Goncales12793312013-05-23 11:26:17 -070082 def testMountOptionSetsTargetDir(self):
83 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount']
84 options, _ = _ParseCommandLine(argv)
85 self.assertIsNot(options.target_dir, None)
86
87 def testMountOptionSetsMountDir(self):
88 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount']
89 options, _ = _ParseCommandLine(argv)
90 self.assertIsNot(options.mount_dir, None)
91
92 def testMountOptionDoesNotOverrideTargetDir(self):
93 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount',
94 '--target-dir', '/foo/bar/cow']
95 options, _ = _ParseCommandLine(argv)
96 self.assertEqual(options.target_dir, '/foo/bar/cow')
97
98 def testMountOptionDoesNotOverrideMountDir(self):
99 argv = list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--mount',
100 '--mount-dir', '/foo/bar/cow']
101 options, _ = _ParseCommandLine(argv)
102 self.assertEqual(options.mount_dir, '/foo/bar/cow')
103
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700104
105class DeployChromeMock(partial_mock.PartialMock):
Steve Funge984a532013-11-25 17:09:25 -0800106 """Deploy Chrome Mock Class."""
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700107
108 TARGET = 'chromite.scripts.deploy_chrome.DeployChrome'
David James88e6f032013-03-02 08:13:20 -0800109 ATTRS = ('_KillProcsIfNeeded', '_DisableRootfsVerification')
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700110
David James88e6f032013-03-02 08:13:20 -0800111 def __init__(self):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700112 partial_mock.PartialMock.__init__(self)
Robert Flack1dc7ea82014-11-26 13:50:24 -0500113 self.remote_device_mock = remote_access_unittest.RemoteDeviceMock()
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700114 # Target starts off as having rootfs verification enabled.
Ryan Cuie18f24f2012-12-03 18:39:55 -0800115 self.rsh_mock = remote_access_unittest.RemoteShMock()
David James88e6f032013-03-02 08:13:20 -0800116 self.rsh_mock.SetDefaultCmdResult(0)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700117 self.MockMountCmd(1)
Pawel Osciak577773a2013-03-05 10:52:12 -0800118 self.rsh_mock.AddCmdResult(
119 deploy_chrome.LSOF_COMMAND % (deploy_chrome._CHROME_DIR,), 1)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700120
121 def MockMountCmd(self, returnvalue):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700122 self.rsh_mock.AddCmdResult(deploy_chrome.MOUNT_RW_COMMAND,
David James88e6f032013-03-02 08:13:20 -0800123 returnvalue)
124
125 def _DisableRootfsVerification(self, inst):
126 with mock.patch.object(time, 'sleep'):
127 self.backup['_DisableRootfsVerification'](inst)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700128
Ryan Cui4d6fca92012-12-13 16:41:56 -0800129 def PreStart(self):
Robert Flack1dc7ea82014-11-26 13:50:24 -0500130 self.remote_device_mock.start()
Ryan Cui4d6fca92012-12-13 16:41:56 -0800131 self.rsh_mock.start()
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700132
Ryan Cui4d6fca92012-12-13 16:41:56 -0800133 def PreStop(self):
134 self.rsh_mock.stop()
Robert Flack1dc7ea82014-11-26 13:50:24 -0500135 self.remote_device_mock.stop()
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700136
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700137 def _KillProcsIfNeeded(self, _inst):
138 # Fully stub out for now.
139 pass
140
141
Ryan Cuicbd9bb62013-04-30 11:17:02 -0700142class MainTest(cros_test_lib.MockLoggingTestCase):
Steve Funge984a532013-11-25 17:09:25 -0800143 """Main tests."""
Ryan Cuicbd9bb62013-04-30 11:17:02 -0700144
145 def setUp(self):
146 self.PatchObject(deploy_chrome.DeployChrome, 'Perform', autospec=True)
147 self.stats_module_mock = stats_unittest.StatsModuleMock()
148 self.StartPatcher(self.stats_module_mock)
149
150 def testStatsUpload(self, call_count=1):
151 """The stats upload path."""
152 deploy_chrome.main(['--board=lumpy', '--staging-only',
153 '--build-dir=/tmp/abc'])
154 self.assertEquals(stats.StatsUploader._Upload.call_count, call_count)
155
156 def testStatsUploadError(self):
157 """Don't upload stats if we fail to create it."""
158 self.stats_module_mock.stats_mock.init_exception = True
159 with cros_test_lib.LoggingCapturer():
160 self.testStatsUpload(call_count=0)
161
162
Ryan Cuief91e702013-02-04 12:06:36 -0800163class DeployTest(cros_test_lib.MockTempDirTestCase):
Steve Funge984a532013-11-25 17:09:25 -0800164 """Setup a deploy object with a GS-path for use in tests."""
165
Ryan Cuief91e702013-02-04 12:06:36 -0800166 def _GetDeployChrome(self, args):
167 options, _ = _ParseCommandLine(args)
Ryan Cuia56a71e2012-10-18 18:40:35 -0700168 return deploy_chrome.DeployChrome(
169 options, self.tempdir, os.path.join(self.tempdir, 'staging'))
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700170
171 def setUp(self):
Ryan Cuif1416f32013-01-22 18:43:41 -0800172 self.deploy_mock = self.StartPatcher(DeployChromeMock())
Ryan Cuief91e702013-02-04 12:06:36 -0800173 self.deploy = self._GetDeployChrome(
David James88e6f032013-03-02 08:13:20 -0800174 list(_REGULAR_TO) + ['--gs-path', _GS_PATH, '--force'])
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700175
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700176
David James88e6f032013-03-02 08:13:20 -0800177class TestDisableRootfsVerification(DeployTest):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700178 """Testing disabling of rootfs verification and RO mode."""
179
David James88e6f032013-03-02 08:13:20 -0800180 def testDisableRootfsVerificationSuccess(self):
181 """Test the working case, disabling rootfs verification."""
182 self.deploy_mock.MockMountCmd(0)
183 self.deploy._DisableRootfsVerification()
Robert Flack1dc7ea82014-11-26 13:50:24 -0500184 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700185
186 def testDisableRootfsVerificationFailure(self):
187 """Test failure to disable rootfs verification."""
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700188 self.assertRaises(cros_build_lib.RunCommandError,
David James88e6f032013-03-02 08:13:20 -0800189 self.deploy._DisableRootfsVerification)
Robert Flack1dc7ea82014-11-26 13:50:24 -0500190 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
David James88e6f032013-03-02 08:13:20 -0800191
192
193class TestMount(DeployTest):
194 """Testing mount success and failure."""
195
196 def testSuccess(self):
197 """Test case where we are able to mount as writable."""
Robert Flack1dc7ea82014-11-26 13:50:24 -0500198 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
David James88e6f032013-03-02 08:13:20 -0800199 self.deploy_mock.MockMountCmd(0)
200 self.deploy._MountRootfsAsWritable()
Robert Flack1dc7ea82014-11-26 13:50:24 -0500201 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
David James88e6f032013-03-02 08:13:20 -0800202
203 def testMountError(self):
204 """Test that mount failure doesn't raise an exception by default."""
Robert Flack1dc7ea82014-11-26 13:50:24 -0500205 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
206 self.PatchObject(remote_access.RemoteDevice, 'IsPathWritable',
207 return_value=False, autospec=True)
David James88e6f032013-03-02 08:13:20 -0800208 self.deploy._MountRootfsAsWritable()
Robert Flack1dc7ea82014-11-26 13:50:24 -0500209 self.assertTrue(self.deploy._target_dir_is_still_readonly.is_set())
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700210
211 def testMountRwFailure(self):
David James88e6f032013-03-02 08:13:20 -0800212 """Test that mount failure raises an exception if error_code_ok=False."""
213 self.assertRaises(cros_build_lib.RunCommandError,
214 self.deploy._MountRootfsAsWritable, error_code_ok=False)
Robert Flack1dc7ea82014-11-26 13:50:24 -0500215 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
216
217 def testMountTempDir(self):
218 """Test that mount succeeds if target dir is writable."""
219 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
220 self.PatchObject(remote_access.RemoteDevice, 'IsPathWritable',
221 return_value=True, autospec=True)
222 self.deploy._MountRootfsAsWritable()
223 self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700224
225
Ryan Cuief91e702013-02-04 12:06:36 -0800226class TestUiJobStarted(DeployTest):
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700227 """Test detection of a running 'ui' job."""
228
Ryan Cuif2d1a582013-02-19 14:08:13 -0800229 def MockStatusUiCmd(self, **kwargs):
230 self.deploy_mock.rsh_mock.AddCmdResult('status ui', **kwargs)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700231
232 def testUiJobStartedFalse(self):
233 """Correct results with a stopped job."""
Ryan Cuif2d1a582013-02-19 14:08:13 -0800234 self.MockStatusUiCmd(output='ui stop/waiting')
235 self.assertFalse(self.deploy._CheckUiJobStarted())
236
237 def testNoUiJob(self):
238 """Correct results when the job doesn't exist."""
239 self.MockStatusUiCmd(error='start: Unknown job: ui', returncode=1)
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700240 self.assertFalse(self.deploy._CheckUiJobStarted())
241
242 def testCheckRootfsWriteableTrue(self):
243 """Correct results with a running job."""
Ryan Cuif2d1a582013-02-19 14:08:13 -0800244 self.MockStatusUiCmd(output='ui start/running, process 297')
Ryan Cuiafd6c5c2012-07-30 17:48:22 -0700245 self.assertTrue(self.deploy._CheckUiJobStarted())
246
247
Ryan Cuief91e702013-02-04 12:06:36 -0800248class StagingTest(cros_test_lib.MockTempDirTestCase):
249 """Test user-mode and ebuild-mode staging functionality."""
250
251 def setUp(self):
Ryan Cuief91e702013-02-04 12:06:36 -0800252 self.staging_dir = os.path.join(self.tempdir, 'staging')
253 self.build_dir = os.path.join(self.tempdir, 'build_dir')
Ryan Cui686ec052013-02-12 16:39:41 -0800254 self.common_flags = ['--build-dir', self.build_dir,
255 '--board=lumpy', '--staging-only', '--cache-dir',
256 self.tempdir]
Ryan Cuia0215a72013-02-14 16:20:45 -0800257 self.sdk_mock = self.StartPatcher(cros_chrome_sdk_unittest.SDKFetcherMock())
Ryan Cui686ec052013-02-12 16:39:41 -0800258 self.PatchObject(
259 osutils, 'SourceEnvironment', autospec=True,
260 return_value={'STRIP': 'x86_64-cros-linux-gnu-strip'})
Ryan Cuief91e702013-02-04 12:06:36 -0800261
David Jamesa6e08892013-03-01 13:34:11 -0800262 def testSingleFileDeployFailure(self):
263 """Default staging enforces that mandatory files are copied"""
Ryan Cuief91e702013-02-04 12:06:36 -0800264 options, _ = _ParseCommandLine(self.common_flags)
David Jamesa6e08892013-03-01 13:34:11 -0800265 osutils.Touch(os.path.join(self.build_dir, 'chrome'), makedirs=True)
266 self.assertRaises(
267 chrome_util.MissingPathError, deploy_chrome._PrepareStagingDir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700268 options, self.tempdir, self.staging_dir, chrome_util._COPY_PATHS_CHROME)
Ryan Cuief91e702013-02-04 12:06:36 -0800269
David Jamesa6e08892013-03-01 13:34:11 -0800270 def testSloppyDeployFailure(self):
271 """Sloppy staging enforces that at least one file is copied."""
272 options, _ = _ParseCommandLine(self.common_flags + ['--sloppy'])
273 self.assertRaises(
274 chrome_util.MissingPathError, deploy_chrome._PrepareStagingDir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700275 options, self.tempdir, self.staging_dir, chrome_util._COPY_PATHS_CHROME)
David Jamesa6e08892013-03-01 13:34:11 -0800276
277 def testSloppyDeploySuccess(self):
278 """Sloppy staging - stage one file."""
279 options, _ = _ParseCommandLine(self.common_flags + ['--sloppy'])
280 osutils.Touch(os.path.join(self.build_dir, 'chrome'), makedirs=True)
Steve Funge984a532013-11-25 17:09:25 -0800281 deploy_chrome._PrepareStagingDir(options, self.tempdir, self.staging_dir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700282 chrome_util._COPY_PATHS_CHROME)
David Jamesa6e08892013-03-01 13:34:11 -0800283
Ryan Cuief91e702013-02-04 12:06:36 -0800284 def testEmptyDeployStrict(self):
David Jamesa6e08892013-03-01 13:34:11 -0800285 """Strict staging fails when there are no files."""
Ryan Cuief91e702013-02-04 12:06:36 -0800286 options, _ = _ParseCommandLine(
287 self.common_flags + ['--gyp-defines', 'chromeos=1', '--strict'])
Ryan Cui686ec052013-02-12 16:39:41 -0800288
Ryan Cuief91e702013-02-04 12:06:36 -0800289 self.assertRaises(
290 chrome_util.MissingPathError, deploy_chrome._PrepareStagingDir,
Daniel Eratc89829c2014-05-12 17:24:21 -0700291 options, self.tempdir, self.staging_dir, chrome_util._COPY_PATHS_CHROME)
Steve Funge984a532013-11-25 17:09:25 -0800292
293
294class DeployTestBuildDir(cros_test_lib.MockTempDirTestCase):
Daniel Erat1ae46382014-08-14 10:23:39 -0700295 """Set up a deploy object with a build-dir for use in deployment type tests"""
Steve Funge984a532013-11-25 17:09:25 -0800296
297 def _GetDeployChrome(self, args):
298 options, _ = _ParseCommandLine(args)
299 return deploy_chrome.DeployChrome(
300 options, self.tempdir, os.path.join(self.tempdir, 'staging'))
301
302 def setUp(self):
303 self.staging_dir = os.path.join(self.tempdir, 'staging')
304 self.build_dir = os.path.join(self.tempdir, 'build_dir')
305 self.deploy_mock = self.StartPatcher(DeployChromeMock())
306 self.deploy = self._GetDeployChrome(
307 list(_REGULAR_TO) + ['--build-dir', self.build_dir,
308 '--board=lumpy', '--staging-only', '--cache-dir',
309 self.tempdir, '--sloppy'])
310
Daniel Erat1ae46382014-08-14 10:23:39 -0700311 def getCopyPath(self, source_path):
312 """Return a chrome_util.Path or None if not present."""
313 paths = [p for p in self.deploy.copy_paths if p.src == source_path]
314 return paths[0] if paths else None
Steve Funge984a532013-11-25 17:09:25 -0800315
Daniel Erat1ae46382014-08-14 10:23:39 -0700316class TestDeploymentType(DeployTestBuildDir):
Steve Funge984a532013-11-25 17:09:25 -0800317 """Test detection of deployment type using build dir."""
318
Daniel Erat9813f0e2014-11-12 11:00:28 -0700319 def testEnvoyDetection(self):
320 """Check for an envoy deployment"""
321 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'envoy_shell'),
322 makedirs=True)
323 self.deploy._CheckDeployType()
324 self.assertTrue(self.getCopyPath('envoy_shell'))
325 self.assertFalse(self.getCopyPath('app_shell'))
326 self.assertFalse(self.getCopyPath('chrome'))
327
Daniel Erat1ae46382014-08-14 10:23:39 -0700328 def testAppShellDetection(self):
329 """Check for an app_shell deployment"""
330 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'app_shell'),
Steve Funge984a532013-11-25 17:09:25 -0800331 makedirs=True)
332 self.deploy._CheckDeployType()
Daniel Erat1ae46382014-08-14 10:23:39 -0700333 self.assertTrue(self.getCopyPath('app_shell'))
334 self.assertFalse(self.getCopyPath('chrome'))
Daniel Erat9813f0e2014-11-12 11:00:28 -0700335 self.assertFalse(self.getCopyPath('envoy_shell'))
Steve Funge984a532013-11-25 17:09:25 -0800336
Daniel Erat1ae46382014-08-14 10:23:39 -0700337 def testChromeAndAppShellDetection(self):
Daniel Erat9813f0e2014-11-12 11:00:28 -0700338 """Check for a chrome deployment when app_shell/envoy_shell also exist."""
Steve Fung63d705d2014-03-16 03:14:03 -0700339 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'chrome'),
340 makedirs=True)
Daniel Erat1ae46382014-08-14 10:23:39 -0700341 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'app_shell'),
Steve Fung63d705d2014-03-16 03:14:03 -0700342 makedirs=True)
Daniel Erat9813f0e2014-11-12 11:00:28 -0700343 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'envoy_shell'),
344 makedirs=True)
Steve Fung63d705d2014-03-16 03:14:03 -0700345 self.deploy._CheckDeployType()
Daniel Erat1ae46382014-08-14 10:23:39 -0700346 self.assertTrue(self.getCopyPath('chrome'))
Daniel Erat9813f0e2014-11-12 11:00:28 -0700347 self.assertFalse(self.getCopyPath('app_shell'))
348 self.assertFalse(self.getCopyPath('envoy_shell'))
Steve Fung63d705d2014-03-16 03:14:03 -0700349
Steve Funge984a532013-11-25 17:09:25 -0800350 def testChromeDetection(self):
351 """Check for a regular chrome deployment"""
352 osutils.Touch(os.path.join(self.deploy.options.build_dir, 'chrome'),
353 makedirs=True)
354 self.deploy._CheckDeployType()
Daniel Erat1ae46382014-08-14 10:23:39 -0700355 self.assertTrue(self.getCopyPath('chrome'))
Daniel Erat9813f0e2014-11-12 11:00:28 -0700356 self.assertFalse(self.getCopyPath('app_shell'))
357 self.assertFalse(self.getCopyPath('envoy_shell'))