update_engine: Add helpful messages about lsb-release file.
In some unit tests we either don't have /etc/lsb-release or we don't
have a real clock and the (non-fatal) error messages about this can be
confusing. Rectify this by pointing out that these error messages may
occur in some unit tests.
BUG=chromium:401862
TEST=Unit tests pass.
Change-Id: Ie5298f0c6e8689c43ffc3c89aebf7690937a7518
Reviewed-on: https://chromium-review.googlesource.com/213545
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/update_attempter.cc b/update_attempter.cc
index 05cfd49..6768529 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -193,7 +193,8 @@
return;
if (stat("/etc/lsb-release", &sb) != 0) {
- PLOG(ERROR) << "Error getting file status for /etc/lsb-release";
+ PLOG(ERROR) << "Error getting file status for /etc/lsb-release "
+ << "(Note: this may happen in some unit tests)";
return;
}
@@ -202,7 +203,8 @@
base::TimeDelta age = now - lsb_release_timestamp;
if (age.InSeconds() < 0) {
LOG(ERROR) << "The OS age (" << utils::FormatTimeDelta(age)
- << ") is negative. Maybe the clock is wrong?";
+ << ") is negative. Maybe the clock is wrong? "
+ << "(Note: this may happen in some unit tests.)";
return;
}