Commit graph

55663 commits

Author SHA1 Message Date
Luca Stefani
57909b4c30 Remove more duplicated symlinks
They're all created in rootdir/Android.mk

Test: m
Change-Id: I1bf07301434d8cf4f2e9226071983d7aeaf149ac
2020-02-10 22:23:29 +01:00
Luca Stefani
8c61e7da49 Remove duplicated debugfs symlink
* Currently it's created at build-time in rootdir/Android.mk

Test: m
Change-Id: I48e8ebf3412dfdfc2dff3b4fcf9b72de52726865
2020-02-10 21:56:03 +01:00
Josh Gao
68f2e9cf1b Merge changes Ia8f83a53,Ia1f6a659
* changes:
  adbd: add a perfunctory abb test.
  adb: switch tests to python3.
2020-02-10 19:11:26 +00:00
Steven Moreland
579e4b3d2b Merge "libinit_test_utils: don't assume interface format" 2020-02-10 17:44:05 +00:00
Nikita Ioffe
15e4f6fe5a Merge "Don't log userspace_reboot.started/finished properties from init" 2020-02-10 17:22:03 +00:00
Treehugger Robot
1ac1d86b7d Merge "trace-container: Check /sys/kernel/tracing for tracefs" 2020-02-10 16:41:16 +00:00
Tom Cherry
2157b2065e Merge "init: group source files better in Android.bp" 2020-02-10 14:49:02 +00:00
Treehugger Robot
9421b60aef Merge "Convert system/core/fs_mgr to Result::ok()" 2020-02-10 14:44:25 +00:00
Bernie Innocenti
ba9b73ef8f Convert system/core/fs_mgr to Result::ok()
No functionality changes.

Test: m checkbuild
Change-Id: I96b2adfe7aaea2b2e67307a3ce308455bc1d7a0a
2020-02-10 08:20:25 +09:00
Nikita Ioffe
335be083e1 Merge "Reset dev.bootcomplete property during userspace reboot" 2020-02-08 17:30:57 +00:00
Josh Gao
e4d66fc678 adbd: add a perfunctory abb test.
Bug: http://b/148838069
Test: python3 -m unittest test_device.AbbTest
Change-Id: Ia8f83a535d4a513f4bdce5cfa4bfe69cd2dbb634
2020-02-07 15:59:49 -08:00
Josh Gao
93dee964d4 adb: switch tests to python3.
Test: treehugger
Change-Id: Ia1f6a659e23f5d9e63c9b106c60d56b5b954b19c
2020-02-07 15:59:49 -08:00
David Anderson
ac892d7569 Merge "Don't require bootloader fastboot for VTS compliance." 2020-02-07 21:46:01 +00:00
Steven Moreland
bb44cd6ea1 libinit_test_utils: don't assume interface format
These can be AIDL or HIDL interfaces. Avoiding assuming the format here.

Bug: 141008902
Test: vts_ibase_test
Change-Id: If60367e3a46c74a1d28548379655f5e211f58b73
2020-02-07 13:39:35 -08:00
Hridya Valsaraju
5cdb5d4619 trace-container: Check /sys/kernel/tracing for tracefs
tracefs will be mounted at /sys/kernel/tracing when debugfs
is not mounted.

Bug: 134669095
Test: atest AtraceHostTest
Change-Id: I8178babaa6928ac3796622bdb08f123428ccd191
2020-02-07 11:08:21 -08:00
Nikita Ioffe
c2bc1a3422 Reset dev.bootcomplete property during userspace reboot
Test: adb reboot userspace
Bug: 135984674
Change-Id: I7c6e433c819fc22e88820626768fe8832882386e
2020-02-07 17:42:27 +00:00
Nikita Ioffe
85ff4ab9a4 Don't log userspace_reboot.started/finished properties from init
Instead they will be logged from system_server. This CL just prepares
grounds for logging CL to land.

Test: adb reboot userspace
Bug: 148767783
Change-Id: Ie9482ef735344ecfb0de8a37785d314a3c0417ff
2020-02-07 14:41:39 +00:00
Treehugger Robot
86e13d79cc Merge "rm libbinderthreadstate" 2020-02-07 11:18:51 +00:00
Treehugger Robot
39e990d477 Merge "Convert system/core to Result::ok()" 2020-02-07 06:14:16 +00:00
Treehugger Robot
9b7d688ea4 Merge "Increases fastbootd response message size" 2020-02-07 04:27:00 +00:00
Steven Moreland
f5f9e3594c rm libbinderthreadstate
This library is empty, and its functionality has moved
into libbinder/libhwbinder.

Bug: 148692216
Test: N/A
Change-Id: I306a2c18ec7770cfb6c3939b5e3d42a55c3165fb
2020-02-06 13:25:34 -08:00
David Anderson
7868246e30 Don't require bootloader fastboot for VTS compliance.
Bug: 144820025
Test: vts
Change-Id: Ib99ddbe611645fe0f89134a628ddb486b02df170
2020-02-06 13:13:56 -08:00
Tom Cherry
66196495f2 init: group source files better in Android.bp
Test: build
Change-Id: I780a82122a08840257c44bff0b93ea6b25f0b2f0
2020-02-06 12:03:05 -08:00
Tom Cherry
62662cf189 Merge "init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()" 2020-02-06 19:14:37 +00:00
Tom Cherry
91bbe9ef56 Merge "Check Errorf()/ErrnoErrorf() format string at compile time" 2020-02-06 19:14:15 +00:00
Bernie Innocenti
cecebbbacc Convert system/core to Result::ok()
No functionality changes, this is a mechanical cleanup.

Test: m
Test: cd system/core && atest
Change-Id: Ifdaa3ce1947ed578f656d5a446978726eb416c36
2020-02-06 17:04:27 +00:00
Treehugger Robot
a6bc86aae7 Merge "Add libsnapshot_test to presubmit" 2020-02-06 16:58:43 +00:00
David Anderson
24c70ea7ba Merge "libsnapshot: Restrict when snapshots can be deleted." 2020-02-06 16:46:58 +00:00
Tom Cherry
1153fbbcd3 Merge "liblog: null terminate log_msg" 2020-02-06 15:31:56 +00:00
Alessio Balsini
9ab7fe2768 Add libsnapshot_test to presubmit
Add libsnapshot test to the TEST_MAPPING's presubmit of fs_mgr to run
the test on TH whenever changes are applied to the fs_mgr contents.
Some of the tests are temporarily disabled due to a WIP bug.

Test: TH
Bug: 142513589
Change-Id: I2a283645b433ed1fd2b08d1c4919cac26d19cf16
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-06 14:58:25 +00:00
Bernie Innocenti
4df09e4685 Merge "Add macros to check for successful Result" 2020-02-06 12:32:59 +00:00
Treehugger Robot
d25c64bbf2 Merge "Add android::base::expected::ok()" 2020-02-06 08:37:49 +00:00
Bowgo Tsai
27d5fb344b Increases fastbootd response message size
Some output of `fastboot getvar` exceeds current message size.
Increases the message size to 256 to fix the issue.

Bug: 74445765
Bug: 144473561
Test: fastboot getvar system-fingerprint
Change-Id: Id5064be4bb500697ce87c473f662d86c7c344d65
2020-02-06 16:22:59 +08:00
Treehugger Robot
7bb8a000a7 Merge "bootstat: Migrate to StatsLog for metrics" 2020-02-06 07:41:39 +00:00
Bernie Innocenti
beffc028d6 Add macros to check for successful Result
These macros are meant to be used in tests:

  Result<File> maybe_a_file = OpenFile(...);
  EXPECT_OK(maybe_a_file);

On failure, the error is printed.

There's no equivalent EXPECT_NOT_OK() because it is a testing anti-pattern
which causes tests to pass even when the error changed as a result of a
regression. Use EPECT_EQ(result, Error(...)) instead.

Test: cd system/core && atest
Test: m
Change-Id: Ie26f90d3c62620e7b1f10013829ba43ef5364fe1
2020-02-06 15:27:26 +09:00
Bernie Innocenti
4adfde41ea Add android::base::expected::ok()
This is an alias for has_value() which is meant to be more concise, yet
more explicit than the conversions to bool.

Leave operator bool() in place for now: due to the large number of
users, removal of operator bool() needs to be broken up into incremental
stages.

Test: cd system/core && atest
Test: m
Change-Id: Ib1eb00f47d3c0f2229bb176b62687463b834f280
2020-02-06 15:27:26 +09:00
Treehugger Robot
07e74d65a2 Merge "use apex_test for test apexes" 2020-02-06 01:34:46 +00:00
David Anderson
367cca3937 libsnapshot: Restrict when snapshots can be deleted.
Do not delete snapshots for any reason other than merge-complete or a
cancel request from update_engine. Additionally, create a rollback
indicator file if booting into the source slot, so update_engine can
attempt to cancel the update.

Bug: 147819418
Bug: 147347110
Test: libsnapshot_test gtest
Change-Id: Id357a91cec467a60246c7c3d133f6c54ccb3fc93
2020-02-05 17:16:17 -08:00
Treehugger Robot
a800e1ee9d Merge changes I63b5e69b,I85c6af63
* changes:
  fiemap: add image_test and writer_test tests to presubmit
  fiemap: fix fiemap size and log message when last extent
2020-02-05 23:47:45 +00:00
Tom Cherry
d44a5f840d liblog: null terminate log_msg
Also, use LOGGER_ENTRY_MAX_LEN instead of sizeof(log_msg) for ensuring
that the read did not overflow, since sizeof(log_msg) is one byte
longer to allow for placing a null terminator already.

Bug: 148966104
Test: liblog unit tests
Change-Id: Id4fe8aa5da44e9d62f59b6541f157a4e7b038d07
2020-02-05 15:04:32 -08:00
Alessio Balsini
c352179e10 fiemap: add image_test and writer_test tests to presubmit
Add fiemap_image_test and fiemap_writer_test to TEST_MAPPING to be run
by TH as presubmits.
Because of a bug under investigation, the actual
fiemap_image_test_presubmit is used instead of the original, that has
one test case disabled.

Bug: none
Test: TH, fiemap_image_test, fiemap_writer_test
Change-Id: I63b5e69b5c245a18eceb1e5896df7bd0577f289b
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-05 22:08:29 +00:00
Keun young Park
606af6dfff bootstat: Migrate to StatsLog for metrics
- All events are migrated to StatsLog atoms.
- Still keep the string based name for BootEvent logging as that makes it
  easier for debugging purpose.

Bug: 132691841
Test: check boot related stats are pushed after boot up
      $ adb shell cmd stats print-stats

Change-Id: I33313695a8a2d0a3c74f7705c0843c8c4bad2133
Merged-In: I33313695a8a2d0a3c74f7705c0843c8c4bad2133
2020-02-05 12:53:24 -08:00
Alessio Balsini
f6034544c0 fiemap: fix fiemap size and log message when last extent
Fix the total fiemap struct plus extents size allocation.
Fix also the logging in IsLastExtent, that was printing error messages
every time.

Bug: none
Test: fiemap_*_test
Change-Id: I85c6af63ba3a75b993a5e8ad7d7170dc7af59582
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-05 18:27:40 +00:00
Tom Cherry
57b9428471 init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()
Test: force init to print this line and see the log message
Change-Id: Ibb74572347f915cd76cc50f4c19126b66f562810
2020-02-05 07:57:14 -08:00
Tom Cherry
f8e6bf6d81 Check Errorf()/ErrnoErrorf() format string at compile time
fmtlib provides compile time checking of format strings that we're not
currently using.  This change makes Errorf() and ErrnoErrorf() into
macros such that we can take advantage of this capability.

Test: build successfully normally
Test: fail the build if using an invalid format string
Change-Id: Icb8ba8cb973bbd1fa4755a62e7598bdbb0113757
2020-02-05 07:57:14 -08:00
Treehugger Robot
e6211eb978 Merge "first_stage_mount: reading all avb_keys before chroot" 2020-02-05 13:42:34 +00:00
Jiyong Park
17730e7cf6 use apex_test for test apexes
... so that the build system can distinguish testing APEXes and installable APEXes, and apply
different rules to them.

Bug: 146308764
Test: m
Change-Id: I5fdab94da352e8014225b2454aacc2a5b5fc6a52
2020-02-05 18:44:10 +09:00
Bowgo Tsai
e0f5c10691 first_stage_mount: reading all avb_keys before chroot
Avb keys used to verify a partition are stored in the first-stage
ramdisk. However, after /system is mounted, init will chroot into it.
This makes those keys inaccessible for later mounts, e.g., /vendor or
/product.

This change retains avb keys by reading all of them before chroot
into /system.

Note that it is intentional to perform public matching for both
preload_avb_key_blobs and fstab_entry.avb_keys in libfs_avb.
As some keys might only be availble before init chroots into /system,
e.g., /avb/key1 in the first-stage ramdisk, while other keys might
only be available after the chroot, e.g., /system/etc/avb/key2.

Bug: 147585411
Test: specify avb_keys for a partition and checks the keys are preloaded
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: I6bd490c4215480db2937cdfc3fea0d616e224a91
2020-02-05 15:51:41 +08:00
Bernie Innocenti
ab65ef22a5 Merge "Delete dangerous comparison operators from base::expected" 2020-02-05 05:51:45 +00:00
Treehugger Robot
3cbb753b0d Merge "liblp: add test to presubmit" 2020-02-05 01:20:36 +00:00