History log of /system/update_engine/fake_system_state.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
33e91e78bfe98c063b0c3b6d590976e275685686 01-Dec-2015 Alex Deymo <deymo@google.com> Fix certificate checker callback lifetime.

OpenSSL's SSL_CTX_set_verify() function allows us to set a callback
called after certificate validation but doesn't provide a way to pass
private data to this callback. CL:183832 was passing the pointer to the
CertificateChecker instance using a global pointer, nevertheless the
lifetime of this pointer was wrong since libcurl can trigger this
callback asynchronously when the SSL certificates are downloaded.

This patch converts the CertificateChecker into a singleton class and
uses the same trick previously used to pass the ServerToCheck value
using different callbacks.

Bug: 25818567
Test: Run an update on edison-userdebug; FEATURES=test emerge-link update_engine

Change-Id: I84cdb2f8c5ac86d1463634e73e867f213f7a2f5a
/system/update_engine/fake_system_state.cc
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/fake_system_state.cc
305345001d85ca2282112c2a30fe75c7a4773491 21-Jul-2015 Alex Deymo <deymo@chromium.org> update_engine: Switch to chrome-dbus for client requests in update_engine

update_engine daemon acts as DBus client to send DBus calls to shill,
power_manager and chrome, and to listen for signals from shill, chrome
and login_manager. This patch migrates these calls and signals to use
chrome-dbus framework instead of dbus-glib.

All references to dbus-glib code are removed.

BUG=chromium:419827
TEST=Updated unittest. Deployed on a link device and tested interactions with shill and chromium.

Change-Id: I31b389e0d1690cccb115ff3b6539c876ba81bd0e
Reviewed-on: https://chromium-review.googlesource.com/290990
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
f6ee0163504eaf1a7cc136ba2c075d77ae2b4dd5 31-Jul-2015 Alex Deymo <deymo@chromium.org> update_engine: Move ConnectionManager to an abstract Interface.

MockConnectionManager required to use one of ConnectionManager
constructors passing pointers that won't be use by the mock. This
patch moves the interface to its own ConnectionManagerInterface class.

BUG=None
TEST=unittests still pass.

Change-Id: I9ed09daf8e4256304be7dab30cfbe751901dc24b
Reviewed-on: https://chromium-review.googlesource.com/290120
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
f329b933db41d26644a97afef928eb1b319d6d99 30-Oct-2014 Alex Deymo <deymo@chromium.org> update_engine: Fix all the "using" declaration usage.

This patch removes unused "using" declarations, that is, declarations
included in a .cc file at a global scope such that "using foo::bar"
that later don't use the identifier "bar" at all.

This also unifies the usage of these identifiers in the .cc files
in favor of using the short name defined by the using declaration.
For example, in several cases the .h refer to a type like
"std::string" because using declarations are forbidden in header
files while the .cc includes "using std::string;" with the purpose
of just writting "string" in the .cc file. Very rarely, the full
identifier is used when a local name ocludes it, for example,
StringVectorToGStrv() and StringVectorToString() in utils.cc named
its argument just "vector" need to refer to std::vector with the
full name. This patch renames those arguments instead.

Finally, it also sorts a few lists of using declarations that weren't
in order.

BUG=None
TEST=FEATURES=test emerge-link update_engine

Change-Id: I30f6b9510ecb7e03640f1951c48d5bb106309840
Reviewed-on: https://chromium-review.googlesource.com/226423
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
560ae1da0e62f7897699f63631452f0c4144d413 28-Oct-2014 Alex Deymo <deymo@chromium.org> update_engine: Mock out UpdateAttempter and OmahaRequestParams.

These classes are used by other classes so we need to have a way to
unit test those. This patch converts some public methods on these
classes to virtual methods so they can be mocked. It implements a
new MockOmahaRequestParams with all the public methods behaving like
the real object by default. This is now the default class used by the
FakeSystemState. Finally, the UpdateAttempterMock is renamed to
MockUpdateAttempter to be more consistent with other classes in
the project.

BUG=None
TEST=Unittest pass. Follow up CL using these classes also passes.

Change-Id: Iacb7e19d10c1526cea9659c27ab798cad126816f
Reviewed-on: https://chromium-review.googlesource.com/225855
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
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/fake_system_state.cc
7d623ebf9eee346fdeee71f1ccb32ebaf4bd3318 14-May-2014 Nam T. Nguyen <namnguyen@chromium.org> update_engine: Remove GPIO support.

We have not used GPIO since Jan 2013. This CL removes the GPIO handling code.
As a side effect, it also removes dependency on libudev.

BUG=chromium:221725
CQ-DEPEND=CL:199683
TEST=unittest
TEST=AU end2end test on real device from older version to a version that
has CL applied, then from that to another newer version (need not have
this CL applied).

Change-Id: I4352488ec360b44a44b137c40a3ae4ec35c6fe9d
Reviewed-on: https://chromium-review.googlesource.com/199626
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Nam Nguyen <namnguyen@chromium.org>
Tested-by: Nam Nguyen <namnguyen@chromium.org>
/system/update_engine/fake_system_state.cc
680d022b08b1368ddbea970a75ebff7c642f2621 25-Apr-2014 Alex Deymo <deymo@chromium.org> PolicyManager: Remove unnecessary Init() methods.

The PolicyManager::Init() method always return true as it can't
really fail. This patch removes it and simplifies the interface
on the FakePolicyManager to make it easier to use it on Policy
unit testing exposing the FakeState there.

BUG=chromium:358269
TEST=Build and unittests.

Change-Id: Ib27dd41a483b10f164810e18585a8e4b4cb92f5a
Reviewed-on: https://chromium-review.googlesource.com/196968
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
42c30c376cb7b0b459ff0cbf3ac23fe87ea64f4d 25-Apr-2014 Alex Deymo <deymo@chromium.org> PolicyManager: Move Init() from the Provider class to the classes that require it.

Not all the providers require an Init() method, and not all of them
can fail. For example, none of the Fake version of the providers
require an special initialization on a separated method.

This patch moves those Init() methods from the base Provider class
to the classes that require it. When you create a class Foo instance,
it is your responsibility to call Foo::Init(), and since you know the
type of the instance you are creating, you know what to expect from
its Init() method. This patch simplifies the FakeState class while
removing the Init() methods from those classes.

Init() methods are simply a way to have a constructor that can fail
without using exceptions and it is the style's guide recommended way
to have the same functionality.

BUG=chromium:358269
TEST=Build and unit test still passing.

Change-Id: Ida7d2cc1a494998144ca5c488513c85223def626
Reviewed-on: https://chromium-review.googlesource.com/196971
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
41a75a7ca3f0252f2c9f991dd465aa332e7ce4d1 16-Apr-2014 Alex Deymo <deymo@chromium.org> PolicyManager: Extend the EvaluationContext to handle IsTimeGreaterThan()

The EvaluationContext needs to know the point in time where the
current evaluation of a policy request started to be able to handle
time based values like IsTimeGreaterThan() efficiently and the
timeout for the current evaluation. This patch adds such method to
the EvaluationContext class and exposes a new ResetEvaluation()
method to allow restart an evaluation. The restart of an evaluation
is independent from the notification mechanism implemented by
RunOnValueChangeOrTimeout().

The documentation on the header file is updated and extended with an
example of the workflow.

BUG=chromium:358451
TEST=Unittests added.

Change-Id: I50b6ef9d582434d6ba0f466f7e650e4a2b442249
Reviewed-on: https://chromium-review.googlesource.com/195230
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/fake_system_state.cc
5bb4c90b8bdf931426d1926b21b0316a86b4b4e4 10-Apr-2014 Gilad Arnold <garnold@chromium.org> Rename MockSystemState into FakeSystemState.

This class is no longer a mock. The change also includes renaming the
appropriate files and the instances of this class.

BUG=chromium:358278
TEST=Unit tests.

Change-Id: Ifc20ead0d624eddf8827a6e6f39cd9b9207dcabf
Reviewed-on: https://chromium-review.googlesource.com/194088
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
/system/update_engine/fake_system_state.cc