Commit graph

3380 commits

Author SHA1 Message Date
David Anderson
e55e3dcd3f vts_fs_test: Relax filesystem constraints for fixed partitions.
Adjust this test to align with VSR. First, skip the test if kernel is
< 5.10 or < Android 13. Second, allow non-dynamic partitions to be vfat.

Bug: 286038059
Test: vts_fs_test on CF
(cherry picked from https://android-review.googlesource.com/q/commit:084c94e43eb2916c84c72de524c6e8c3d5ec2d4f)
Merged-In: I5bd874f68296f7155d8c4366ebc13fe3d59c3ee6
Change-Id: I5bd874f68296f7155d8c4366ebc13fe3d59c3ee6
2023-06-07 04:15:19 +00:00
Akilesh Kailash
ac9fbbcb05 libsnapshot: Turn off vabc_legacy_tests on presubmit
Temporarily turn off these tests until root cause is found.

Bug: 279009697
Test: presubmit
Signed-off-by: Akilesh Kailash <akailash@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:defe8381aac9d461f6de8690b5917771b5f6752f)
Merged-In: I90f695fac318b71871ff60c1f74c90265437687d
Change-Id: I90f695fac318b71871ff60c1f74c90265437687d
2023-05-02 22:09:32 +00:00
David Anderson
18b1d6b489 Merge "snapuserd: Remove legacy xor code." am: 657960396c am: b8a12d8dbd am: d5ce39bd4b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2504296

Change-Id: I216ceec4df6c186a76b3a8bb6cb14dd7943a79fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-15 00:39:33 +00:00
David Anderson
82d1539e99 Merge "libsnapshot: Remove various unused components." am: 2812fd841e am: 86813c34a1 am: 16af71edab
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2536015

Change-Id: I06400e9c71a031f8dbae2c19f6f4488bc4a0cb00
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-15 00:39:19 +00:00
David Anderson
657960396c Merge "snapuserd: Remove legacy xor code." 2023-04-14 23:03:39 +00:00
David Anderson
2812fd841e Merge "libsnapshot: Remove various unused components." 2023-04-14 22:42:42 +00:00
David Anderson
3933cbeba0 libsnapshot: Remove various unused components.
PowerTest is no longer relevant with snapuserd, and was not particularly
good at rooting out dm issues anyway.

make_cow_from_ab_ota and estimate_cow_from_nonab_ota are no longer
relevant as they were mainly for estimation during VABC prototyping.

The update_metadata proto was part of the fuzzer which has since been
removed.

Bug: N/A
Test: th builds
Change-Id: Ie341e360f1824ea16794c4625817cfc8f8b8644b
2023-04-14 13:39:14 -07:00
David Anderson
4b5583334a Merge "libsnapshot: Don't run legacy tests in VTS." am: c2f3d686e9 am: 469d1a33c1 am: ef661826df
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2536971

Change-Id: Iab325e1ac4abd0c289ae1b233ee711e166d6eafc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-14 17:02:49 +00:00
David Anderson
ff92fdb6d3 libsnapshot: Don't run legacy tests in VTS.
Bug: 276035159
Test: builds
Change-Id: I19bca32f636da867445c8b668d3a38ccba5c50f4
2023-04-13 16:39:02 -07:00
David Anderson
a463485bbe Merge "snapuserd_daemon: Modify incorrect print information" am: daae43c95a am: 205231acae am: c9cb2833d6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2535403

Change-Id: I344bbc5ef21483aa33b34bafa4a9515b91a6f774
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-13 18:34:09 +00:00
David Anderson
07f6f239ee Merge "RESTRICT AUTOMERGE: snapuserd: Run snapuserd threads in-process." 2023-04-13 17:55:40 +00:00
mingzhu.wang
44d88ca703 snapuserd_daemon: Modify incorrect print information
StartServerForUserspaceSnapshots function, if the child resulting from
the separation parameter number is not equal to 4, will be print
Malformed message: expected four sub-arguments, but at present there is
print three

Change-Id: Idc240714a65bc3eeb1e2b9958354de98ca4b329e
2023-04-13 17:55:47 +08:00
David Anderson
d0ca20af2c Merge "dmctl: add repalce command to usage list" am: 82c43e8b92 am: a636e29113 am: eddfba21dd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2516857

Change-Id: I44b945cefc37b0dc22ad4f779b05e4e6d3f6d084
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-13 04:49:16 +00:00
mingzhu.wang
d5d7d20d3b dmctl: add repalce command to usage list
If you need to use the replace command, but you can't find it in the
usage list.

Change-Id: I8618ce4b0eff30507fc8846f76aaf858b1a6895e
Signed-off-by: mingzhu.wang <mingzhu.wang@transsion.com>
2023-03-31 15:20:06 +08:00
David Anderson
e74976cccd Merge changes Ib90ae553,I3ca3ad9c
* changes:
  RESTRICT AUTOMERGE: snapuserd: Remove DaemonOps.
  RESTRICT AUTOMERGE: snapuserd: Split the server into two classes.
2023-03-23 18:29:40 +00:00
David Anderson
583941c6af Merge "Remove unused variable mount_point" am: b634c6f527 am: 65bbf1c194 am: 1ca84eea75
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2504916

Change-Id: I3b3c3dc2deba9cf5303a9d5ebdc5bf125edfb853
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-23 17:45:24 +00:00
David Anderson
0172b1cc34 snapuserd: Remove legacy xor code.
Legacy snapuserd had xor optimizations implemented since at the time the
userspace snapshot implementation was a work in progress. We forgot to
ultimately remove the legacy xor code however, so let's do that now.

This should have no impact on devices. An S-frozen device will not be
getting this code because there's no vendor update happening. A T-frozen
device will be using userspace snapshots.

The only scenario this could happen is if a device starts on S vendor,
upgrades to T vendor, enables xor compression, and then updates to U
vendor. This configuration is not supported. Any device with a T+ vendor
should be using userspace snapshots.

Bug: N/A
Test: vabc_legacy_tests
Change-Id: If484a53cb0527393898a7ea703ba6f12d4c9a310
2023-03-23 14:46:28 +00:00
zhangyongpeng
18b3fda9b7 Remove unused variable mount_point
Since aosp/929692, this variable has been discard.

Test: manual

Signed-off-by: zhangyongpeng <zhangyongpeng@xiaomi.com>
Change-Id: I164766c9af06c0c19bc19b258cb866ed7cf36853
2023-03-23 14:14:21 +08:00
David Anderson
1f527c34dd RESTRICT AUTOMERGE: snapuserd: Run snapuserd threads in-process.
This removes the temporary daemon and socket and instead directly embeds
SnapshotHandlerManager. We can also remove the test flags for io_uring
as with this they're no longer necessary.

Bug: 269361087
Test: snapuserd_test
Change-Id: I728186d9bc90c98fabd76d3f86569840488ada96
2023-03-22 19:30:11 +00:00
David Anderson
369c993f5d RESTRICT AUTOMERGE: snapuserd: Remove DaemonOps.
These are only used for a single switch statement. Just compare the
input strings instead.

Bug: 269361087
Test: builds, ota applies

Change-Id: Ib90ae55309ea99c181585c64ed2ac814e5ed6c72
2023-03-22 19:30:04 +00:00
David Anderson
4983e1d33c RESTRICT AUTOMERGE: snapuserd: Split the server into two classes.
This splits server into two classes: one that handles the IPC requests,
and one that managers snapshot handlers. This will allow embedding of
the snapshot handling code, without booting up a server. It'll also make
testing much easier.

The handler code has been further placed behind a virtual interface,
though this is likely unnecessary unless we start testing the server
logic itself (or attempt to unify the S and T+ versions of snapuserd).

Bug: 269361087
Test: ota
Change-Id: I3ca3ad9c8c1fb910a1c7bf9f44165e2f44c930c9
2023-03-22 19:29:15 +00:00
David Anderson
04abb053df Merge "Remove the libsnapshot fuzzer." am: 674b650c8d am: 32e67a2d3b am: 272efe646b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2486579

Change-Id: I45b2d54685dd4f2f16d08a1bf43c373f9cf54f3b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-15 18:23:59 +00:00
Sam Dubey
55f9fa3911 Remove the libsnapshot fuzzer.
Follow u aosp/2480175

Test Breakage: http://shortn/_YhuHhWTtnw

(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a3faea8551c03d55924f013b479e869dda8fb166)
Change-Id: I82b0bc9be70fab249b17d6a5b96af09ee14b1586
2023-03-14 11:23:15 +00:00
David Anderson
51ff34aea4 Merge changes Ife319450,I2ecf838b am: 10c200db28 am: 09047e2366 am: d761b63bb0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2481033

Change-Id: Ic973d4cb0762bcdfa1267caf3f2fb8536f0ebe96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-13 20:35:31 +00:00
David Anderson
b4e1f15f23 Merge changes I262391dd,I18aad4a5,I0786e475 am: 8845b1d9c7 am: 20c34a1d1d am: 993dddbd97
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2443802

Change-Id: Ib202df90ef295580ba5c5995589533ebcd339211
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-13 20:34:39 +00:00
David Anderson
10c200db28 Merge changes Ife319450,I2ecf838b
* changes:
  snapshotctl: Display merge progress and phases.
  Remove the libsnapshot fuzzer.
2023-03-13 19:27:06 +00:00
David Anderson
8845b1d9c7 Merge changes I262391dd,I18aad4a5,I0786e475
* changes:
  snapuserd: Move socket and io_uring status out of core and into the server.
  snapuserd: Rename UserSnapshotDmUserHandler to HandlerThread.
  snapuserd: Split out the implementation into a libsnapuserd component.
2023-03-13 18:53:28 +00:00
David Anderson
efcc9ae010 snapshotctl: Display merge progress and phases.
Bug: N/A
Test: snapshotctl dump during merge phase
Change-Id: Ife319450b28c8c58268a03127e9f58c47fc224d8
2023-03-13 10:53:54 -07:00
David Anderson
6aaae78047 Remove the libsnapshot fuzzer.
The only bugs in the corpus here were bugs in the fuzzer itself. Part
of the reason is its speed - it's limited by the dm layer so can't fuzz
optimally. That also makes it difficult to maintain, since it's
effectively a functional OTA fuzzer, and is very sensitive to the
implementation of libsnapshot.

After discussing this through with the team, we think the best course is
to sunset this and aim for improved unit and functional OTA testing.

Bug: 227656961
Test: builds
Change-Id: I2ecf838be336ee06459988ef282f0694cebfce51
2023-03-09 08:35:49 -08:00
Treehugger Robot
6467df2c7a Merge "libsnapshot: Fix test failures on certain configurations." am: 57feb3fbbd am: 5003beff7e am: c032f179dd
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2473164

Change-Id: Id59098c83d200ac0403bce53ba948dbc14724d2c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-07 20:17:50 +00:00
David Anderson
4c17a07053 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 11-5.4 with vabc enabled
Change-Id: I4c1e88fac54732c21c88169a7e0dd664e3858b89
2023-03-06 23:21:25 +00:00
Kelvin Zhang
6fad7bc7ff Merge "Initialize COW options using update manifest" am: 2a2760fe0a am: 599cc32d20 am: 7065ced9b9
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2454005

Change-Id: I2ce8d6c952096752ac6b2d5c5b36c3898264461a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-24 07:09:36 +00:00
Kelvin Zhang
b5a9607232 Initialize COW options using update manifest
Update manifest contains feature specifications such as whether to use
multi-threading or batched writes, initialize COW options using the
manifest allows these features to be enabled/disabled at update install
time.

Test: th
Change-Id: Iff66c43567d4890ae1c88624db49014584b1d96f
2023-02-23 13:21:20 -08:00
David Anderson
35badb7c5e snapuserd: Move socket and io_uring status out of core and into the server.
By moving these bits into the SnapshotHandler constructor, it will allow
easier testing and breaking of dependencies on server.

Bug: 269361087
Test: snapuserd_test
Change-Id: I262391dd36e02eb8b7c50f1972623578b69616f3
2023-02-17 11:17:44 -08:00
David Anderson
c0c700f5b7 snapuserd: Rename UserSnapshotDmUserHandler to HandlerThread.
This makes it easier to type, mostly, but clarifies that it's really
just a holder object for a SnapshotHandler, and HandlerHolder would
look too odd.

Bug: 269361087
Test: snapuserd builds
Change-Id: I18aad4a58814f1e14d71cdabdd7b5ef137bd24b5
2023-02-17 10:44:50 -08:00
David Anderson
c59682f903 snapuserd: Split out the implementation into a libsnapuserd component.
Bug: N/A
Test: builds
Change-Id: I0786e4750feeaa48ba89f6e15f8038d4b44a04c8
2023-02-17 10:33:31 -08:00
David Anderson
012a8625bd Merge "snapuserd: Use fixtures in snapuserd_test." am: 9bbe597b59 am: 6be3810b15 am: 1e21b9f11c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2436355

Change-Id: If5e4a0a217813e70a5f81c80bcda41ee584ede93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-15 20:36:40 +00:00
David Anderson
5169ec88c6 snapuserd: Use fixtures in snapuserd_test.
This refactors snapuserd_test to use SnapuserdTest as a fixture, to
avoid needing a separate harness instance.

Bug: 269361087
Test: snapuserd_test
Change-Id: Iffdc7b621dbe0aff72eff790e7af3f6bb33036ee
2023-02-14 16:59:31 -08:00
David Anderson
b7d8b7e150 Merge "liblp: Fix a crash when adding an image to a partition with no extents." am: 69863bd977 am: 6b4cc0a8ad am: 40fc9593b7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2428712

Change-Id: If858e96872264f3c047b561478375f4a13501a38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-14 01:50:28 +00:00
David Anderson
69863bd977 Merge "liblp: Fix a crash when adding an image to a partition with no extents." 2023-02-13 23:28:14 +00:00
Akilesh Kailash
71fcb07f4b Merge "libsnapshot: Wait for daemon to terminate after snapshot unamp" am: 1324002fbf am: 9690d12f8b am: 2a14ed409f
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2431652

Change-Id: Ia67d92ef34b8ddda4969add6afe089586e3e1868
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-11 02:49:06 +00:00
Akilesh Kailash
d2063ad7dd libsnapshot: Wait for daemon to terminate after snapshot unamp
During verification, update-engine will invoke
SnapshotMap() and Unmap() for every partition verification.

Post Unmap(), update-engine immediately invokes Map()
for next partition. This is a narrow window wherein, daemon
from previous unmap() is still present and init hasn't
terminated it. Thus, when next MapSnapshot() is invoked,
Connect() fails as init may end up terminating the service.

Wait for the daemon to fully terminate and exit
when Detach() is invoked.

Bug: 258514587
Test: OTA on Pixel, Map/Unmap in a loop
Change-Id: I36b7ce183dfa4c89a873118876d195480e28d48c
Signed-off-by: Akilesh Kailash <akailash@google.com>
2023-02-10 14:31:52 -08:00
David Anderson
8fc623eb63 liblp: Fix a crash when adding an image to a partition with no extents.
Bug: N/A
Test: lpmake --partition=system:readonly:0 --image=system=system.img
Change-Id: I4de616cc1b9ca2838d38518ec24a382f4bc1b1be
2023-02-08 22:09:58 -08:00
David Anderson
adeb7085b3 Merge changes I72cf6f52,I9620e5b4 am: 40bb403c45 am: bb0a97e139 am: 3af14713fa
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2423148

Change-Id: Ia02b7a2938565c705fb20b9caa5aff2193387c76
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-08 05:49:32 +00:00
David Anderson
40bb403c45 Merge changes I72cf6f52,I9620e5b4
* changes:
  libsnapshot: Fix crash in cow writer test due to missing ASSERT.
  libsnapshot: Improve low space tests.
2023-02-08 04:03:55 +00:00
Treehugger Robot
d9b0b01919 Merge "UDC: Dm-Bow failed to load when size is not Multiple of 4096" am: 525c8bbc08 am: 6062d29256 am: 6263f499cc
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2401132

Change-Id: I49eced12263c0246c5050cb2df5e58a1dbf7a03f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-07 20:49:34 +00:00
Treehugger Robot
525c8bbc08 Merge "UDC: Dm-Bow failed to load when size is not Multiple of 4096" 2023-02-07 18:44:37 +00:00
David Anderson
bda181a86a libsnapshot: Fix crash in cow writer test due to missing ASSERT.
Bug: N/A
Test: vts_libsnapshot_test
Change-Id: I72cf6f52fc15061da669d14cf5d334b44ad83501
2023-02-07 05:24:27 +00:00
David Anderson
111bec1e90 libsnapshot: Improve low space tests.
These tests have historically been pretty flaky, and have gone through a
few rounds of improvement. This is yet another: remove the
parameterization, so we can test that at least one variant of the test
succeeds, rather than all of them.

Filesystems (especially F2FS) have a lot going on underneath the hood,
and there's no guarantee that precise free space can be allocated,
measured, or relied upon in the ways this test expects. And all that we
really need to test is that some kind of out-of-space error can be
triggered.

Bug: 266645706
Test: vts_libsnapshot_test
Change-Id: I9620e5b496d5020b21cc37074e87dd21fc419ed2
2023-02-07 05:24:26 +00:00
Kelvin Zhang
373610601d Merge "Set output value in error case" am: a0427c41c1 am: 1e3d01abb3 am: e72eeb31b2
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2417979

Change-Id: Ibd273ba1cb07102e75bf483f627f99b65f89acb4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-02 21:43:32 +00:00