summaryrefslogtreecommitdiffstats
path: root/chromeos/chromeos_paths.cc
diff options
context:
space:
mode:
authortnagel <tnagel@chromium.org>2014-12-17 12:28:50 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-17 20:29:26 +0000
commit53a23380c25032a67b620356b1521d69e3a15d04 (patch)
treed4a8b2880750eea7c3cf4719322056b93cf27a2e /chromeos/chromeos_paths.cc
parenta74e97b511adc4422b9c7e3a9788e3026430bb93 (diff)
downloadchromium_src-53a23380c25032a67b620356b1521d69e3a15d04.zip
chromium_src-53a23380c25032a67b620356b1521d69e3a15d04.tar.gz
chromium_src-53a23380c25032a67b620356b1521d69e3a15d04.tar.bz2
Use machine-info stub with serial number for CHROMEOS=1 builds.
The current practice is reading the serial number from /tmp/machine-info if it exists and generating a random one otherwise. This makes re-enrollment testing (which requires a stable serial number) somewhat cumbersome. This CL creates a machine-info stub in the profile directory so that re-enrollment can be tested without the need of manually creating a stub file and without interference between multiple profiles on the same machine. BUG=none Review URL: https://codereview.chromium.org/790673003 Cr-Commit-Position: refs/heads/master@{#308852}
Diffstat (limited to 'chromeos/chromeos_paths.cc')
-rw-r--r--chromeos/chromeos_paths.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/chromeos/chromeos_paths.cc b/chromeos/chromeos_paths.cc
index 659c240..07b7f9f 100644
--- a/chromeos/chromeos_paths.cc
+++ b/chromeos/chromeos_paths.cc
@@ -29,6 +29,9 @@ const base::FilePath::CharType kOwnerKeyFileName[] =
const base::FilePath::CharType kInstallAttributesFileName[] =
FILE_PATH_LITERAL("/var/run/lockbox/install_attributes.pb");
+const base::FilePath::CharType kMachineHardwareInfoFileName[] =
+ FILE_PATH_LITERAL("/tmp/machine-info");
+
const base::FilePath::CharType kUptimeFileName[] =
FILE_PATH_LITERAL("/proc/uptime");
@@ -58,6 +61,9 @@ bool PathProvider(int key, base::FilePath* result) {
case FILE_INSTALL_ATTRIBUTES:
*result = base::FilePath(kInstallAttributesFileName);
break;
+ case FILE_MACHINE_INFO:
+ *result = base::FilePath(kMachineHardwareInfoFileName);
+ break;
case FILE_UPTIME:
*result = base::FilePath(kUptimeFileName);
break;
@@ -105,6 +111,11 @@ void RegisterStubPathOverrides(const base::FilePath& stubs_dir) {
parent.AppendASCII("stub_install_attributes.pb"),
is_absolute,
create);
+ PathService::OverrideAndCreateIfNeeded(
+ FILE_MACHINE_INFO,
+ parent.AppendASCII("stub_machine-info"),
+ is_absolute,
+ create);
PathService::Override(
DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS,
parent.AppendASCII("stub_device_local_account_extensions"));