History log of /system/update_engine/omaha_request_params.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a3cf75a1d01aeb03d2341600ebff3db0a8316200 20-Jan-2016 Alex Vakulenko <avakulenko@google.com> update_engine: Update libchrome APIs to r369476

The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.

(cherry picked from commit 0103c36caa2e38e034e0d22185736b9ccfb35c58)

Change-Id: I3dedd8b3f6e92ce8d3eeef99a76ad876c29db304
/system/update_engine/omaha_request_params.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/omaha_request_params.cc
d942f9d3c8529f896329b19261df6eba044de1b2 07-Nov-2015 Alex Deymo <deymo@google.com> Return the error reason to the caller of SetTargetChannel.

This patch sends back to the caller an error message indicating why the
channel change didn't work.

Bug: 25595865
Test: Deployed on a device and attempted to change to "foo" channel. Error message lists available channels.
Test: FEATURES=test emerge-link update_engine

Change-Id: Idcc67d5c7878ce7af60652d7bf5bf81135325f97
/system/update_engine/omaha_request_params.cc
3be05c82442b2fbab693b6399f64610e8542462b 23-Oct-2015 Alex Deymo <deymo@google.com> Fix use-after-free in unittest setup code.

When setting the root prefix in a unittest, we need to reset it after
so it isn't accidentally used by other tests.

Bug: chromium:547127
Test: USE="clang asan" FEATURES=test emerge-link update_engine

Change-Id: Ib84bbf265a380976407100a4fba4d2600d62dde6
/system/update_engine/omaha_request_params.cc
856166594771c61973856f563e622ccb7dd48aa1 16-Oct-2015 Alex Deymo <deymo@google.com> Read ProductId, ProductVersion and Channel setting in Brillo.

The ProductId, ProductVersion and current/target channels are specified
in a very different way in Brillo compared to Chrome OS. This patch
moves the logic to read and parse /etc/lsb-release in Chrome OS to a
new image_properties module and implements the equivalent module in
Brillo.

This new module replaces some of the logic previously in the
OmahaRequestParams class, both for parsing the read-only properties
from the rootfs and parsing and storing the target channel in the
stateful partition. The Chrome OS version of the new module keeps the
same behavior, except that it falls back to "stable-channel" if the
the current channel is missing in the rootfs (unlikely in Chrome OS).

On the other hand, the new Brillo implementation reads these settings
from the /etc/osrelease file and /etc/osrelease.d directory and doesn't
allow to override those setting during development. The persisted
target_channel and powerwash_allowed settings are stored in Prefs
as many other settings. Finally, since Brillo images don't contain
a channel name baked in the image, we store the channel name where we
got the image from at the time of the update. The first boot after
provisioning will default to "stable-channel".

Bug: 25013069
Test: unittest in Chrome OS; `mm` and tested on a Brillo device.

Change-Id: Icc114b8098af3edaaba715c9c2e3ebe9f417c876
/system/update_engine/omaha_request_params.cc
3f39d5cc753905874d8d93bef94f857b8808f19e 13-Oct-2015 Alex Vakulenko <avakulenko@google.com> update_engine: Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

Bug: 24872993
Change-Id: I770659a95be380a50fe3b2ba9f91d65818f40945
/system/update_engine/omaha_request_params.cc
ac41a82e4be1be43913292d13d58b5eb2c572f53 16-Sep-2015 Alex Deymo <deymo@google.com> Set default updater URL and version per platform.

Chrome OS and Brillo devices require different production update URL
and updater string ID sent to Omaha. This patch moves these constants
to a platform-dependent file with the definition of the constants.

Bug: brillo:587,brillo:588
Test: FEATURES=test emerge-link update_engine; `mma`; deployed on a dragonboard.

Change-Id: Ibe3b30c32c2fb2caf3ed10a4198272dc13a44d12
/system/update_engine/omaha_request_params.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/omaha_request_params.cc
6a9d3497bcf57b8b9f5765a2909a51c9f8119cd1 15-Jun-2015 Alex Vakulenko <avakulenko@chromium.org> platform2: Fix issues with new version of libchrome

libchrome r334380 has the following breaking changes that need to be fixed:
- base::JSONWriter::Write() and base::JSONWriter::WriteWithOptions() take
"const base::Value&" instead of "const base::Value*"
- base::JSONReader::Read() and base::JSONReader::ReadAndReturnError()
return a scoped_ptr<base::Value> instead of base::Value*
- base/safe_strerror_posix.h is moved to base/posix/safe_strerror.h
- safe_strerror() is now in "base" namespace
- StartsWithASCII(), EndsWith(), StringToUpperASCII(), LowerCaseEqualsASCII()
are now in "base" namespace
- ObserverList<T> is now in "base" namespace
- base::PrintTo(base::FilePath) used in gtest is now moved to libchrome-test
library and as such, unit test runners need to link to this library now.
- crypto::RSAPrivateKey::CreateSensitive() is now removed from //crypto, so
some of tests in chromeos-login that used that function had to be changed
to use crypto::GenerateRSAKeyPairNSS() directly.
- UnixDomanSocket class is now in "base" namespace
- Pickle class is now in "base" namespace

BUG=chromium:496469
TEST=`./build_packages`
CQ-DEPEND=CL:277662

Change-Id: I36e5fbf2e36a92068873ffbd44020c862a3ed9e3
Reviewed-on: https://chromium-review.googlesource.com/277671
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
/system/update_engine/omaha_request_params.cc
53c4fff61e2163c136c1d9aa6465e3390a99063b 17-Mar-2015 Yunlian Jiang <yunlian@google.com> update_engine: fix -Wbraced-scalar-init warning.

BUG=chromium:467968
TEST=the warning is gone.

Change-Id: I74b464fc0342c2e7848df2047b54cccbb2aeb52c
Reviewed-on: https://chromium-review.googlesource.com/260590
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
/system/update_engine/omaha_request_params.cc
02c1864e204997175302b1aebe3e0be9c6699ea5 06-Nov-2014 David Pursell <dpursell@chromium.org> update_engine: Allow `cros flash` on base images.

A goal of the upcoming debugd dev tools (crbug.com/403170), is to
enable a path to modify a base image such that a developer could run
`cros flash` on it.

Currently update_engine disallows custom omaha URLs and forces a hash
check for base builds, which breaks `cros flash`. This CL relaxes the
restriction slightly to allow use on a base build as long as the system
is in dev mode and the debugd dev tools are also enabled (dev tools are
currently enabled only in dev mode when there is no owner).

The check is done in update_attempter.cc, which only allows an unofficial
Omaha URL if these conditions hold true (unofficial meaning not the main
AU server or the AU test server). The other main change is
AreHashChecksMandatory() in omaha_response_handler_action.cc, which now
allows skipping hash checks for unofficial Omaha URLs.

BUG=chromium:428053
TEST=Ran unit tests, `cros flash` on base images in various states.
CQ-DEPEND=CL:227431

Change-Id: I8583ce6aa70feac8fe74b7a3992e8a4e761833c3
Reviewed-on: https://chromium-review.googlesource.com/228293
Reviewed-by: Alex Deymo <deymo@chromium.org>
Trybot-Ready: David Pursell <dpursell@chromium.org>
Commit-Queue: David Pursell <dpursell@chromium.org>
Tested-by: David Pursell <dpursell@chromium.org>
/system/update_engine/omaha_request_params.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/omaha_request_params.cc
2b4e2a5fba160365e9f9dca92d76c6e8a273ea88 23-Sep-2014 Alex Deymo <deymo@chromium.org> Move KeyValueStore to libchromeos

KeyValueStore is a key-value dictionary used to access and store settings
in a .conf file. It supports bool and strings only.

BUG=chromium:416932
TEST=FEATURES=test emerge-link libchromeos update_engine

Change-Id: I34a3add5536588ea1025976de659ad77ac6d8b39
Reviewed-on: https://chromium-review.googlesource.com/219552
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: David Pursell <dpursell@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/omaha_request_params.cc
06c76a49bfd29c8abdb8abd5b646a6583783191a 05-Sep-2014 Ben Chan <benchan@chromium.org> Update code to include base/files/file_util.h

file_util.h was moved from base to base/files
(https://codereview.chromium.org/468253002). This CL updates platform2
code to include base/files/file_util.h instead of base/file_util.h.

BUG=chromium:411001
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I488925b54615e131e508a460dc1a27f88168f936
Reviewed-on: https://chromium-review.googlesource.com/216851
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/update_engine/omaha_request_params.cc
88b591f24cb3f94f982d7024c2e8ed25c2cc26a2 29-Aug-2014 Alex Vakulenko <avakulenko@chromium.org> update_engine: Replace NULL with nullptr

Replaced the usage of NULL with nullptr. This also makes it possible to
use standard gtest macros to compare pointers in Update Manager's unit tests.
So, there is no need in custom UMTEST_... macros which are replaced with the
gtest macros (see change in update_engine/update_manager/umtest_utils.h):

UMTEST_ASSERT_NULL(p) => ASSERT_EQ(nullptr, p)
UMTEST_ASSERT_NOT_NULL(p) => ASSERT_NE(nullptr, p)
UMTEST_EXPECT_NULL(p) => EXPECT_EQ(nullptr, p)
UMTEST_EXPECT_NOT_NULL(p) => EXPECT_NE(nullptr, p)

BUG=None
TEST=FEATURES=test emerge-link update_engine
USE="clang asan" FEATURES=test emerge-link update_engine

Change-Id: I77a42a1e9ce992bb2f9f263db5cf75fe6110a4ec
Reviewed-on: https://chromium-review.googlesource.com/215136
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/update_engine/omaha_request_params.cc
d2779df63aaad8b65fc5d4badee7dbc9bed7f2b6 16-Jun-2014 Alex Vakulenko <avakulenko@chromium.org> update_engine: fixed warnings from cpplint

Fixed all the cpplint warnings in update engine.

BUG=None
TEST=Unit tests still pass.

Change-Id: I285ae858eec8abe0b26ff203b99a42a200ceb71c
Reviewed-on: https://chromium-review.googlesource.com/204027
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/update_engine/omaha_request_params.cc
a7658449213d3141ff11e4aee3531fa35ba0970d 18-Apr-2014 Alex Deymo <deymo@chromium.org> Revisit the simple_key_value_store into a class.

The simple_key_value_store was implemented as two separated functions
to parse and assemble a string containing several lines of key=value
pairs. The representation of that was passed to the caller as a
map<string, string> who would use the map operations to modify it.
Also, the inteded use for these strings was to parse and write text
files on the filesystem.

This key=value store is used to store strings and boolean values,
and will be reused for the policy manager config provider.

This patch reworks those functions as a class and adds support for
reading and writing boolean values and does the file read and write
operations as well.

BUG=chromium:359674
TEST=Unittest extended.

Change-Id: I4890c4a4ca81c1a4857e9893ea827c3fa7815aab
Reviewed-on: https://chromium-review.googlesource.com/195489
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/update_engine/omaha_request_params.cc
75039d7397f03dff77bdf4e26398049ff88edc4c 25-Mar-2014 Alex Vakulenko <avakulenko@chromium.org> update_engine: update to libbase 242728

Made update_engine link with libchrome-242728 and fixed compile
issues due to changes in namespaces and include file layout.

Also removed some of suppressed compiler warnings and fixed the
issues masked by them (e.g. mismatched printf-like specifiers).

Added -Wextra compiler option to enable additional useful warnings
to ensure more strict checking... Had to disable "unused-parameter"
though since we have a lot of functions (mainly in fakes) that do
not use all of their parameters.

BUG=chromium:351593
TEST=Unit tests passed.
CQ-DEPEND=CL:191721

Change-Id: I1aa63a48d5f1f4ea75ba6b00aec7aa5f3bad15c4
Reviewed-on: https://chromium-review.googlesource.com/191510
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
/system/update_engine/omaha_request_params.cc
056b0abc1273a6eebfd73060a1d0344ef02b8696 29-Oct-2013 J. Richard Barnette <jrbarnette@chromium.org> Move IsOfficialBuild() and IsNormalBootMode() into HardwareInterface.

This makes the implementation of the two methods part of the
HardwareInterface, so that unit tests won't end up with meaningless
(and unpredictable) calls to the real functions.

BUG=None
TEST=unit tests

Change-Id: Ia23932634124987c1d6ff0683acb15cf4819bc5e
Reviewed-on: https://chromium-review.googlesource.com/175024
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
/system/update_engine/omaha_request_params.cc
522d36ffca22b8c218cdc6a2d1dbab40f6d9b215 29-Oct-2013 J. Richard Barnette <jrbarnette@chromium.org> Move simple firmware related queries into HardwareInterface.

This change moves the following functions from utils to
HardwareInterface:
GetHardwareClass()
GetFirmwareVersion()
GetECVersion()

BUG=None
TEST=unit tests

Change-Id: I20047a3fac8cca3c36730fef305751e6da3c2bb5
Reviewed-on: https://chromium-review.googlesource.com/174930
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
/system/update_engine/omaha_request_params.cc
63137e5ded659c02eb70d59ef38f99aecac4d076 28-Oct-2013 J. Richard Barnette <jrbarnette@chromium.org> Split GetECVersion to allow saner unit testing.

Previously, GetECVersion() accepted a (const char *) parameter that
was used solely as a flag meaning "unit test this function with
the specified data in place of mosys output". This change splits
the function into GetECVersion() and ParseECVersion(), and only unit
tests the second part.

BUG=None
TEST=unit tests

Change-Id: Ic48d18c02bd1924f49a0d8f0034ccb1ae8b5231e
Reviewed-on: https://chromium-review.googlesource.com/174883
Commit-Queue: Richard Barnette <jrbarnette@chromium.org>
Tested-by: Richard Barnette <jrbarnette@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
/system/update_engine/omaha_request_params.cc
cb7fa886480e74440b41e94856cd3d12a6099e00 26-Jul-2013 Chris Sosa <sosa@chromium.org> Remove all mentions of Set/Get Track and hard-coding of canary-channel.

This CL removes the deprecated functionality of Set/Get Track previously
used to change channels. Now that the UI is using Set/Get Channel we no
longer need these methods. I've also gone ahead and fixed the long standing
bug of needed to do an update check before testing channel change.

I've also added the testing of allow powerwash functionality to update_engine
client to better test this feature.

BUG=chromium:221850
TEST=unittests + update_engine_client with channel change and allowing
powerwash and not allowing powerwash. Confirmed the versions were as expected (
when going more stable we send version 0.0.0.0 when we allow powerwash vs the
actual version when not).

Change-Id: I87297f7e7e103bb25e62f2d896e155e758030ead
Reviewed-on: https://gerrit.chromium.org/gerrit/63674
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
/system/update_engine/omaha_request_params.cc
c1972483fa3446852b42ce97d1ea43b9caaaf56f 01-May-2013 Chris Sosa <sosa@chromium.org> Add EC and Firmware Versions to the Omaha Response.

This CL adds 2 additional utils methods to get the version for both the
fw and ec versions. I've added a unittest to verify these work and piped
in the values into the omaha response.

BUG=chromium:219871
TEST=Unittests + on device

Change-Id: Iadf70fff858988f52797d94bcdb062bb2482bbf3
Reviewed-on: https://gerrit.chromium.org/gerrit/49713
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
/system/update_engine/omaha_request_params.cc
be45bef9e283188b00e7def8967f81843669a7f1 10-Apr-2013 Chris Sosa <sosa@chromium.org> Add update reboot metric to the update engine.

This change add the Installer.UpdateNumReboots metric.

This records the number of reboots that occurred while an update was being
attempted. It uses a marker file stored in tmp to discover whether or not
it's already recorded the reboot.

BUG=chromium:226766
TEST=Unittests | ran an update on a test machine and rebooted/resumed and
checked about:histograms to confirm numbers. Also restart update-engine to
verify it didn't double count that.

Change-Id: I5d2af9d5b62a9d974c7c6243a89cb3359051b650
Reviewed-on: https://gerrit.chromium.org/gerrit/47710
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
/system/update_engine/omaha_request_params.cc
db0acdfca1ea33987e8b29325f4594417d1fae57 02-Apr-2013 Jay Srinivasan <jaysri@chromium.org> Support changing from non-canary to canary channel in update engine.

Now that we have added support in lsb-release for both the board appid
and canary app id to be specified, we should use the appropriate appid
according to the channel from which we want to download the new payload.

This change in update engine will enable the change from non-canary to
canary channels. This feature when be lit up end to end when the UI for
this scenario is ready.

BUG=chromium:225866
TEST=Unit tests pass. Tested all channel changes on my ZGB.

Change-Id: Ia9c37c72f53f6c69436f0a96e35d2584d84653c8
Reviewed-on: https://gerrit.chromium.org/gerrit/47181
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
/system/update_engine/omaha_request_params.cc
1c0fe79c7ef2b43946d756b54c8505d2bf48b93b 29-Mar-2013 Jay Srinivasan <jaysri@chromium.org> Cancel the current download if user chooses a different channel.

In my earlier CL, to keep the implementation simple, we disallowed changing
a channel until the previous change completed in its entirety. Given that
the UI is not going to be updated for M27, such a restriction turned out
to be very confusing when playing around with channel changing. So, we
decided to implement a simple form of canceling the download if the
user selected a different channel while we're downloading the bits. This
implementation can easily be extended to support a general form of cancel
in the future, if required.

This CL also adds validation of libchromeos API calls when interpreting
the policy values. It also cleans up some bogus error messages that were
logged earlier when we abort a download.

BUG=chromium:222617
TEST=All scenarios pass on ZGB. Unit Tests pass.

Change-Id: I7cd691fe461d9ce47314299f6e2598944650ee33
Reviewed-on: https://gerrit.chromium.org/gerrit/46095
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
/system/update_engine/omaha_request_params.cc
ae4697c073b84b260990a141acd53c6806da0708 19-Mar-2013 Jay Srinivasan <jaysri@chromium.org> Enhanced channel changing behavior

This CL adds a new DBUS API to UpdateEngine called SetTargetChannel to
change the current channel of the device with an option to indicate
whether to do eventually or immediately.

The API will be called with the option to do it immediately in a
subsequent CL in Chrome UI. For now the old API (set_track) has been
wired up to call the new API to produce the old behavior (i.e. change
eventually). The old API will be removed after Chrome UI code stops
using it.

It's the UI's responsibility to ask the user for confirmation for the
powerwash that may happen in some cases and call the API with the
appropriate value whether or not the powerwash should happen.

For now, we're restricting the changing of channels to only those
devices that are on canary-channel or running test builds. This
restriction will be lifted off once the UI work is ready to give
warning to the users about the powerwash that may happen when they move
to a more stable channel.

We also enforce ReleaseChannelDelegated and ReleaseChannel policies
correctly now as follows:

* If ReleaseChannelDelegated is false, SetTargetChannel will fail as we
need to honor (only) the ReleaseChannel value in this case.
* If ReleaseChannelDelegated is true, we'll allow the SetTargetChannel
call to specify. In this case, we'll ignore the value of ReleaseChannel,
if any.

BUG=chromium-os:39095
TEST=Tested on ZGB by going from canary to dev-channel with and without
powerwash.
TEST=Existing unit tests have been updated and they pass.
TEST=New unit tests have been added.

Change-Id: Ifbf806a06e1c30d2f318e94d73735d1812049abd
Reviewed-on: https://gerrit.chromium.org/gerrit/44619
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
/system/update_engine/omaha_request_params.cc
bbdd4909bcd20448ad89aa1e02c936e42aedf548 11-Jan-2013 Gilad Arnold <garnold@chromium.org> AU: add an interactive flag to Omaha requests

Such a flag can be used to distinguish between user-initiated
(interactive) checks and those that are due to background scheduling. In
the former case, we may want to suppress the probabilistic throttling
that's commonly used with latest releases. This CL piggybacks the new
functionality on top of an existing dataflow used for distinguishing
between interactive / scheduled checks, only it pushes it further so it
is evident in the Omaha request as well.

Comes with a unit test for ensuring that the Omaha flag is set as
expected.

BUG=chromium-os:26594
TEST=Dbus initiated checks correctly tainted

Change-Id: Ia2b3ff5ce3a866c64e453557028b8cbd92c1a258
Reviewed-on: https://gerrit.chromium.org/gerrit/41081
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
/system/update_engine/omaha_request_params.cc
55f50c24c2624487b803ba2f93588494cc69e523 11-Jan-2013 Jay Srinivasan <jaysri@chromium.org> Segregate UMA metrics for production scenarios from test scenarios.

Currently we separate the UMA metrics only by one category: whether the
device is in dev mode or not. In addition, we need to exclude the noise
from these two categories:
1. Most of our testing on MP-signed images which are performed
with autest.
2. All our hwlab tests run in non-dev mode but they use dev-signed images
with dev-firmware keys.

So this CL defines additional bit fields to represent these states and
if any of these three flags are set, the UMA metric is sent to a
DevModeErrorCodes bucket. Thus the NormalErrorCodes bucket will have only
the production errors and thus we can monitor more effectively.

BUG=chromium-os:37613
TEST=Updated unit tests, ran on ZGB for all scenarios.
Change-Id: Id9cce33f09d1cc50cb15e67c731f7548940cbc24
Reviewed-on: https://gerrit.chromium.org/gerrit/41103
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
/system/update_engine/omaha_request_params.cc
19a45f0eda0917b7788b925b501e774208474fde 19-Jul-2012 Gilad Arnold <garnold@chromium.org> Fixes to utility / unit test related code.

* Eliminated bugs related to reading content from pipes/files, including
general cleanup/refactoring of these code pieces and API.

* Eliminated bugs related binding/unbinding of loopback devices, which
are used in unit testing.

BUG=chromium-os:31082
TEST=Builds and runs unit tests

CQ-DEPEND=Ib7b3552e98ca40b6141688e2dea5a1407db12b2a

Change-Id: Ifaab8697602a35ce7d7fb9384fdcb1ca64b72515
Reviewed-on: https://gerrit.chromium.org/gerrit/27911
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
/system/update_engine/omaha_request_params.cc
0bf896039390540c06386773fdb427e24285746a 22-Mar-2012 Don Garrett <dgarrett@google.com> Add the dogfood-channel to the list of channels we forward to Omaha.

There is code the checks channel names against an approved list and
hides any that aren't expected. I'm not sure why, but this change
adds the dogfood channel to the list of approved channels.

BUG=chromium-os:28206
TEST=Unittests updated and pass, QA will confirm in the field.

Change-Id: Ic9119d062cde83d00d66e7c9ec3143057033b454
Reviewed-on: https://gerrit.chromium.org/gerrit/18894
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Don Garrett <dgarrett@chromium.org>
/system/update_engine/omaha_request_params.cc
7fbbe8a9e57ec52f7bc597d0cb607036300ac54c 01-Aug-2011 Patrick Dubroy <dubroy@chromium.org> Update engine should use the release channel policy if it exists.

The release channel (aka update track) can be specified by a device
policy. When this is the case, the update engine should use the
value specified by the policy instead of the value specified in
/etc/lsb-release.

BUG=chromium-os:17015
TEST=Added two new tests:
- Added test that OmahaRequestParams uses the release channel passed
in to it when the value is valid, and otherwise uses /etc/lsb-release.
- Added test that the update engine correctly picks up the release
channel that's specified by the policy.

Change-Id: I2fe03712220bb3286476b12cd1f1b330ad006d7c
Reviewed-on: http://gerrit.chromium.org/gerrit/5072
Tested-by: Patrick Dubroy <dubroy@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
/system/update_engine/omaha_request_params.cc
f2065b4d77be793fe0a5b4280fe23433cbecaa1b 18-May-2011 Darin Petkov <petkov@chromium.org> AU: Use crossystem hwid to obtain the hardware class.

This is more portable than reading the HWID from the ACPI file and should work
on ARM.

BUG=chromium-os:15255
TEST=unit tests, ran AU on Cr-48, checked the Omaha update check request

Change-Id: I8a2750140da7da99c217a6976f46b1b226696276
Reviewed-on: http://gerrit.chromium.org/gerrit/1078
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
/system/update_engine/omaha_request_params.cc
dc92876513b1298537d53d1bc82d4c293b3e4d48 12-Apr-2011 Andrew de los Reyes <adlr@chromium.org> AU: stable channel

This adds a stable-channel track to the updater.

BUG=chromium-os:14071
TEST=unittests

Change-Id: I6ed83594134c06e160537638974473c119bd8874

Review URL: http://codereview.chromium.org/6823087
/system/update_engine/omaha_request_params.cc
10d02dd60d4c4f41f7f4ed92322fa7b597760118 10-Jan-2011 Darin Petkov <petkov@chromium.org> AU: Don't allow stateful /etc/lsb-release override in normal boot mode...

... on official images except for the release track.

BUG=chromium-os:6244
TEST=unit tests, tested on device

Change-Id: I2d2a634c7b5ac7dd4619f52d1f79b6d88c359e46

Review URL: http://codereview.chromium.org/6225001
/system/update_engine/omaha_request_params.cc
a3df55badfc7dc25792aba1ca6e7ade582b566a7 15-Nov-2010 Darin Petkov <petkov@chromium.org> AU: Don't allow deltas if the rootfs track is different than the request track.

Currently such deltas are destined to fail because the rootfs hash will be
different than the expected hash.

BUG=9160
TEST=unit tests, tested on device

Change-Id: I588fcedb4a0ae16aca7197f771afab077d78fe05

Review URL: http://codereview.chromium.org/4988002
/system/update_engine/omaha_request_params.cc
d315dc7f336ceff8c1648ccd1a199ebb8c0a5a84 15-Nov-2010 Darin Petkov <petkov@chromium.org> AU: Allow override of "appid" through the lsb-release file.

This will allow us to split Omaha configurations into OEM-specific files.

BUG=6145
TEST=unit tests, tested on device

Change-Id: I1f9b44d2a984988723ec81bf77594161c35460a2

Review URL: http://codereview.chromium.org/5022001
/system/update_engine/omaha_request_params.cc
3f375c7209de38b1d178c59f9fa990d77f20c7c0 05-Nov-2010 Darin Petkov <petkov@chromium.org> AU: Add test-channel to the list of valid tracks.

BUG=8384
TEST=unit tests

Change-Id: Ifbf6918c70301de4437f6c161aa6d761e3ad47ba

Review URL: http://codereview.chromium.org/4520001
/system/update_engine/omaha_request_params.cc
583667b33cb62b97fbbd792d6c830c530d759ec1 27-Oct-2010 Satoru Takabayashi <satorux@chromium.org> AU: Implement getting of tracks through GetTrack.

Add SetTrack and GetTrack to UpdateEngine.xml as well.

BUG=chromium-os:8104
TEST=tested on device with update_engine_client

Change-Id: I10ef2552e9280524b3a8d5f232d104a81a114e06

Review URL: http://codereview.chromium.org/4181001
/system/update_engine/omaha_request_params.cc
49d91329a3a84d7e2b35f6e1ffc8a9b4d478515b 26-Oct-2010 Darin Petkov <petkov@chromium.org> AU: Implement switching of tracks through SetTrack.

On official images, update engine allows updating the track
only to dev-channel or beta-channel. The track is verified
both at setting and at getting time.

BUG=8104
TEST=unit test; tested on device

Change-Id: Ic81d4e3a9e09554d2239ee5c7a6c78e4dfe30d19

Review URL: http://codereview.chromium.org/4103002
/system/update_engine/omaha_request_params.cc
fbb40098314ab45efa60667ad7ccae354c4f18da 30-Jul-2010 Darin Petkov <petkov@chromium.org> Add a hardware_class attribute (for HWID, HWQual ID) to the Omaha request.

BUG=1600
TEST=unit tests, gmerge and looked at request logs

Review URL: http://codereview.chromium.org/3007020
/system/update_engine/omaha_request_params.cc
84c763cffce6778711792944387fadb760c55c8d 30-Jul-2010 Darin Petkov <petkov@chromium.org> AU: Remove instances of Omaha ID -- machine ID and user ID.

Also add a unit test to make sure we are not sending machineid or userid
attributes.

BUG=1439
TEST=unit tests, gmerged on device, checked for update, looked at logs

Review URL: http://codereview.chromium.org/2808082
/system/update_engine/omaha_request_params.cc
5a7f565a542196f24eb87ddac96508f8a84e3329 23-Jul-2010 Darin Petkov <petkov@chromium.org> Add support to update_engine_client for -app_version and -omaha_url.

These options prevent auto-detection of these parameters.
Note that this CL makes the check_for_update DBus method obsolete from
the client's point of view.

BUG=4593
TEST=unit tests, gmerged on device and tried the client with different options.

Review URL: http://codereview.chromium.org/3048008
/system/update_engine/omaha_request_params.cc
3f0303aa211e2de2d466cef063ff6f39fffe32dd 16-Jul-2010 Andrew de los Reyes <adlr@chromium.org> AU: pass whether or not we can tolerate a delta to the server

BUG=4848
TEST=attached unittests

Review URL: http://codereview.chromium.org/3017006
/system/update_engine/omaha_request_params.cc
a4a8a8ccc2d9e0285728ed247b43f09433e63323 16-Jul-2010 Darin Petkov <petkov@chromium.org> Turn OmahaRequestPrepAction into OmahaRequestDeviceParams.

Pass the params to OmahaRequestAction's ctor. This simplifies a bit
executing as well as testing of OmahaRequestAction and testing of
OmahaRequestDeviceParams. It also allows us to initialize the params
once per update attempt and use them for all OmahaRequestActions.

BUG=560
TEST=unit tests, gmerged on device and forced an update through dev server,
inspected logs.

Review URL: http://codereview.chromium.org/2836053
/system/update_engine/omaha_request_params.cc