Age | Commit message (Collapse) | Author |
|
Fix clang formatting issues for all .cc, .h, and .proto files
in update engine.
~/trunk/src/chromium/src/buildtools/linux64/clang-format -i \
-style=file $(find update_engine -name '*.h' -o -name '*.cc' \
-o -name '*.cpp' -o -name '*.c')
BUG=b:169679497
TEST=CQ pass
Change-Id: I4fde01d3e734dbffaa2c7e7b667503d310abccae
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2462840
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jae Hoon Kim <kimjae@chromium.org>
Tested-by: Vyshu Khota <vyshu@google.com>
Commit-Queue: Vyshu Khota <vyshu@google.com>
|
|
Done with:
git merge cros/upstream --commit -s recursive
- Added EC key support and its unittests.
- Resolved a conlict on error codes. Since Android versions are not
uploading any UMA metrics, I gave the priority to the Android version
Since they can't be changed.
- Changed the openssl functions to get1 version (from get0) version
because of a current issue with gale. Once the issue is resolved we
need to change them back.
- Some remaining styling issues fixed by clang-format
BUG=b:163153182
TEST=CQ passes
TEST=unittests
Change-Id: Ib95034422b92433ce26e28336bc4806b34910d38
|
|
The test http server does not really support connection reuse. After
each request, the connection is closed. When a url returns a redirction,
curl will try to reuse the previous connection, and fail.
This was ok before, because this kind of failure didn't count into the
total number of connection failure. But things changed in latest curl.
The max redirection is actually capped by 5, the max allowed connection
failure.
This change adds "Connection: close" header to test server. So that curl
will not try to reuse connecton.
Test: atest update_engine_unittests
Change-Id: I443c28ff3760a1cad80cfd40e354e1d0328f7561
|
|
We're trying to turn -Wunreachable-code-return on by default, and this
unreachable `return` statement was flagged. The code above this is
pretty clearly an infloop, so this return statement doesn't seem super
useful. If someone adds a `break` or similar later, the compiler will
complain (in -Werror form) about a missing `return` statement.
BUG=chromium:1066998
TEST=CQ
Change-Id: I9c87e256fa0c850bcb8cec17cbe694fc6bb0ef66
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2133017
Reviewed-by: Sen Jiang <senj@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
|
|
BUG=none
TEST=unittest
Change-Id: Ibd075dc7ea9a18e798f612e35725f1c83c112809
Reviewed-on: https://chromium-review.googlesource.com/1409708
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
|
|
This reverts commit 71818c8409812c5a08124627c19aa8ea0625a72e.
This patch was created because the upstream update_engine was using
the new version of libchrome and the Chrome OS one was not. Now
that we are upreving libchrome on Chrome OS we can revert this.
BUG=b:37434548
TEST=Build
CQ-DEPEND=CL:1240033
Change-Id: I98b7d124212087292500701782de08b3d3ecc559
Reviewed-on: https://chromium-review.googlesource.com/1239818
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
|
|
2b9d2417722cd4052b0e22494886f93c5b4ef042 update_engine: Update libchrome APIS to r456626.
The above commit changes the libchrome API used in update_engine to r456626. But
the libchrome has not been upreved fully in the CrOS yet with the exception of
some changes represented in UE like CL:882543. So, now we need to revert the
changes partially untill the libchrome is updated.
BUG=chromium:815356
TEST=unittests, precq
Change-Id: If2207f0672c7b9f6dab84e676d9fb8423a047372
Reviewed-on: https://chromium-review.googlesource.com/965266
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
|
|
Bug: 30989362
Test: update_engine_unittests
Change-Id: I04417ac21508f4da3ead29b1dea34886f2fc84af
Merged-In: I04417ac21508f4da3ead29b1dea34886f2fc84af
|
|
GetCStr() returns the contents to a local string returned by Get().
The string is destroyed after the call to GetCStr() so the pointer
passed to atoi() is not valid.
Change Get() to return a reference instead so that it will stay valid
for lifetime of atoi().
BUG=chromium:808686
TEST=No more asan complains.
Change-Id: Icc62064f4f3382a29ccbd36ca90f9952cf149364
Reviewed-on: https://chromium-review.googlesource.com/899512
Commit-Ready: Manoj Gupta <manojgupta@chromium.org>
Tested-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
|
|
The new libchrome has been ported from Chromium and some APIs
have changed. Make necessary changes at call sites.
BUG=chromium:724678
CQ-DEPEND=CL:480928
Test: Build.
Change-Id: I01b70da87521d0884ed21acbd7ed3e0ff1e94357
Merged-In: I4dbaea4a2a19031375a8bf2415645a4f226dab57
|
|
This reverts commit 663ff4b30b9f629a130ef6d357d462b897d4071e.
Reason for revert: Broke the mac_sdk
Exempt-From-Owner-Approval: Fixing mac_sdk
Change-Id: I8184ec58e74d62dca0deafb39340d4bd36bf40e0
|
|
The new libchrome has been ported from Chromium and some APIs
have changed. Make necessary changes at call sites.
Change-Id: I8c3cea4510774c813a5d8fb10240918b5736884e
|
|
Android OTA backend requires to pass an Authorization HTTP header in
order to download some payload. This patch allows to specify such
header when initiating a payload download from Android.
Bug: 27047110
TEST=Added unittests to check the headers sent.
(cherry picked from commit fdd6dec9c4be2fbd667cf874c4cc6f4ffecaeef9)
Change-Id: I59d38d79a7b7a8975d105c611c692522b6c33707
|
|
Android OTA backend requires to pass an Authorization HTTP header in
order to download some payload. This patch allows to specify such
header when initiating a payload download from Android.
Bug: 27047110
TEST=Added unittests to check the headers sent.
Change-Id: Iece7e0ee252349bbaa9fb8545da2c34d2a76ae69
|
|
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
|
|
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
Change-Id: I42e65bda7f1dbdf6f6e0ebf356d2cfea6b729193
|
|
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
|
|
When CleanUp() is called indirectly from TimeoutCallback(), the
TimeoutCallback() itself is canceled before the new recurrent call is
scheduled. The CancelTask() call will trivially succeed because the
callback already triggered.
Before CL:281197, the g_source_destroy() call to remove the currently
running callback would prevent it from being re-scheduled even if it
returns TRUE from the callback.
This patch re-schedules the callback before calling CurlPerformOnce()
so CancelTask() would cancel the scheduled task.
Bug: chromium:535649
Test: Added unittest. Verified it fails without the change.
Change-Id: Ica742dab0eb8d9d5c5055c8afac9d775ad1e0012
|
|
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
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
With this change, unit testing code spawns a local (test) HTTP server
that listens on a unique TCP port. It is up to the server to allocate an
available port number (we use auto-allocation via bind) and report it
back (by default, via its stdout), which the unit test process parses.
Also part of this CL:
- Made the port a property of the server object, rather than a global
value. This makes more sense in general and may lend itself better to
future testing scenarios, such as running multiple servers in
parallel.
- Removed a redundant field (validate_quit) from PythonHttpServer and
simplified/robustified its shutdown procedure: if the server is known
to be responsive, a graceful signal is sent (via wget); otherwise, or
if the former failed, a more brutral signal(SIGKILL) is used.
- http_fetcher_unittest code now properly kills test_http_server if the
latter is unresponsive.
BUG=chromium:236465
TEST=Test server spawned with unique port
Change-Id: I699cd5019e4bd860f38205d84e5403cfb9b39f81
Reviewed-on: https://gerrit.chromium.org/gerrit/60637
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
|
|
This eliminates the constant definition of the test HTTP server port,
replacing it with a command-line parameter (which defaults to 8080, the
well-known userland HTTP port). This is needed for allowing parallel
invocations of unit tests.
BUG=chromium:236465
TEST=Passes unit tests
Change-Id: I91904dc360ec1b993cbaae93554fb0dd9e5adaad
Reviewed-on: https://gerrit.chromium.org/gerrit/60626
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
|
|
The PythonHttpServer class has to be cleaned up always. This was not
happening properly in one test (ServerDiesTest). This was causing the
succeeding test (which always happened to be SimpleRedirectTest) to use the
wrong server sometimes or hang forever.
Adding a bunch of instrumentation in unit test code helped to figure out
what's going, so leaving them in.
BUG=chromium-os:32096
TEST=update engine unit tests run fine.
Change-Id: Ide9a31eb411c8687ca39d78d8ebff97fe6305dbe
Reviewed-on: https://gerrit.chromium.org/gerrit/27325
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
|
|
Newer libbase no longer implicitly includes the stringprintf.h header,
so building against it fails with missing StringPrintf definitions.
BUG=chromium-os:25872
TEST=`emerge-x86-alex update_engine` works with old & new libbase
Change-Id: Ia1ea842449c0382ee4c8e5abd3ddfb3012c3ff2f
Reviewed-on: https://gerrit.chromium.org/gerrit/19774
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
|
|
Building with base headers in a SLOT-ed setup exposes build warnings
(which causes failures due to -Werror). One such example:
In file included from extent_writer.h:9:0,
from bzip_extent_writer.h:10,
from bzip_extent_writer.cc:5:
.../base/logging.h: In function 'std::string* logging::CheckEQImpl(const t1&, const t2&, const char*)
[with t1 = unsigned int, t2 = int, std::string = std::basic_string<char>]':
bzip_extent_writer.cc:53:7: instantiated from here
.../base/logging.h:512:1: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1plus: all warnings being treated as errors
Explicitly cast the constants to avoid these.
BUG=chromium-os:16623
TEST=`emerge-x86-alex update_engine` builds
Change-Id: If3cc4e85fa54862b14305f9d045c73b5575efaa0
Reviewed-on: https://gerrit.chromium.org/gerrit/16035
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
|
|
is known.
* HttpFetcher allows to set the length of data to be fetched.
LibcurlHttpFetcher uses this value in applying the appropriate libcurl
option (CURLOPT_RANGE). MultiHttpFetcher sets the desired payload
length in the underlying fetcher accordingly.
* Improved functionality of test_http_server: (a) correctly parses
closed range intervals; (b) generalized response header generation;
(c) unified and generalized get handling for both stable and flaky
cases.
* Small scale refactoring, improved logging and readability.
BUG=chromium-os:24666
TEST=unit tests
Change-Id: I1727710ca747088c67a68305f355da683b07b6a3
Reviewed-on: https://gerrit.chromium.org/gerrit/13594
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
|
|
This is a fix to issue 18143:
* New test cases for asserting the desired behavior: if a transfer of
a secondary chunk within a multi-chunk fetch fails, then the fetcher
needs to retry with other available proxies; it will only fail when no
additional proxies are available. The tests ensure both success (one
of the proxies eventually succeeds) and failure (all proxies fail)
cases.
* Small fix to LibcurlHttpFetcher to retry with other proxies upon
failure (error value) of a secondary chunk.
Other changes applied in the course of this fix:
* Massive refactoring of http_fetcher_unittest: substituted template
specialization in typed test setup with proper subclassing, resulting
in a safer and more maintainable infrastructure; extended URLs to
include all (most) parameters pertaining to test workload, such as
download size, flakiness, etc.
* Respective changes to test_http_server: it is now much more
independent of particular kind of tests, and more easily
parametrizable. Also, generalized several internal methods for better
readability and extensibility, such as writing of arbitrary payloads,
parsing headers,
* Migrated common definitions into http_common.{h,cc} (universal
HTTP-related stuff) and http_fetcher_unittest.h (shared definitions
pertaining to unit tests).
* Extended direct proxy resolver to generate a list of (non-) proxies,
so we can unit test proxy failure. Also, better logging to improve
testability.
* Some renaming of classes for better consistency.
BUG=chromium-os:18143
TEST=unit tests
Change-Id: Ib90b53394d7e47184d9953df8fc80348921e8af0
Reviewed-on: https://gerrit.chromium.org/gerrit/12092
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
|
|
(a) LibcurlHttpFetcher avoids download if the HTTP reponse indicates an
error; corresponding change to unit test code and test HTTP server. (b)
Added a method for returning the total bytes downloaded to HttpFetcher
and all subclasses, needed for unit testing. (c) Generalized check for
successful HTTP response code in LibcurlHttpFetcher.
BUG=chromium-os:9648
TEST=unit tests
Change-Id: I46d72fbde0ecfb53823b0705ce17f9547515ee61
Reviewed-on: https://gerrit.chromium.org/gerrit/11773
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
|
|
This allows developers to run unit tests while the dev server is running. Also
remove obsole test_http_server.py.
BUG=8889
TEST=unit tests while dev server is running.
Change-Id: Iaf0ff92edbb959d93bd206c0007455f637682e2c
Review URL: http://codereview.chromium.org/4667002
|
|
MultiHttpFetcher takes an HttpFetcher class via template parameter,
and a collection of byte ranges. It hits up the URL multiple times,
once per range specified. For each time, it uses a new HttpFetcher of
the type specified and fast-forwards to the offset requested, and
aborting after enough bytes have been downloaded. Any range many
specify a length of -1, which means until the end of the file (as
dictated by the server). Thus, a single range of [0, -1] makes
MultiHttpFetcher a pass-through.
HttpFetcher change: ability to supply an offset.
LibcurlHttpFetcher changes: offset support (from HttpFetcher API),
ability to be terminted in a write-callback.
test_http_fetcher: support for failures in write() on the socket (at
least in the /big url case).
BUG=7391
TEST=unittests
Review URL: http://codereview.chromium.org/3591018
|
|
BUG=5692
TEST=unit tests, gmerged on device, making sure update engine still works
Change-Id: If593f6efbd39452aa98b453f4d5489ce7d7d7fb9
Review URL: http://codereview.chromium.org/3161041
|
|
BUG=None
TEST=compile
Change-Id: Ieed8952b6806a72b59e16c1579f7293b6a98157a
Review URL: http://codereview.chromium.org/3170010
|
|
BUG=None
TEST=attached unittest
Review URL: http://codereview.chromium.org/3036005
|
|
Review URL: http://codereview.chromium.org/1599029
|
|
Review URL: http://codereview.chromium.org/465067
git-svn-id: svn://chrome-svn/chromeos/trunk@336 06c00378-0e64-4dae-be16-12b19f9950a1
|