update_engine: Support milestones to EOL from Omaha
Initiative to show EOL message on Chrome OS devices require that
update_engine parses the fields within Omaha response that pertain to the
new milestones to EOL field. The Omaha response will include a new
field called "milestones_to_eol" which will be an integer value
string.
The job of update_engine when it comes to milestones to EOL from Omaha
is to merely forward. No checks and no modifications of fields are
done within update_engine besides being able to convert the milestones
to EOL from a string to integer.
BUG=chromium:994999
TEST=FEATURES="test" emerge-$BOARD update_engine update_engine-client
TEST=cros deploy $IP update_engine update_engine-client
TEST=test_that -b $BOARD $IP autoupdate_EOL # from Cq-Depend
TEST=test_that -b $BOARD $IP autoupdate_EOL.milestones # from Cq-Depend
Cq-Depend:chromium:1761371
Change-Id: I268e4c8e641b17d6a727a50f53285cc97c76eb22
Reviewed-on: https://chromium-review.googlesource.com/1759285
Tested-by: Jae Hoon Kim <kimjae@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/update_engine_client.cc b/update_engine_client.cc
index 954e856..9748c4d 100644
--- a/update_engine_client.cc
+++ b/update_engine_client.cc
@@ -41,6 +41,7 @@
using chromeos_update_engine::EolStatus;
using chromeos_update_engine::ErrorCode;
+using chromeos_update_engine::MilestonesToEol;
using chromeos_update_engine::UpdateEngineStatusToString;
using chromeos_update_engine::UpdateStatusToString;
using chromeos_update_engine::utils::ErrorCodeToString;
@@ -559,12 +560,20 @@
}
if (FLAGS_eol_status) {
- int eol_status;
- if (!client_->GetEolStatus(&eol_status)) {
- LOG(ERROR) << "Error getting the end-of-life status.";
+ int eol_status, milestones_to_eol;
+ if (!client_->GetEolStatus(&eol_status, &milestones_to_eol)) {
+ LOG(ERROR) << "Error getting the end-of-life status and milestones to "
+ "end-of-life.";
} else {
EolStatus eol_status_code = static_cast<EolStatus>(eol_status);
- printf("EOL_STATUS=%s\n", EolStatusToString(eol_status_code));
+ MilestonesToEol milestones_to_eol_code = milestones_to_eol;
+ printf(
+ "EOL_STATUS=%s\n"
+ "MILESTONES_TO_EOL=%s\n",
+ EolStatusToString(eol_status_code),
+ chromeos_update_engine::MilestonesToEolToString(
+ milestones_to_eol_code)
+ .c_str());
}
}