Commit graph

3047 commits

Author SHA1 Message Date
David Anderson
d94e6c537f libdm: Redact keys from dm-crypt targets when calling GetTable.
Ignore-AOSP-First: security fix
Bug: 368069390
Test: libdm_test
Change-Id: I40b9a0129e58b1a0f116ca29f0ee66f91a27a73d
Merged-In: I40b9a0129e58b1a0f116ca29f0ee66f91a27a73d
2024-10-25 22:24:32 +00:00
Treehugger Robot
4fc18600ac Merge "libsnapshot: Use SnapshotManager to delete devices." into android12L-tests-dev am: 11caad9d6c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2604246

Change-Id: Ie667cac11be2ee5eef1cc7b434777689757c0a5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-03 00:20:57 +00:00
Treehugger Robot
11caad9d6c Merge "libsnapshot: Use SnapshotManager to delete devices." into android12L-tests-dev 2023-06-02 23:51:12 +00:00
David Anderson
1136e2fc30 libsnapshot: Remove flaky image creation test.
This test has always been flaky, and is not testing something super
valuable: we know that image creation succeeds throughout the rest of
the suite, so it's not very interesting to know that it can succeed in a
low-space scenario.

The inverse test is much more valuable, since we want the correct status
code when creation fails due to low space.

Bug: 240391002
Test: vts_libsnapshot_test
Merged-In: I6235d11033d2f30efe530077b877863ba2574810
Change-Id: I6235d11033d2f30efe530077b877863ba2574810
(cherry picked from commit 97e8a2f0e9)
2023-06-01 15:49:51 +00:00
David Anderson
c786b6d332 libsnapshot: Use SnapshotManager to delete devices.
Diagnosing DM_DEV_REMOVE failures in the test harness is quite
difficult, and it's not clear if failures are spurious or not. Instead
use SnapshotManager's helper function, which can retry on failure, and
will self-diagnose issues on legitimate failures.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685
Merged-In: Ibcaa8406e8b1e8758b99a8e9b58c58d68ed57685
(cherry picked from commit e02ef9e9ce)
2023-06-01 14:20:03 +00:00
David Anderson
3f96053b38 DO NOT MERGE: libsnapshot: Fix test failures on certain configurations.
Due to how CF is built and tested, VABC is enabled even when not
supported by the kernel. To work around this add some logic in
libsnapshot and the test harness to recognize this situation and
silently flip off the VABC flag.

This also fixes the -force_mode option to vts_libsnapshot_test, so that
it will skip tests that aren't supported by the device.

Bug: 264279496
Test: vts_libsnapshot_test on android13-gsi with 11-5.4 kernel
Change-Id: I9279d8d400cac5cd504a7ae91f254aae57fa856d
2023-05-03 19:07:50 +00:00
Treehugger Robot
2316bf2eaf Merge "libsnapshot: Fix test failures on certain configurations." into android12-tests-dev am: b880578664
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2563951

Change-Id: Iefd00dd6629a0850cffb7a4a170d8c831a7c2007
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-26 02:45:43 +00:00
David Anderson
6727d5840b libsnapshot: Fix test failures on certain configurations.
Due to how CF is built and tested, VABC is enabled even when not
supported by the kernel. To work around this add some logic in
libsnapshot and the test harness to recognize this situation and
silently flip off the VABC flag.

This also fixes the -force_mode option to vts_libsnapshot_test, so that
it will skip tests that aren't supported by the device.

Bug: 264279496
Test: vts_libsnapshot_test on android12-gsi with 11-5.4 kernel
Change-Id: I9279d8d400cac5cd504a7ae91f254aae57fa856d
2023-04-25 23:50:48 +00:00
David Anderson
33e044574a libsnapshot: Disable 32-bit VTS tests on 64-bit systems.
These tests don't work because 32-bit dependencies are not normally
packaged on a 64-bit system.

Bug: 263062262
Test: builds
Change-Id: I68859a9e9c029a528ee12c02569a3693261c7251
(cherry picked from commit 32fa3e96f4)
2023-02-08 18:59:43 +00:00
biandonglei
bfd3e38284 Some device that platform base on android12 doesn't support A/B update, it looks virtual A/B is also not mandatory. so this test case should check ro.vendor.api_level first.
test:
 run vts -m vts_ota_config_test -t VAB#Enabled

issue:
 245441425

Change-Id: I1795c931b28fd5fe28aa0f23717d4238fb352d37
2022-09-17 06:44:46 +00:00
David Anderson
5b9c9ba1e0 libsnapshot: Remove flaky image creation test.
This test has always been flaky, and is not testing something super
valuable: we know that image creation succeeds throughout the rest of
the suite, so it's not very interesting to know that it can succeed in a
low-space scenario.

The inverse test is much more valuable, since we want the correct status
code when creation fails due to low space.

Bug: 240391002
Test: vts_libsnapshot_test
Change-Id: I6235d11033d2f30efe530077b877863ba2574810
(cherry picked from commit 97e8a2f0e9)
2022-08-18 20:09:11 +00:00
David Anderson
aee8ddbc46 vts_fs_test: Only require EROFS in T+ kernels.
Bug: 237765186
Test: vts_fs_test
Ignore-AOSP-First: cherry-pick
Change-Id: I294535953bfbe0f246347487b746d3adf2fca1aa
Merged-In: I294535953bfbe0f246347487b746d3adf2fca1aa
2022-07-14 17:47:51 +00:00
David Anderson
3282850933 Revert "Do not enforce EROFS for android-T and below."
This reverts commit a571d4a9bc.

Reason for revert: Incorrect fix

Bug: 237765186
Ignore-AOSP-First: cherry-pick
Change-Id: I6586c8e53cc89418d1802807a1a2e108f7e825d3
Merged-In: I6586c8e53cc89418d1802807a1a2e108f7e825d3
2022-07-14 17:47:47 +00:00
P.Adarsh Reddy
b2182ee8e0 Do not enforce EROFS for android-T and below.
EROFS is not mandatory for android T and below,
so skip the test for those.

Bug: 237765186
Test: vts_fs_test fs#ErofsSupported
Change-Id: Iceea46f8f2d443636de504962b718a2461605591
Ignore-AOSP-First: already present in aosp/master
2022-07-12 17:58:24 +00:00
Benergy Meenan Ravuri
9591090a17 Check userspace snapshots only for API level >= T
Skip checking for userspace snapshots enabled property
for API level < T as this feature is not applicable for
GRF targets.

Bug: 236450435
Test: vts_ota_config_test
Change-Id: Ib5083f6237cdf4962aae06f166811d67cf6c385e
Ignore-AOSP-First: already present in aosp/master
2022-07-12 17:57:59 +00:00
Akilesh Kailash
299717115e libsnapshot: Fix vts_libsnapshot_test.SnapshotUpdateTest#FullUpdateFlow
Check if compression feature is enabled.

Bug: 238143011
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I77663799a5371f1de8b4e29d7c777a24249d1b7b
Ignore-AOSP-First: already present in aosp/master
2022-07-12 17:57:25 +00:00
Akilesh Kailash
ae04e7ede1 libsnapshot: Fix vts_libsnapshot_test for GRF with Vendor on S
If the vendor partition is on S and system partition is on T,
certain tests in vts_libsnapshot_test used to fail. This is primarily
because of inconsistent check between daemon and vts test.

vts test checks the userspace.snapshots.enabled property which is true on T
but never checks if the underlying vendor partition is on S. Hence,
vts test will enable userspace snapshots. However, daemon checks
the vendor partition and disables userspace snapshots thereby
leading to inconsistency.

This is only a problem on vts tests. The underlying OTA on devices
works fine as we have the vendor partition check.

Bug: 236311008
Test: vts_libsnapshot_test on S vendor and T system
      vts_libsnapshot_test on T vendor and T system
Ignore-AOSP-First: cherry-pick from aosp
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Iad4f299bd2e07c9c01f5fbee6a20e2f01bf1778a
2022-06-16 22:56:14 +00:00
David Anderson
5b227f3451 vts_fs_test: Require EROFS sysfs nodes.
These were backported to android13-5.10 and should be present in
T-launch kernels.

Bug: 233926292
Test: vts_fs_test
Change-Id: Ifb5ff6a200b081fe8696d5803d4a128740eb8e21
Merged-In: Ifb5ff6a200b081fe8696d5803d4a128740eb8e21
Ignore-AOSP-First: cherry-pick
2022-05-27 19:01:59 +00:00
David Anderson
0895d63952 Relax filesystem requirements in vts_fs_test.
Bug: 233926292
Test: vts_fs_test
Change-Id: I9665acebd6ebfde14e0cd76e8044e7ced9ffbeb3
Ignore-AOSP-First: cherry-pick from AOSP
2022-05-27 00:21:30 +00:00
Akilesh Kailash
d36a68183c libsnapshot: Initialize merge_op_start_ to zero.
merge_op_start_ is used to set the iterator for merge operations.
Uninitialized value can potentially lead to setting up
of bad iterator.

Bug: 233246309
Test: Full OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I3cc48a66b532cfe8b2d87c8724d77ab3169a2ddb
Merged-In: I3cc48a66b532cfe8b2d87c8724d77ab3169a2ddb
2022-05-20 06:11:32 +00:00
Automerger Merge Worker
92c83b3d47 Merge "Merge "Merge "resolve merge conflicts of 21ef3ae3fd to android11-tests-dev" into android11-tests-dev am: bdf02cc54d" into android12-tests-dev am: fdca6ffb38" into android12L-tests-dev am: c1a6b27d21
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1726290

Change-Id: I5988f66d41af54127829baa6edb3a3217a99e583
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 01:12:53 +00:00
Treehugger Robot
cb8aae7bcc Merge "vts_libsnapshot_test: Fix free space calculation." into android12-tests-dev am: abed76bf3e
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2066968

Change-Id: I9c39be260aade8514793db2c607e3825503d33b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 00:52:32 +00:00
Automerger Merge Worker
6a5ac60cce Merge "Merge "resolve merge conflicts of 21ef3ae3fd to android11-tests-dev" into android11-tests-dev am: bdf02cc54d" into android12-tests-dev am: fdca6ffb38
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1726290

Change-Id: I839da4bee076444d4e679a26c0bec7e0ea74890a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 00:51:47 +00:00
David Anderson
891ba3a587 vts_libsnapshot_test: Fix free space calculation.
This should be using unreserved free space, not total free space.

Bug: 223701928
Test: vts_libsnapshot_test
Change-Id: Ic0a657fe094b57734c93958d7e5da56fbfbada7f
(cherry picked from commit 15433b93ff)
2022-04-19 01:26:19 +00:00
Tim Zimmermann
496132bc99 fs_mgr: Don't assume partitions replaced by DSU are logical already
Test: Boot DSU on a device without dynamic partitions but first_stage_mount for /system

Change-Id: I07f0f40037109aaaf1bce0151d1eac26c971ba9e
2022-04-17 08:22:34 +02:00
Akilesh Kailash
f86fca236f libsnapshot: Remove invalid snapshot metadata
If there are snapshot metadata persisting in /metadata/ota/snapshots,
remove them before applying a new update. Make sure that
the snapshots are indeed invalid before removing them.

On a sidenote, add a comment in init.cpp related to
b/223076262.

Bug: 228250473
Test: 1: Apply OTA in recovery through adb sideload
2: Reboot
3: Apply OTA OTA again through update_device.py
4: Re-run Full OTA updates just from update_device.py

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I116bbafae09042b9c391ccd58c102704571c214e
2022-04-16 16:43:35 +00:00
Akilesh Kailash
9fc6ee050f libsnapshot: OTA upgrade when vendor partition is S
In Android S, snapuserd binary was on vendor partition.
When there is an OTA update from S -> T, it is possible
that vendor partitions are not updated. In that case,
successive OTA updates T1 -> T2 will continue to have
snapuserd from Android S as vendor partition wasn't updated
to T. All this means, we should disable user-space snapshots.

When installing OTA during runtime, check for property
ro.vendor.build.version.release_or_codename; if the property
is set to "12", then skip userspace-snapshots.

Bug: 227614163

Test: Simulate OTA test on Pixel 6 from T1 -> T2 by forcefully
setting the property to 12 and verify OTA is applied
successfully by falling back to dm-snapshot.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I95f29145e5cd9ffb8d03d28ae414f0037b88be90
2022-04-05 20:23:14 +00:00
Treehugger Robot
f1df9ba5c4 Merge "vts_libsnapshot_test: Fix free space calculation." 2022-03-23 16:40:20 +00:00
Treehugger Robot
04288337c3 Merge "Rename FstabEntry::metadata_encryption to metadata_encryption_options" 2022-03-19 04:12:05 +00:00
Treehugger Robot
5d2c849c73 Merge "libsnapshot: Fix vts_libsnapshot_test" 2022-03-19 00:14:27 +00:00
Florian Mayer
92c1ef9e97 Add liblp to hwasan-postsubmit
Test: Run tests under HWASan.
Bug: 193568145
Change-Id: I6514e9f170d03ee2d2673d115a9c8337ac6941b0
2022-03-18 21:23:51 +00:00
Akilesh Kailash
44343d4416 libsnapshot: Fix vts_libsnapshot_test
Fix SnapshotUpdateTest.QueryStatusError which
was failing on targets where userspace-snapshots are not
yet enabled.

Bug: 224586316
Test: vts_libsnapshot_test -force_config dmsnap --gtest_filter=SnapshotUpdateTest.QueryStatusError
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ibaacff9b03eafe0bfa537d0f9cab98b7caceb37e
2022-03-18 20:11:17 +00:00
David Anderson
15433b93ff vts_libsnapshot_test: Fix free space calculation.
This should be using unreserved free space, not total free space.

Bug: 223701928
Test: vts_libsnapshot_test
Change-Id: Ic0a657fe094b57734c93958d7e5da56fbfbada7f
2022-03-17 20:39:47 -07:00
Eric Biggers
20a5f92a33 Rename FstabEntry::metadata_encryption to metadata_encryption_options
There have been two bugs where people use !metadata_encryption.empty()
to check whether metadata encryption is enabled.  It should actually be
!metadata_key_dir.empty(), since 'metadata_encryption' is the encryption
options, which can be empty if the defaults are sufficient.

Rename the field in FstabEntry appropriately.

To avoid breaking fstab files, don't rename the flag in the fstab file
itself.  So, now the fstab flags map to FstabEntry fields as follows:

    keydirectory => metadata_key_dir
    metadata_encryption => metadata_encryption_options

Change-Id: I5bf673047c99e077bd6e1ac006d80e7e16bc814b
2022-03-17 23:22:50 +00:00
Akilesh Kailash
6e43216340 Revert "init: Add diagnostics for snapuserd hangs"
This reverts commit 471643a909.

Reason for revert: Given https://r.android.com/1960063, it is safe to revert this diagnostics patch

Change-Id: Ib3600c1982ee10a0204ac0fdbc3e160c2833ed07
2022-03-14 20:49:53 +00:00
Shikha Malhotra
927d9d1c68 Merge "Adding project_id ranges for internal app and cache folders." 2022-03-10 21:58:40 +00:00
David Anderson
b738b7d23a Merge "fs_mgr: Add force_super_partition bootconfig option to avoid slot suffixing alternate super partition names." 2022-03-10 04:42:20 +00:00
Akilesh Kailash
c08037b2c2 If there an error, cqe field is not allocated by io_uring_wait_cqe(); return
the error immediately.

Bug: 223308671
Test: OTA
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Ib485bb767ad58e6a0849fb2431b563e6e7f04cfd
2022-03-08 06:14:22 +00:00
Yi-yo Chiang
fb81cf765a Merge "fs_mgr: Fix misleading comment text regarding __ANDROID_RECOVERY__" 2022-03-03 06:23:14 +00:00
David Anderson
390851dd29 Merge "fs_mgr: Restrict dt fstabs to < Q devices." 2022-03-03 05:05:19 +00:00
Treehugger Robot
d297b88e3e Merge "inspect_cow: Print OTA ops for debugging" 2022-03-03 03:35:04 +00:00
Treehugger Robot
4618fa3e2a Merge "libsnapshot: Edit OWNERS file" 2022-03-03 03:15:04 +00:00
Akilesh Kailash
d49321a6fc libsnapshot: Edit OWNERS file
Bug: 220991038
Test: Presubmit
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: If1f3529b731fb19193857e4009de42dc081edbf9
2022-03-03 01:18:07 +00:00
David Anderson
0a9c083b87 vts_fs_test: Statically link libfs_mgr.
Bug: 222065493
Test: builds
Change-Id: I9ce4aa2594a4e946c79a51f0ed3d2121c7eaee36
2022-03-01 14:12:26 -08:00
David Anderson
dac0476112 fs_mgr: Add force_super_partition bootconfig option to avoid slot suffixing alternate super partition names.
Bug: 171024225
Test: manual test
Change-Id: I279b8fc6878036b3a3bc767f8d51378a2f795e19
2022-02-28 21:44:36 -08:00
Akilesh Kailash
d494442f90 inspect_cow: Print OTA ops for debugging
Bug: 220991038
Test: inspect_cow
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: Id77518c7c102aca4979e6eccf45c7cc822f9ccd1
2022-02-28 22:05:21 +00:00
Akilesh Kailash
325e2acbb9 snapuserd: Fallback to synchronous I/O if any errors observed during
async merge.

If there are any I/O errors during async merge, we will
retry the I/O in synchronous I/O path. For this to happen,
we have to reset the iterator so that we replay the blocks
which were partially completed during async merge. Furthermore,
we will disable the async merge and continue to do the I/O
in synchronous path.

Additionally, cut down the queue depth to 8 so that
it will decerease the number of the async offload. We don't
want to have a big queue depth with async offload.

Bug: 220991038
Test: Instrument the code to fail the Async I/O's
randomly and make sure merge is completed. Instrumentation
was done both on readahead and merge code path.

Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I0db6d0f46054ca5b8423201a598c726b2c3d21ac
2022-02-24 06:08:26 +00:00
Yi-Yo Chiang
8f73f02e43 fs_mgr: Fix misleading comment text regarding __ANDROID_RECOVERY__
This piece of comment was misleading because it only applies to
BOARD_USES_RECOVERY_AS_BOOT devices. Update the text to give a more
accurate description.

If BOARD_USES_RECOVERY_AS_BOOT is true,
* Recovery ramdisk IS boot ramdisk.
* init_first_stage is actually a symbolic link to
  init_second_stage.recovery, which links libfs_mgr.recovery.

If BOARD_USES_RECOVERY_AS_BOOT is not true,
* init_first_stage is a real binary in the generic ramdisk.
* init_first_stage links libfs_mgr.ramdisk.
* During recovery boot, the '/init' binary could be the
  init_first_stage from the generic ramdisk (A/B), or
  init_second_stage.recovery from the recovery ramdisk (non-A/B;
  standalone recovery partition).

Bug: 219811240
Test: None
Change-Id: Ib395a796f61869c13f1a5f1735ef17c224c26c8c
2022-02-23 16:33:24 +08:00
Yi-yo Chiang
ae0f4d5e45 Merge "TransformFstabForDsu: Insert synthesised entry at end of mount group" 2022-02-20 05:33:41 +00:00
David Anderson
692c6d0f74 Merge "Add a VTS test for Virtual A/B." 2022-02-19 01:28:59 +00:00