History log of /system/update_engine/update_manager/fake_update_manager.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
aea4c1cea20dda7ae7e85fc8924a2d784f70d806 20-Aug-2015 Alex Deymo <deymo@google.com> Re-license update_engine to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi files, the NOTICE was
replaced with a copy of the Apache2 license and MODULE_LICENSE_* file
was updated.

BUG=b/23084294
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: Ie5083750755f5180a8a785b24fe67dbf9195cd10
/system/update_engine/update_manager/fake_update_manager.h
fd45a731d9f9176ce134b34e2a84acc0cf403d1d 08-Aug-2014 Gilad Arnold <garnold@chromium.org> update_engine: UM: Async request expiration handled differently.

As discussed on the tracker issue, we're changing the way an async
policy request expiration timeout is being handled: instead of failing
the policy request entirely, this now only causes the UpdateManager to
dump the evaluation context, reset the expiration deadline and
reevaluate the policy (which is necessary in order for evaluation time
and corresponding timeouts to be recomputed). This is aimed to ensure
that policies are allowed to block for arbitrarily long periods, while
still emitting useful information to the log (which will help diagnose
if this is due to an implementation error).

Since the expiration timeout no longer returns control to the caller, we
remove it from the AsyncPolicyRequest() API. Instead, we use a single
timeout value, which is set during the UpdateManager construction and
used for all policy calls. By default, the update engine sets it to 12
hours; for testing and debugging purposes, a smaller value is used.

This CL also forbids the default (fallback) policy from blocking,
forcing a failure instead; a situation like that makes no sense anyway,
and may lead to inconsistent return values leaking to the caller.

BUG=chromium:401687
TEST=Unit tests.

Change-Id: I0bf60875bb7f524c99ed72dac61720633ab2061b
Reviewed-on: https://chromium-review.googlesource.com/211647
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
/system/update_engine/update_manager/fake_update_manager.h
a23e408368ad34e21ee90ebd0dcb55cd03417d22 17-Jul-2014 Gilad Arnold <garnold@chromium.org> update_engine: UM: Make DefaultPolicy::UpdateCheckAllowed stateful.

This adds an auxiliary state to DefaultPolicy, and makes
UpdateCheckAllowed use it for recording the last time an update check
was allowed. This is necessary for enforcing a minimum interval between
consecutive update checks, a necessary property in the unlikely case
that the main policy is badly screwed: with it, the update engine will
repeatedly check for updates, unnecessarily consuming local resources
and potentially DDoS-ing Omaha.

In order to track time, the DefaultPolicy now takes a ClockInterface
argument; for backward compatibility with existing unit testing code, we
allow this handle to be null, in which case time is not tracked and the
policy resorts to the previous default behavior (namely, updates are
always allowed). We do plug a clock when DefaultPolicy is used in the
UpdateManager production (backup policy) and fake (main policy)
implementations.

Note that the state is added as an external object, in order to work
around the constness of policy objects that's implied by the policy API
(const methods).

Finally, it should be noted that we use monotonic time in order to
ensure that the DefaultPolicy does not become an attack surface for
denying updates, or exhausting local resources and/or DoS-ing services.

BUG=chromium:394778
TEST=Unit tests.

Change-Id: I08628ea9b0067fa7abf6e457c55d4ffea276c463
Reviewed-on: https://chromium-review.googlesource.com/208732
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
/system/update_engine/update_manager/fake_update_manager.h
48415f1f6c6c356bfa9ac85b76d8ebcf053f7157 27-Jun-2014 Gilad Arnold <garnold@chromium.org> UpdateManager: Adjustments for cpplint.

- Rename header file guards.

- Added missing #includes.

Note that the linter still barks about C++11-style curly-braced member
initialization; there are abundant uses of this and we should probably
upstream a change to accommodate that.

BUG=None
TEST=Builds.

Change-Id: Icccc88e6e56e56f644536147cd88ae92462a1495
Reviewed-on: https://chromium-review.googlesource.com/205894
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
/system/update_engine/update_manager/fake_update_manager.h
b227199133f2d694414293697c67599a761f23be 19-Jun-2014 Gilad Arnold <garnold@chromium.org> UM: Make the evaluation timeout configurable.

This allows the client to construct the UpdateManager with a custom
evaluation timeout for sync policy requests, which is in turn being
passed to each EvaluationContext instance used for sync policy
evaluation.

BUG=chromium:363790
TEST=Unit tests.

Change-Id: I5a6ec02a3ca2a2c611276eacbcda6aac8304e929
Reviewed-on: https://chromium-review.googlesource.com/204687
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
/system/update_engine/update_manager/fake_update_manager.h
63784a578dd26880454d70797519358a2326291b 28-May-2014 Alex Deymo <deymo@chromium.org> Rename the PolicyManager to UpdateManager.

This change renames the PolicyManager class, directory, tests, etc,
to avoid confusion with libpolicy and its classes.

BUG=chromium:373551
TEST=emerged on link.
CQ-DEPEND=CL:I43081673c7ba409f02273197da7915537bde39c6

Change-Id: Iffa76caa3b95ecbbdba87ab01006d1d8ce35a27f
Reviewed-on: https://chromium-review.googlesource.com/201876
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/system/update_engine/update_manager/fake_update_manager.h