AU: Send board (e.g. x86-generic) to update server in query.
BUG=None
TEST=Attached Unittests
Review URL: http://codereview.chromium.org/2827032
diff --git a/delta_performer_unittest.cc b/delta_performer_unittest.cc
index fb9aabc..89999eb 100755
--- a/delta_performer_unittest.cc
+++ b/delta_performer_unittest.cc
@@ -214,7 +214,6 @@
// Wrapper around close. Returns 0 on success or -errno on error.
EXPECT_EQ(0, performer.Close());
- CompareFilesByBlock("/tmp/a_ref", "/tmp/b_ref");
CompareFilesByBlock(old_kernel, new_kernel);
vector<char> updated_kernel_partition;
diff --git a/omaha_request_prep_action.cc b/omaha_request_prep_action.cc
index 25772d0..7163119 100644
--- a/omaha_request_prep_action.cc
+++ b/omaha_request_prep_action.cc
@@ -36,12 +36,14 @@
const string track(GetLsbValue("CHROMEOS_RELEASE_TRACK", ""));
const string update_url(GetLsbValue("CHROMEOS_AUSERVER",
UpdateCheckParams::kUpdateUrl));
+ const string board(GetLsbValue("CHROMEOS_RELEASE_BOARD", ""));
UpdateCheckParams out(machine_id, // machine_id
machine_id, // user_id (use machine_id)
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
sp, // e.g. 0.2.3.3_i686
+ board, // e.g. x86-generic
UpdateCheckParams::kAppId,
version, // app version (from lsb-release)
"en-US", // lang
diff --git a/omaha_request_prep_action_unittest.cc b/omaha_request_prep_action_unittest.cc
index 01016c3..1397c4d 100644
--- a/omaha_request_prep_action_unittest.cc
+++ b/omaha_request_prep_action_unittest.cc
@@ -111,6 +111,7 @@
{
ASSERT_TRUE(WriteFileString(
kTestDir + "/etc/lsb-release",
+ "CHROMEOS_RELEASE_BOARD=arm-generic\n"
"CHROMEOS_RELEASE_FOO=bar\n"
"CHROMEOS_RELEASE_VERSION=0.2.2.3\n"
"CHROMEOS_RELEASE_TRACK=footrack"));
@@ -121,6 +122,7 @@
EXPECT_TRUE(IsValidGuid(out.user_id)) << "id: " << out.user_id;
EXPECT_EQ("Chrome OS", out.os_platform);
EXPECT_EQ(string("0.2.2.3_") + GetMachineType(), out.os_sp);
+ EXPECT_EQ("arm-generic", out.os_board);
EXPECT_EQ("{87efface-864d-49a5-9bb3-4b050a7c227a}", out.app_id);
EXPECT_EQ("0.2.2.3", out.app_version);
EXPECT_EQ("en-US", out.app_lang);
diff --git a/update_check_action.cc b/update_check_action.cc
index 98ff3dc..fa8d697 100644
--- a/update_check_action.cc
+++ b/update_check_action.cc
@@ -74,7 +74,8 @@
" <o:app appid=\"" + XmlEncode(params.app_id) + "\" version=\"" +
XmlEncode(params.app_version) + "\" "
"lang=\"" + XmlEncode(params.app_lang) + "\" track=\"" +
- XmlEncode(params.app_track) + "\">\n"
+ XmlEncode(params.app_track) + "\" board=\"" +
+ XmlEncode(params.os_board) + "\">\n"
" <o:ping active=\"0\"></o:ping>\n"
" <o:updatecheck></o:updatecheck>\n"
" </o:app>\n"
diff --git a/update_check_action.h b/update_check_action.h
index 831039d..4e759bd 100644
--- a/update_check_action.h
+++ b/update_check_action.h
@@ -36,6 +36,7 @@
const std::string& in_os_platform,
const std::string& in_os_version,
const std::string& in_os_sp,
+ const std::string& in_os_board,
const std::string& in_app_id,
const std::string& in_app_version,
const std::string& in_app_lang,
@@ -46,6 +47,7 @@
os_platform(in_os_platform),
os_version(in_os_version),
os_sp(in_os_sp),
+ os_board(in_os_board),
app_id(in_app_id),
app_version(in_app_version),
app_lang(in_app_lang),
@@ -57,6 +59,7 @@
std::string os_platform;
std::string os_version;
std::string os_sp;
+ std::string os_board;
std::string app_id;
std::string app_version;
std::string app_lang;
diff --git a/update_check_action_unittest.cc b/update_check_action_unittest.cc
index c730b40..e2e7410 100644
--- a/update_check_action_unittest.cc
+++ b/update_check_action_unittest.cc
@@ -159,6 +159,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"", // os_sp
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -180,6 +181,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "arm-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -215,6 +217,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"", // os_sp
+ "", // os_board
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -248,6 +251,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -269,6 +273,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -293,6 +298,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -317,6 +323,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -341,6 +348,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -400,6 +408,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"", // os_sp
+ "", // os_board
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -440,6 +449,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"testtheservice_pack>",
+ "x86 generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -460,6 +470,7 @@
EXPECT_EQ(post_str.find("testtheuser_id<"), string::npos);
EXPECT_NE(post_str.find("testtheservice_pack>"), string::npos);
EXPECT_EQ(post_str.find("testtheservice_pack>"), string::npos);
+ EXPECT_NE(post_str.find("x86 generic"), string::npos);
}
TEST(UpdateCheckActionTest, XmlDecodeTest) {
@@ -468,6 +479,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "x86-generic",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",
@@ -498,6 +510,7 @@
UpdateCheckParams::kOsPlatform,
UpdateCheckParams::kOsVersion,
"service_pack",
+ "the_board",
UpdateCheckParams::kAppId,
"0.1.0.0",
"en-US",