History log of /system/update_engine/common/test_utils.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ce7b56980309369aa1f3dcd6a5d3c0107b76412e 19-May-2017 Elliott Hughes <enh@google.com> Include <sys/sysmacros.h> for major/minor/makedev.

glibc and bionic are both moving away from having <sys/types.h> pull in
<sys/sysmacros.h>.

Bug: https://github.com/android-ndk/ndk/issues/398
Test: builds
Change-Id: I5c4ae7f9320e671bc154a59cde42dad4dab12f29
/system/update_engine/common/test_utils.cc
371615b025bdd8106faf65c1ba7439a1236f21bc 14-Apr-2016 Sen Jiang <senj@google.com> Remove utils::MakeTempDirectory().

In favor of base::ScopedTempDir, except for PostinstallRunnerAction,
where the temp directory needs to be removed for every partition.

ScopedDirRemover is also removed because it's no longer used.

Test: ./update_engine_unittests
Test: cros_workon_make update_engine --test
Bug: 26955860

Change-Id: I954e6e892aff0cf9f8434a77408dc3c9eb64c1b5
/system/update_engine/common/test_utils.cc
260f03bc4d3a3de436e056c686c814444358823a 21-Mar-2016 Sen Jiang <senj@google.com> Fix unittest key path in Brillo.

The unittests weren't able to find the keys if it's not run from the
update_engine_unittests directory.

Test: /data/nativetest/update_engine_unittests/update_engine_unittests
Bug: 26955860

Change-Id: I4c189cca2714986d3d2b2669b54a5dff9a488964
/system/update_engine/common/test_utils.cc
990c27b0df5bd77ca804479922a62ba0ee9266ba 16-Mar-2016 Sen Jiang <senj@google.com> Use pre-generated ext image instead of create it on the fly.

mkfs.ext3 is not available in target device, so we don't use it.
Also removed all usage of dd.
This fixes a UtilsTest and the first step of integration test, the rest is
still failing because bsdiff is missing.

Test: ./update_engine_unittests
Test: cros_workon_make update_engine --test
Bug: 26955860

Change-Id: Ic600bd6fab1d6839f38d5ef767fbffc5a35571a4
/system/update_engine/common/test_utils.cc
d15c546ed794293d0a63770467a0f3c4c84c6214 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.

Change-Id: Iebe9bd34448ad1d0a5340c82e1fd839ff8c69dd2
/system/update_engine/common/test_utils.cc
cbc2274c4160805bf726df872390112654816ca7 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.

Change-Id: I47a56b80b97596bc65ffe30cbc8118f05faff0ae
/system/update_engine/common/test_utils.cc
2c41357811af9b47e80cf526ec53f4b4e5c351fc 07-Mar-2016 Sen Jiang <senj@google.com> Fix DeltaPerformerIntegrationTest crash.

Got this error running unittest in Chrome OS.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid

MountFilesystem() expects a const string& in the 5th parameter, will crash
if nullptr is passed.

Bug: None
Test: cros_workon_make update_engine --test

Change-Id: I14d07e6c60c39ce9604f69613fba584723c598c5
/system/update_engine/common/test_utils.cc
14dbd333439f34c648b9f783ffa656ef565de0cc 02-Mar-2016 Alex Deymo <deymo@google.com> Mount the new system as 'postinstall_file' in postinstall.

When mounting the new filesystem on /postinstall, we need to override
the file attributes from the new system (unknown to the current selinux
policies) with a consistent label that will be used only in the context
of postinstall. This patch passes an extra option to mount(2) in
Brillo and Android to achieve this.

Bug: 27177071
TEST=Deployed a postinstall script with `ls -laZ`, contents show "postinstall_file".

Change-Id: Ia43b45c92e4c4cd340a884818ac00f24a418f9e7
/system/update_engine/common/test_utils.cc
390efedcb7e17587da765b6d682077cb7fa46ee1 18-Feb-2016 Alex Deymo <deymo@google.com> Parse postinstall parameters from the payload metadata.

Payload v2 includes a description of the post-install command it should
run, while in payload v1 we use the default values. This patch mounts
the partition on the new top-level directory called /postinstall that
should already be created.

Bug: 27177071
TEST=FEATURES=test emerge-link update_engine

Change-Id: Iaedf3b01e5e1ad57c68bd316b4b6e79cbab35bb6
/system/update_engine/common/test_utils.cc
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.cc
0103c36caa2e38e034e0d22185736b9ccfb35c58 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.

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