History log of /system/update_engine/common/utils_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d5c120ed8f5b37d9091f71b8fc2d0d762bcd7971 23-Aug-2016 Alex Deymo <deymo@google.com> Lazy unmount postinstall if it fails to unmount.

If postinstall forks a new child that's not killed when killing the main
postinstall process or if postinstall makes any other running process to
hold a file descriptor open in the mounted filesystem, the filesystem is
busy an we can't unmount /postinstall. Since the postinstall mountpoint is
fix in Android, we need to force a lazy unmount in order for the process
to succeed in a future run.

This case can only occur when canceling an update during postinstall (for
example if the update was retried from the server) and would otherwise
clear itself after a few unmount retries if the process using the fd
stops using it.

Bug: 31021934
Test: Added native tests to excersice this case.

(cherry picked from commit 5ba93ad42fad1efc40ae2e7abcda9c8793363508)

Change-Id: I3464377b43e2ee79cd7318dbc9d3a62706c6ea6c
/system/update_engine/common/utils_unittest.cc
bffa06080ec8bd5d196cbfadf2023f78b6e89169 13-Feb-2016 Alex Deymo <deymo@google.com> Fix *ExtentWriterTest unittest.

These test were creating local files in the same directory where the
test is running from, which doesn't work on Android. This patch
leverages other newer temp file creation utilities that also take
care of removing the temp files.

Bug: 26955860
TEST=/data/nativetest/update_engine_unittests/update_engine_unittests --gtest_filter=*ExtentWriterTest.*

Change-Id: If5cd506ae0a7ca85b6fd5395a0982f00775836c7
/system/update_engine/common/utils_unittest.cc
5fe0c4ede81b82ae3425ddbbb698eceef14cbc78 17-Feb-2016 Alex Deymo <deymo@google.com> Fix unittest build in x86_64.

Some size_t values (generally resulting from X.size() calls) were
compared to off_t values (such as utils::FileSize()) which resulted
in a compile error on x86_64 targets. This patch fixes those issues
with explicit casts in the unittests since the range of the expected
values is small enough.

Bug: 26955860
TEST=`mma` on edison-eng and brilloemulator_x86_64-eng.

Change-Id: I2d09d356e1b97ab6527b17596fe20d425da6d519
/system/update_engine/common/utils_unittest.cc
80f70ff45f8ea9a679c0c3ed0dc143dd2fe2b63e 11-Feb-2016 Alex Deymo <deymo@google.com> Build unittests in Brillo.

Many unittests do not pass for simple reasons that will be addressed
later. This CL includes all the changes to make the unittests build.
In particular, the generated DBus mocks, required to build several
unittests are now included here.

The dbus-constants.h files were moved to the system_api repo, so they
can be removed from here.

The unittest build is only enabled for Brillo targets, since non-Brillo
targets don't even build DBus.

Bug: 26955860
TEST=`mmma` on edison-eng (and aosp_arm-eng).

Change-Id: Ib38241f0a6eb99b1d60d72db6bcfd125d38e3fad
/system/update_engine/common/utils_unittest.cc
ab0d976fa47844870d55c87ab530072cea0c8c53 02-Feb-2016 Alex Deymo <deymo@google.com> CPULimiter: Refactor class to manage the CPU limitation.

This new class replaces the functionality embedded in UpdateAttempter
that limits the max CPU usage allowed by update_engine. This refactor
helps reusing this class outside of the brillo UpdateAttempter.

Bug: None
TEST=FEATURES=test emerge-link update_engine

Change-Id: Ib5487d314846b497a44bb78a3b94609571e0fe38
/system/update_engine/common/utils_unittest.cc
a2591795edb1a4f4c751347daab16c70daad1274 17-Nov-2015 Alex Deymo <deymo@google.com> Move metrics time helpers to metrics_utils.

The metrics module reports metrics periodically, for which it needs to
keep track of the duration since some events (for example, the update
finished). These helpers were in the common/utils.h, but they rely on
the global SystemState to access both Prefs and Clock.

Since these helpers are specific to the metric reporting, this CL moves
them to the metrics_utils.h module.

Bug: 25197634
TEST=FEATURES=test emerge-link update_engine; mmma system/update_engine

Change-Id: Ia48091adbdc56c339c69c86c91c5c01aa58c54fb
/system/update_engine/common/utils_unittest.cc
38429cf76aaac8c499004b6f537229a26b381602 12-Nov-2015 Alex Deymo <deymo@google.com> common: Split out metrics utils from utils.cc.

The utility functions to convert error codes and network settings to
the types defined by the metrics framework are split out the utils.cc
file. These tools are only used by the update_engine daemon to report
back metrics on an update check.

Bug: 25197634
Test: FEATURES=test emerge-link update_engine; mma

Change-Id: I589dc9f6056fb1399fa84ca4f44076ed3a6b5365
/system/update_engine/common/utils_unittest.cc
39910dcd1d68987ccee7c3031dc269233a8490bb 10-Nov-2015 Alex Deymo <deymo@google.com> Split payload application code into a subdirectory.

This patch splits from the main libupdate_engine code the part that
is strictly used to download and apply a payload into a new static
library, moving the code to subdirectories. The new library is divided
in two subdirectories: common/ and payload_consumer/, and should not
depend on other update_engine files outside those two subdirectories.
The main difference between those two is that the common/ tools are more
generic and not tied to the payload consumer process, but otherwise they
are both compiled together.

There are still dependencies from the new libpayload_consumer library
into the main directory files and DBus generated files. Those will be
addressed in follow up CLs.

Bug: 25197634
Test: FEATURES=test emerge-link update_engine; `mm` on Brillo.

Change-Id: Id8d0204ea573627e6e26ca9ea17b9592ca95bc23
/system/update_engine/common/utils_unittest.cc