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

Unified Diff: build/android/provision_devices.py

Issue 179333002: Update android device provisioning script to set some reliability settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bulach comments Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/pylib/content_settings.py » ('j') | build/android/pylib/device_settings.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/provision_devices.py
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index a3922469c8e765a221e055635483a6ecf9fc254b..456744408b60eb809cbf15492e54ef4352a12fe9 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -19,6 +19,8 @@ import time
from pylib import android_commands
from pylib import constants
+from pylib import device_settings
+
def KillHostHeartbeat():
ps = subprocess.Popen(['ps', 'aux'], stdout = subprocess.PIPE)
@@ -65,6 +67,19 @@ def PushAndLaunchAdbReboot(devices, target):
LaunchHostHeartbeat()
+def _ConfigureLocalProperties(adb):
+ """Set standard readonly testing device properties prior to reboot."""
+ local_props = ['ro.monkey=1',
bulach 2014/02/26 15:23:59 ultra nit: perhaps: local_props = [ ..., ...,
tonyg 2014/02/26 16:52:58 Done.
+ 'ro.test_harness=1',
+ 'ro.audio.silent=1',
+ 'ro.setupwizard.mode=DISABLED']
+ adb.SetProtectedFileContents(android_commands.LOCAL_PROPERTIES_PATH,
+ '\n'.join(local_props))
+ # Android will not respect the local props file if it is world writable.
+ adb.RunShellCommandWithSU('chmod 644 %s' %
+ android_commands.LOCAL_PROPERTIES_PATH)
+
+
def ProvisionDevices(options):
if options.device is not None:
devices = [options.device]
@@ -72,6 +87,14 @@ def ProvisionDevices(options):
devices = android_commands.GetAttachedDevices()
for device in devices:
android_cmd = android_commands.AndroidCommands(device)
+ _ConfigureLocalProperties(android_cmd)
+ device_settings.ConfigureContentSettingsDict(
+ android_cmd, device_settings.DETERMINISTIC_DEVICE_SETTINGS)
+ # TODO(tonyg): We eventually want network on. However, currently radios
+ # can cause perfbots to drain faster than they charge.
+ if 'Perf' in os.environ.get('BUILDBOT_BUILDERNAME', ''):
bulach 2014/02/26 15:23:59 nit: s/Perf/ and use a .lower() so this would work
tonyg 2014/02/26 16:52:58 Done.
+ device_settings.ConfigureContentSettingsDict(
+ android_cmd, device_settings.NETWORK_DISABLED_SETTINGS)
android_cmd.RunShellCommandWithSU('date -u %f' % time.time())
if options.auto_reconnect:
PushAndLaunchAdbReboot(devices, options.target)
« no previous file with comments | « no previous file | build/android/pylib/content_settings.py » ('j') | build/android/pylib/device_settings.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698