History log of /system/update_engine/common/test_utils.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6e3ffe73d27de744ef494292c003b5ba907799df 27-May-2016 Alex Deymo <deymo@google.com> Fetch local files asynchronously.

This patch implements a new fetcher that only handles local files.
While libcurl supports file:// urls, the stream can't be suspended when
accessing local files.

This new FileFetcher is based on the brillo::FileStream class which
properly handles the asynchronous reads from regular files.

Bug: 28866512
TEST=Added unittest. Deployed an update from a file:// URL.

(cherry picked from commit 2c131bbf81d8c02ade163b939c96e44aa93765e9)

Change-Id: I9949a0f214de992c2fd86c1d73aca1c1792f0de0
/system/update_engine/common/test_utils.h
bb0c067bf37c98cc55b6c79c1174084b1e0c9b0b 10-Mar-2016 Alex Deymo <deymo@google.com> Implement susped, resume and cancel for the Postinstall action.

This patch sends SIGSTOP/SIGCONT to the running postinstall program to
suspend/resume the child process, and SIGKILL when cancelling it.

Bug: 27272144
TEST=Added unittest to check the signal being sent.

(cherry picked from commit d15c546ed794293d0a63770467a0f3c4c84c6214)

Change-Id: Ie99b406b4d7f73dda4189b7a5a7d627c866055d6
/system/update_engine/common/test_utils.h
c975d7bc6767711c4802e104c4a9d4731910c9be 05-Mar-2016 Alex Deymo <deymo@google.com> Rework postinstall unittests to pass on Android.

Postinstall unittests were creating and mounting an image on each test
run. This patch adds several test scripts to one of the pre-generated
images and uses that image during postinstall testing instead.

To workaround problems with mount/umount of loop devices on Android,
this patch rewrites the `losetup` logic to make the appropriate
syscalls and create the loop device with mknod if it doesn't exists.

The tests require some extra SELinux policies to run in enforcing mode.

Bug: 26955860
TEST=Ran all Postinstall unittests.

(cherry picked from commit cbc2274c4160805bf726df872390112654816ca7)

Change-Id: Ib4644572e2813615c89e4c6eef632e895cf0b90c
/system/update_engine/common/test_utils.h
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/test_utils.h
64d9878470aa7b388e971862181daf6260851602 06-Feb-2016 Alex Deymo <deymo@google.com> Replace is_full_update boolean with a payload_state enum.

The "is_full_update" flag in the InstallPlan is required to decide
whether we should run a FilesystemVerification step before start
downloading the payload (for delta payloads) or not (for full payloads).
This step is done before start downloading the payload and not after
downloading the metadata to avoid long delays in the connection which
would then drop and require a retry.

Since the not so recent inclusion of the source_data_hash field in the
delta operations, the source data is verified on each operation, so the
install plan field and the pre-download FilesystemVerification is not
needed anymore.

To help deprecate this process, which is not included in the non-Brillo
version, this patch changes the is_full_update field to a payload_state
enum with a third "unknown" state that will be changed to delta or full
once the payload metadata is parsed.

Bug: 25631949
TEST=unittests updated.
TEST=Pushed a delta update to edison-eng and a non-Brillo target.

Change-Id: I17d8bf58990d8465bb8487adc66601f1c1dfca6d
/system/update_engine/common/test_utils.h
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/test_utils.h