Add EC and Firmware Versions to the Omaha Response.
This CL adds 2 additional utils methods to get the version for both the
fw and ec versions. I've added a unittest to verify these work and piped
in the values into the omaha response.
BUG=chromium:219871
TEST=Unittests + on device
Change-Id: Iadf70fff858988f52797d94bcdb062bb2482bbf3
Reviewed-on: https://gerrit.chromium.org/gerrit/49713
Commit-Queue: Chris Sosa <[email protected]>
Reviewed-by: Chris Sosa <[email protected]>
Tested-by: Chris Sosa <[email protected]>
diff --git a/omaha_request_params_unittest.cc b/omaha_request_params_unittest.cc
index c12abcb..986aacb 100644
--- a/omaha_request_params_unittest.cc
+++ b/omaha_request_params_unittest.cc
@@ -577,4 +577,23 @@
EXPECT_EQ("r", out.GetAppId());
}
+TEST_F(OmahaRequestParamsTest, CollectECFWVersionsTest) {
+ ASSERT_TRUE(WriteFileString(
+ kTestDir + "/etc/lsb-release",
+ "CHROMEOS_RELEASE_APPID=r\n"
+ "CHROMEOS_CANARY_APPID=c\n"
+ "CHROMEOS_RELEASE_TRACK=stable-channel\n"));
+ MockSystemState mock_system_state;
+ OmahaRequestParams out(&mock_system_state);
+ out.hwid_ = string("STUMPY ALEX 12345");
+ EXPECT_FALSE(out.CollectECFWVersions());
+
+ out.hwid_ = string("SNOW 12345");
+ EXPECT_TRUE(out.CollectECFWVersions());
+
+ out.hwid_ = string("SAMS ALEX 12345");
+ EXPECT_TRUE(out.CollectECFWVersions());
+}
+
+
} // namespace chromeos_update_engine