Commit graph

81115 commits

Author SHA1 Message Date
Treehugger Robot
76323f64be Merge "BatteryMonitor: support battery health INCONSISTENT from health status" 2023-05-26 02:33:22 +00:00
Treehugger Robot
059954a6b2 Merge "Chang flash task to take in source" 2023-05-25 21:46:01 +00:00
Daniel Zheng
791a83bb45 Chang flash task to take in source
Old changes didn't actually take into account sources. fastboot update
{update.zip} should read fastboot-info from the update package. It was
instead flashing local images + reading local fastboot-info.txt

Test: m fastboot, fastboot update, fastboot flashall
Bug: 283330320

Change-Id: I9587a7735ddfbfb661153eb12ebc3caa7c32f141
2023-05-25 13:29:16 -07:00
Treehugger Robot
2dc80e3805 Merge "Updated the policy file associated with riscv64" 2023-05-25 17:29:40 +00:00
liwentao
4d8f37edae Updated the policy file associated with riscv64
The generate.sh script can generate the file, but current policy file does not match it.
And the rules are not appropriate, like missing "sysinfo", causing the
debuggerd_test to fail in system model. So we match the policy to
what it should be.

Test: make debuggerd_test

Change-Id: I57ebd7713f2ab939d01bfefcc7935e234fdd3e13
Signed-off-by: liwentao <liwentao@eswincomputing.com>
2023-05-25 18:08:02 +08:00
Treehugger Robot
852e22d7c3 Merge "ueventd: Wait for runtime apex before running external firmware handler" 2023-05-25 01:40:10 +00:00
Christopher Ferris
ec56afc415 Merge "Limit the number of log messages in a tombstone." 2023-05-25 00:27:47 +00:00
Christopher Ferris
98d6242dc7 Limit the number of log messages in a tombstone.
Some testing environments can have a test that is sending many
thousands of messages to the log. When this type of process crashes
all of these log messages are captured and can cause OOM errors
while creating the tombstone.

Added a test to verify the log messages are truncated. Leaving this
test disabled for now since it is inherently flaky due to having to
assume that 500 messages are in the log.

Added a test for a newline in a log message since it's somewhat
related to this change.

NOTE: The total number of messages is capped at 500, but if a message
contains multiple newlines, the total messages will exceed 500.
Counting messages this way seems to be in the spirit of the cap,
that a process logging a large message with multiple newlines does
not completely fill the tombstone log data.

Bug: 269182937
Bug: 282661754

Test: All unit tests pass.
Test: The disabled max_log_messages test passes.
Change-Id: If18e62b29f899c2c4670101b402e37762bffbec6
2023-05-24 20:10:55 +00:00
Treehugger Robot
eb8079e656 Merge "Fix overflow issue when computing ideal size of scratch partition" 2023-05-24 05:35:50 +00:00
Jack Wu
8231c3fe2d BatteryMonitor: support battery health INCONSISTENT from health status
Report Battery health INCONSISTENT when there is a battery recalibration
pending.

Bug: 283182048
Test: m
Change-Id: I8b944ddac7cc919fc95b1b71b015101642a62f96
Signed-off-by: Jack Wu <wjack@google.com>
2023-05-24 03:25:59 +00:00
Daniel Zheng
5efd90644b Merge "Fixing constructors to match header files" 2023-05-24 00:06:09 +00:00
Steven Moreland
89a4db46f5 Merge "init_kill_services_test: special case apexd" 2023-05-23 18:18:02 +00:00
Steven Moreland
4350592133 init_kill_services_test: special case apexd
apexd restarts the device, so it causes flakes here,
especially in presubmit.

Bug: 280514080
Test: init_kill_services_test

Change-Id: I4455704795961f3ae94e29bdf098eca739130973
2023-05-23 18:17:57 +00:00
Daniel Zheng
5a9905a62b Fixing constructors to match header files
Constructor in cpp file doesn't match header file

Test: m fastboot, fastboot flashall -w
Change-Id: I2c720bb594efca5af1e5a374277543a522ced5ef
2023-05-23 10:51:01 -07:00
Treehugger Robot
280fd9f011 Merge "Remove libdiskconfig as it is no longer used" 2023-05-23 16:33:31 +00:00
Ray Chin
702a779edb Fix overflow issue when computing ideal size of scratch partition
The type of f_frsize is `unsigned long` which is 32 bit for some system so it will overflow after multiplied by f_bfree. This solution adds one more type casting to ensure the type is 64 bit unsigned integer during the computing.

Bug: 281599020
Test: adb root; adb shell disable-verity
Change-Id: I377ed722d5e245c235c3ae12ff66ac7e91d1d6e8
2023-05-23 09:49:19 +00:00
Devin Moore
5729d860cd Remove libdiskconfig as it is no longer used
Test: m
Bug: 280829178
Change-Id: I1da275ef13dea92b8c1021aa3d658569c4cf782e
2023-05-23 00:24:04 +00:00
Christopher Ferris
34de747570 Merge "debuggerd: simplify output handling" 2023-05-22 19:31:45 +00:00
David Anderson
bf11ce74ff Merge "libfiemap: Handle EAGAIN in fallocate()." 2023-05-22 17:39:07 +00:00
Frederick Mayle
56abaa0959 debuggerd: simplify output handling
Just noticed some opportunities while skimming.

Test: adb shell debuggerd $(adb shell pidof com.android.systemui)
Test: All unit tests pass (both 32 bit and 64 bit).
Test: Ran unit tests in a loop hundreds of times.
Change-Id: I428d0cf599ed603a21944b084b95594db893cbd5
2023-05-19 15:19:06 -07:00
David Anderson
2fb1c671d5 Merge "ueventd: Fix a race condition in handling device-mapper events." 2023-05-19 19:43:21 +00:00
Christopher Ferris
6e80656bf7 Merge "debuggerd_client_test: less racy test setup" 2023-05-19 18:01:29 +00:00
Maciej Żenczykowski
97055b7ee9 Merge "NetlinkEvent: use isKernel64Bit in KernelUtils.h" 2023-05-19 05:24:22 +00:00
Patrick Rohr
eb13daf905 NetlinkEvent: use isKernel64Bit in KernelUtils.h
Now that the code has moved, delete the local implementation in favor of
the common one.

Test: builds
Change-Id: Ic29d7c9bcd3d623204f3e4de3a3434483021cbac
2023-05-18 14:36:57 -07:00
Steven Moreland
159bd29580 Merge "init_kill_services_test: log state" 2023-05-18 17:08:39 +00:00
David Drysdale
f009f927d0 Merge "Set IMEI in provisioning helper" 2023-05-18 06:24:32 +00:00
Steven Moreland
16e08075ba init_kill_services_test: log state
It can be difficult to figure out where this test
is while it's executing, so I've added logs.

Bug: 280514080
Test: init_kill_services_test (w/o tradefed to avoid reboot), then:
:) adb logcat -d | grep init_kill_services_test
... I init_kill_services_test: hello lmkd!
... I init_kill_services_test: okay, now goodbye lmkd
... I init_kill_services_test: I said goodbye lmkd!
... I init_kill_services_test: are you still there lmkd?
... I init_kill_services_test: I'm done with lmkd
... I init_kill_services_test: hello ueventd!
... I init_kill_services_test: okay, now goodbye ueventd
... I init_kill_services_test: I said goodbye ueventd!
... I init_kill_services_test: are you still there ueventd?
... I init_kill_services_test: I'm done with ueventd
... I init_kill_services_test: hello hwservicemanager!
... I init_kill_services_test: okay, now goodbye hwservicemanager
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: I said goodbye hwservicemanager!
... I init_kill_services_test: are you still there hwservicemanager?
... I init_kill_services_test: I'm done with hwservicemanager
... I init_kill_services_test: hello servicemanager!
... I init_kill_services_test: okay, now goodbye servicemanager
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: I said goodbye servicemanager!
... I init_kill_services_test: are you still there servicemanager?
... I init_kill_services_test: I'm done with servicemanager

Change-Id: I2466f574fc06cdf1b01db82f89649f39b0f34345
2023-05-17 23:20:53 +00:00
David Anderson
0fa371076a libfiemap: Handle EAGAIN in fallocate().
When we changed our ENOSPC tests, it exposed a path in F2FS were
fallocate can return EAGAIN. This is expected if F2FS attempts GC to
acquire more chunks, and it can leave the file in a partially allocated
state.

As a fix, keep attempting fallocate() as long as (1) it returns EAGAIN,
and (2) the allocated size keeps growing. If (2) fails we return ENOSPC.

Bug: N/A
Test: treehugger
Change-Id: I5f867b5a200b9260e486985f203f9872a949b3f9
2023-05-17 15:52:33 -07:00
David Anderson
59abbfe647 ueventd: Fix a race condition in handling device-mapper events.
We've had flake in libdm_test for a long time, with no clear cause.
Lately however it has become particularly reproducible when running
the UeventAfterLoadTable test in isolation, and thus we've identified
the root cause.

uevents for device-mapper are fired when the sysfs node is added, but at
that time, the "dm" subnode has not yet been added. The root node and dm
node are added very close together, so usually it works, but sometimes
ueventd is too fast.

Instead of relying on sysfs, query the uuid/name node directly from
device-mapper.

Bug: 270183812
Test: libdm_test
Change-Id: I258de5de05d813c3cb7f129e82e56dbfe8bf3117
2023-05-17 15:52:16 -07:00
Frederick Mayle
52205b8206 debuggerd_client_test: less racy test setup
Make sure that all the threads have started up, otherwise the main part
of the test might not be testing as stressful a situation as expected.
Note that the "race" moniker is still valid because of the debuggerd
timeout.

The test is now faster (405ms) when run under good conditions.

Test: atest 'debuggerd_test:debuggerd_client#race'
Test: Ran debuggerd_client.race 1000 times on its own.
Test: Ran the whole suite of debuggerd unit tests 1000 times.
Change-Id: I487e7654a71df9f1799f09c6f385c929ddf2f234
2023-05-17 12:50:51 -07:00
Automerger Merge Worker
411a160ecb Merge changes from topic "am-558ef604bf3c4c1c8ddefc69ffec2c23"
* changes:
  Merge "DO NOT MERGE: libsnapshot: Fix test failures on certain configurations." into android13-tests-dev am: 1264f39449
  [automerger skipped] DO NOT MERGE: libsnapshot: Fix test failures on certain configurations. am: 3f96053b38 -s ours
2023-05-17 19:34:26 +00:00
David Anderson
0b65c3a385 Merge "DO NOT MERGE: libsnapshot: Fix test failures on certain configurations." into android13-tests-dev am: 1264f39449
Original change: https://android-review.googlesource.com/c/platform/system/core/+/2577014

Change-Id: Iddb21b0f93724cbf4a02526d65fd724f78790ef0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 19:34:21 +00:00
David Anderson
55b5aa1730 [automerger skipped] DO NOT MERGE: libsnapshot: Fix test failures on certain configurations. am: 3f96053b38 -s ours
am skip reason: skipped by user dvander

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2577014

Change-Id: Ie3c4bf3d52ddcf6ca7e13cf108f523b2b5f45fc7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 19:34:20 +00:00
David Anderson
1264f39449 Merge "DO NOT MERGE: libsnapshot: Fix test failures on certain configurations." into android13-tests-dev 2023-05-17 18:22:26 +00:00
David Drysdale
e556021b52 Set IMEI in provisioning helper
Borrow the code from AttestKeyTest.cpp (in KeyMint VTS) for determining
the devices IMEI value(s), and use that as default value.

Also update to use the newer provisioning message if the second IMEI is
set.

Test: provision a test device
Change-Id: Ie8e183dc50ac9107c2c2c2966c591e8b6022fd20
2023-05-17 18:12:00 +01:00
Pawan Wagh
c51ed4c56e Merge "Return error from gatekeeperd" 2023-05-16 23:17:47 +00:00
Mike McTernan
3fbe2ca34e Merge "confirmationui:fuzzer: update contact details" 2023-05-16 20:10:47 +00:00
Treehugger Robot
9f6e88567b Merge "Support ZSTD in userspace COW" 2023-05-16 19:02:57 +00:00
Kelvin Zhang
32dcac7851 Support ZSTD in userspace COW
Perf:
Lz4:
Update took 429 seconds
merge time 35.4s
cow size: 3.18GB

ZSTD:
Update took 676 seconds
merge time 49.4s
cow size: 2.62GB

Gz:
Update took 1057 seconds
merge time: 50.0s
cow size: 2.55GB

In summary, ZSTD is a middle point between LZ4 and GZ.

Speed: LZ4 > ZSTD > GZ
Space: LZ4 > ZSTD > GZ

Bug: 274129758

Change-Id: I203bf088b7c2a9ce429f75478799da0e7126febf
2023-05-16 10:13:52 -07:00
Mike McTernan
4066926374 confirmationui:fuzzer: update contact details
Bug: None
Test: make trusty_confirmationui_tipc_fuzzer
Change-Id: Ie81bf916c41498abc226389f63b22b57da55d446
2023-05-16 09:05:29 +01:00
David Anderson
c6ec101713 Merge "bootstat: Adds additional reboot reason patterns" 2023-05-16 03:03:53 +00:00
Chun-Wei Wang
3e0baf8642 Merge "Export active dsu slot to system prop" 2023-05-16 00:40:49 +00:00
Pawan Wagh
d2d320ab0b Return error from gatekeeperd
Instead of crashing the gatekeeperd on incorrect
inputs to AIDL interface, return errors from the
service.

Test: m gatekeeperd, booted device
Bug: 279970163
Change-Id: Ifd3330e749f4ce147db5886f1f2dbb00c322bed2
2023-05-15 22:29:58 +00:00
JW Wang
a37c4d2796 Export active dsu slot to system prop
The prop can be consumed by init scripts to do customized setup:

on property:ro.gsid.dsu_slot=oemtest
    # Do setup for test
on property:ro.gsid.dsu_slot=oemdemo
    # Do setup for demo

Bug: 277691885
Test: m
Change-Id: I7bd78b9ba31021b27d57c6f092dad5d7ebf6e59b
2023-05-15 09:48:59 +08:00
Treehugger Robot
90bbf8253f Merge "Add support for reading modules.load.charger when booting into charger mode" 2023-05-13 03:09:21 +00:00
Isaac J. Manjarres
6f742376bc Add support for reading modules.load.charger when booting into charger mode
When booting up, Android can boot into one of three modes: normal,
recovery, and charger mode. The set of modules that should be loaded
during first stage init in each mode can differ, which is why init
reads the list of modules to load from modules.load.recovery when
booting into recovery, and modules.load otherwise.

This means that init will read the list of modules to load during first
stage init from modules.load even when booting into charger mode. This
is not ideal, as it causes modules that need to be loaded during
first stage init only when booting into charger mode to also be loaded
during first stage init of normal boot, which can degrade boot time.

Thus, add support for reading modules.load.charger, which contains the
list of modules that need to be loaded during first stage init when
booting into charger mode.

Bug: 266752750
Change-Id: Ib9178bdfe5a6aac57b86b6d453b03625e95d5b48
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
2023-05-12 16:26:35 -07:00
Jiyong Park
a819eb223f Merge "init: automatically add a new loop device when there are no idle loop devices" 2023-05-10 23:22:25 +00:00
David Anderson
25613816d8 Merge "libsnapshot: Fix flaky low-space tests." 2023-05-10 18:29:56 +00:00
David Anderson
d90545bc33 libsnapshot: Fix flaky low-space tests.
These tests have been a plague of flakiness forever, and while we've
made improvements, the test is fundamentally flaky, and keeps showing up
in presubmit.

This change removes the code that attempts to fill /data until it's
almost full, which is unreliable and destructive. Instead, attempt to
allocate a file that is one block smaller than the maximum file size.
This should always fail with ENOSPC, as opposed to the maximum file size
which would fail with EFBIG.

Bug: N/A
Test: vts_libsnapshot_test
Change-Id: I4652b83e31c50975ddb50b6cbe846e102ba0f322
2023-05-09 10:12:14 -07:00
tangjie1
2b26bdf973 init: automatically add a new loop device when there are no idle loop devices
Signed-off-by: tangjie1 <tangjie1@xiaomi.com>
Change-Id: I5fe6df9b733c4932334097aff6b7781dcb34027e
2023-05-09 22:15:33 +08:00