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

Unified Diff: tools/telemetry/telemetry/core/chrome/cros_browser_backend.py

Issue 15907015: Skip bad hwid screen on VMs. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/chrome/cros_browser_backend.py
===================================================================
--- tools/telemetry/telemetry/core/chrome/cros_browser_backend.py (revision 202623)
+++ tools/telemetry/telemetry/core/chrome/cros_browser_backend.py (working copy)
@@ -5,6 +5,7 @@
import os
import subprocess
+from telemetry.core import exceptions
from telemetry.core import util
from telemetry.core.chrome import browser_backend
from telemetry.core.chrome import cros_util
@@ -101,6 +102,14 @@
self.Close()
raise
+ # chrome_branch_number is set in _PostBrowserStartupInitialization.
+ # Without --skip-hwid-check (introduced in crrev.com/203397), devices/VMs
+ # will be stuck on the bad hwid screen.
+ if self.chrome_branch_number <= 1500 and not self.hwid:
+ raise exceptions.LoginException(
+ 'Hardware id not set on device/VM. --skip-hwid-check not supported '
+ 'with chrome branches 1500 or earlier.')
+
if self._is_guest:
cros_util.NavigateGuestLogin(self, cri)
# Guest browsing shuts down the current browser and launches an incognito
@@ -129,6 +138,10 @@
if not self._is_guest:
args.append('--auth-ext-path=%s' % self._login_ext_dir)
+ # Skip hwid check on systems that don't have a hwid set, eg VMs.
+ if not self.hwid:
+ args.append('--skip-hwid-check')
+
return args
@property
@@ -139,6 +152,10 @@
return int(pid)
return None
+ @property
+ def hwid(self):
+ return self._cri.RunCmdOnDevice(['/usr/bin/crossystem', 'hwid'])[0]
+
def GetRemotePort(self, _):
return self._cri.GetRemotePort()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698