Commit graph

132 commits

Author SHA1 Message Date
Yo Chiang
debd95385f adb-remount-test.sh: Make devt errors warnings instead
OverlayFS on Device Mapper on Dynamic Partition / Split Fiemap doesn't
seem to report stable dev_t values of the underlying "wrapped" device.

For example, when not using overlayFS, the dev_t of a file in /system
may be something like 253:8, a dm-verity wrapped device (253 is device
mapper's major id).
When overlayFS is enabled, the /system mount point is mounted with a
overlayFS device wrapping a dm-linear device wrapping the actual storage
device. In this case, stat-ing a file in /system shows the dev_t to be
something like 0:23. Not only is the major id not correct, the minor id
is not stable across reboots, too.

For now, suppress the error and make it a warning so it don't report
false negatives. We may want to turn this check back on if the overlayfs
driver is fixed of this issue.

Bug: 165925766
Test: adb-remount-test.sh
Change-Id: I035caec3e00d179f227850cbc9835fb3aedf88e5
2020-10-28 05:38:10 +00:00
Mark Salyzyn
08cd8b70c2 fs_mgr: adb-remount-test.sh: filter out more administrivia mounts.
binder /dev/binderfs binder rw,relatime,max=1048576,stats=global 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
/dev/block/dm-3 240548676 3692368 236856308   2% /data_mirror/cur_profiles

are administrative mounts uninteresting to the adb remount test.

Fix system and vendor devt tests, turn them into warnings instead.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 170256128
Bug: 169988379
Test: adb-remount-test.sh
Change-Id: Ie19722a9ad813dce014bc27610e6db035e6c69e9
2020-10-07 08:36:20 -07:00
Dan Shi
67b7dd570f Remove vts10 related configs
Bug: 169582597
Test: build
Change-Id: I38e1e0f8e32b86ab14b905d040c1c62245a1a9e3
2020-10-06 13:52:44 -07:00
Treehugger Robot
1d25b825c5 Merge changes Ie2749dcc,Id1c97b9c,I68d1757d,I8e4b6a80 am: 949f453f7d am: 2702ea29e0
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1365584

Change-Id: I1823d843894805b34723bd13b3cc3d1ed8491b6f
2020-07-17 19:12:45 +00:00
Mark Salyzyn
c9a69b1df1 fs_mgr: adb-remount-test.sh: use 24-bit forground colors
This allows colors to rendor according to user preferences
in terminal emulator settings.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 161454607
Test: make sure colors make sense
Change-Id: Ie2749dcce66954deddbca2863dadfa270cc6633e
2020-07-17 07:46:54 -07:00
Mark Salyzyn
d88715aae6 fs_mgr: adb-remount-test.sh: Port to MAC OS/X
This script did not run on a MAC, adjust so that it is usable.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 161454607
Test: script can be used to test and replicate reported problem
Change-Id: Id1c97b9cd85d150a96733b8d39e40f6a4bcc0721
2020-07-17 07:46:39 -07:00
Mark Salyzyn
3591c2a661 fs_mgr: adb-remount-test.sh report kernel version of device
Report kernel version as part of the report.  Also warn user that
they are waiting for the screen to come up, and if the delay is
far too long, or the device is headless, then consider using the
--no-wait-screen option

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Bug: ????
Change-Id: I68d1757da62d028dc3633b1175b06af19e469d9f
2020-07-17 07:46:29 -07:00
Mark Salyzyn
128155017a fs_mgr: adb-remount-test.sh filter out ramdumpfs administrative mount
Causes flakes as the ramdumpfs may temporarily be applied
to check and/or retrieve content.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 161454607
Test: no more flakes
Change-Id: I8e4b6a808ab81ec5b4f760a810b9b651a0b329d0
2020-07-17 07:46:13 -07:00
Nikita Ioffe
93ed446f28 Merge "Add RootTargetPreparer for CtsInitTestCases and CtsFsMgrTestCases" am: 9c898802ed am: 12b392389a
Change-Id: I6ed92b62d9392d0943f95b25f45846fc3043bef3
2020-04-14 22:34:15 +00:00
Nikita Ioffe
f3504ec58d Add RootTargetPreparer for CtsInitTestCases and CtsFsMgrTestCases
Some of the test cases in CtsInitTestCases and CtsFsMgrTestCases require
root. This CL makes it possible to run such tests cases on userdebug
builds, which in turn means that they will be run on presubmit.

New option was implemented in
https://android-review.googlesource.com/c/platform/tools/tradefederation/+/1283834

Test: atest CtsInitTestCases
Test: atest CtsFsMgrTestCases
Change-Id: I3d29789ddd7ac549e40ac193c58d986670c49285
2020-04-14 18:57:07 +01:00
Nikita Ioffe
7dcdb5797b Merge "get_mounted_entry_for_userdata: Realpath block devices from fstabs" am: 74429fc121 am: 2b45a4ef85
Change-Id: Ie3b02e6cf06f47cd49d39f65b972235b8ee921d2
2020-04-07 12:27:45 +00:00
Nikita Ioffe
74429fc121 Merge "get_mounted_entry_for_userdata: Realpath block devices from fstabs" 2020-04-07 12:01:29 +00:00
Nikita Ioffe
7aa37f1f21 get_mounted_entry_for_userdata: Realpath block devices from fstabs
Use realpath as a canonical representation of block devices. This makes
it easier to reason about block devices. This also fixes a bug, in which
fs_mgr_get_mounted_entry_for_userdata didn't properly work on devices
that don't support metadata encryption.

Test: atest CtsFsMgrTestCases
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 153363818
Change-Id: I139c2be46336a632bbaee86667019c075d7de814
2020-04-07 00:39:19 +01:00
Dan Shi
51aec2b602 Merge "Remove vts10 tests from vts suite" am: 45efd5a27b am: 841aaa90d3
Change-Id: Ic96f2d916195bdf91edc3f66819e8b4719144935
2020-04-06 21:59:39 +00:00
Dan Shi
45efd5a27b Merge "Remove vts10 tests from vts suite" 2020-04-06 21:24:46 +00:00
Bill Peckham
36c627da2a Merge "Ignore functionfs mounts." am: 362a41a4f6 am: 300333e210
Change-Id: I37611b55ba27a5cf7fa07102882c8017bf2274df
2020-04-02 23:27:40 +00:00
Bill Peckham
647a8cdd44 Ignore functionfs mounts.
Vendors may add additional functionfs mounts. Since these
will never be remounted, we can safely filter these out.

Bug: 153008210
Test: Test device with previously unfiltered entries.
Change-Id: I7f384b8a0ce93dd6701fe3c4d9dd2557370b31e1
2020-04-01 14:29:12 -07:00
Dan Shi
96f29ead9c Remove vts10 tests from vts suite
The tests are only needed in vts10 suite.

Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL removes vts10 tests from vts suite.
It won't change test logic or behavior.

Change-Id: I4d468be075b54213b56c7e1aa94af94f2bdce9ff
2020-03-27 10:07:44 -07:00
Treehugger Robot
3c3f557179 Merge "Add vts10 suite to existing vts tests" am: 2d90168f80 am: c19b5bd800
Change-Id: I9a6cc7717aff65397b47bb9975a1f6866b881d92
2020-03-24 22:22:24 +00:00
Dan Shi
5d8d73c440 Add vts10 suite to existing vts tests
This is to prepare renaming vts to vts10.

Bug: 151896491
Test: local build
Exempt-From-Owner-Approval: This CL adds all tests in vts to a new
suite vts10. vts10 will be the new name of existing vts suite. This CL
won't change test logic or behavior.

Change-Id: I3c7ccef142de30f02a59046cecba121480f6e436
2020-03-24 13:04:53 -07:00
Nikita Ioffe
30b0c01dd8 Move GetMountedEntryForUserdata to fs_mgr.h
Logic of unwinding dm-device stack to figure out what entry was used to
mount userdata turned out to be a little bit more involved, and it
shouldn't be part of libfstab

This CL just moves code around and cleans API a little bit, actual fix
will be in the follow-up CL.

Test: atest CtsFsMgrTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 148612148
Change-Id: If0f8a765dba63adb0e6a711eb81fffdcabea3480
Merged-In: If0f8a765dba63adb0e6a711eb81fffdcabea3480
(cherry picked from commit 8f50cfc28d)
2020-03-06 19:50:10 +00:00
Nikita Ioffe
8f50cfc28d Move GetMountedEntryForUserdata to fs_mgr.h
Logic of unwinding dm-device stack to figure out what entry was used to
mount userdata turned out to be a little bit more involved, and it
shouldn't be part of libfstab

This CL just moves code around and cleans API a little bit, actual fix
will be in the follow-up CL.

Test: atest CtsFsMgrTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 148612148
Change-Id: If0f8a765dba63adb0e6a711eb81fffdcabea3480
2020-03-06 18:31:38 +00:00
Automerger Merge Worker
1cbb9071da Merge "Add wrapped key support for metadata encryption" am: 5ed0698b41 am: ca03b68e12 am: 1427fe5c6f
Change-Id: I162a366af66396f022eb3df2462fd4311b7e9099
2020-02-19 22:19:26 +00:00
Barani Muthukumaran
2ca1d83ddb Add wrapped key support for metadata encryption
Change metadata_cipher fstab option to metadata_encryption
that includes encryption flags in addition to the cipher.
wrappedkey_v0 encryption flag is used to denote that the
inline encryption hardware supports wrapped keys. dm-default-key
device is created and a wrappedkey is provided along with the
optional wrappedkey_v0 argument.

Bug: 147733587

Test: FBE validation with Fscrypt v2 + inline crypt + wrapped
key changes kernel and metadata encryption with wrapped key.

Change-Id: Id1a18db175680dd6b0adb4594d06566eb1285785
2020-02-18 12:44:40 -08:00
Mark Salyzyn
cc7cf4fa5a Merge changes I5b4a87d6,I131315d4 am: 48c0de4907 am: 0bfe8df121 am: cf044e0f1c
Change-Id: Id86b51c063544d6f65eb1c2a88d5646f4f2ab856
2020-02-14 20:12:28 +00:00
Mark Salyzyn
f7aa5403c5 fs_mgr: overlayfs: test: if wait_for_screen times out, skip later
To improve the test period for adb-remount-test.sh, if the device
fails to get to the launcher on the first try when wait_for_screen,
then print a warning to skip all later wait_for_screen conditions.

The wait_for_screen testing is really there to deal with first
confirming that the device is capable of getting to the launcher,
and that later tests that influence corners of adb remount behavior
do not result in a failure to get to the launcher screen.  The
developer should look into ways to fix the failure to get to the
launcher on the first try, but failure to do so should have no
bearing on the remaining tests, so dropping the wait_for_screen
functionality is not an issue.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Bug: 148881519
Change-Id: I5b4a87d6e1f545a304eb74f2114aadd1128f25b3
2020-02-14 11:19:35 -08:00
Automerger Merge Worker
98ac94f8a0 Merge "tests: handle legacy and new bootstat complete" am: 09b9fc56a2 am: 71c9eef34e am: 42d0fdbbe5
Change-Id: I277bec761182cdabb14f92b623d969f6b763f27c
2020-02-04 19:41:33 +00:00
Mark Salyzyn
3576ed043c tests: handle legacy and new bootstat complete
Regression from commit cb1a8e7fdd
("Don't retrigger bootstat during userspace reboot.")

sys.boot_completed and either sys.logbootcomplete (legacy) or
sys.bootstat.first_boot_completed set to determine if the display
has gone active for bootstat.  For adb remount test we have no
desire or need to wait for bootstat complete, reduce script
complexity.

Also solve a possible problem with no content supplied to xargs.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Test: adb-remount-test.sh
Bug: 148804390
Bug: 135984674
Change-Id: Ieefddf583ff7422e8811d2e338a0f16c8943b0d7
2020-02-04 09:01:31 -08:00
Automerger Merge Worker
7a838f636b Merge changes from topics "dm-default-key-v2", "metadata_cipher" am: cb1a8e7fdd am: f6bb9cd7ad am: a83e84d6a2
Change-Id: Ibf4004aab3ab5a046ea7b11e882498fa65f278c2
2020-02-01 16:40:38 +00:00
Paul Crowley
3d8e105510 Set metadata cipher in fstab
Bug: 147814592
Test: Cuttlefish can use adiantum
Change-Id: I9207ffcdb74dcd36c8b2534b51233a3f8e80dc0b
2020-01-31 14:45:00 -08:00
Automerger Merge Worker
d660f3dfc3 Merge "Rename key_dir to metadata_key_dir and refactor" am: 60a55d91dc am: 6e9e22711f am: 47b53f98c1
Change-Id: I466546c2c8490f4e544280ac5130cd83365c8e0d
2020-01-31 22:25:04 +00:00
Paul Crowley
7823e327c1 Rename key_dir to metadata_key_dir and refactor
Bug: 147814592
Test: Crosshatch boots
Change-Id: I18b03486d2e93c6103880d1af68d9f70147fde63
2020-01-30 16:03:45 -08:00
Automerger Merge Worker
8abb726d3f Merge "remount: Use /data for backing scratch storage." am: 21dcbd15bc am: 563e1b6a99 am: 071d977ff8
Change-Id: I3d4eed2059eeb261f9544fa3e1584d7e881671b9
2020-01-30 18:30:17 +00:00
David Anderson
c13586faea remount: Use /data for backing scratch storage.
Currently, this is only enabled for Virtual A/B devices. When /data uses
F2FS, then proper pinning support must be enabled.

Because /data cannot be mounted in recovery, we can't delete the scratch
image backed by /data while in fastbootd. Instead, we mark it as
disabled in /metadata. The remount command now has an init script that
checks for and removes a disabled scratch partition.

Bug: 134949511
Test: adb remount on V A/B device with patched F2FS
Change-Id: Ifc8720378259654472d3822e97059b6c366f601d
2020-01-28 12:04:38 -08:00
Automerger Merge Worker
22e17a2aed Merge "CtsFsMgrTestCases secondary_user" am: fb11bfd77d am: 49cf5de812 am: cbd145506e
Change-Id: I39f79094275ca64129b37251206e607144317b85
2020-01-06 20:52:44 +00:00
Bookatz
685e19dc97 CtsFsMgrTestCases secondary_user
Marks this CTS test module as supporting secondary_user, meaning that
the tests are eligible to be run from a regular Android user other
than the system user (i.e. other than user 0).

Note that 'user' here refers to the concept of users in Android
Multiuser; it is NOT the same as a uid.

Bug: 141773058
Test: module passed with secondary_user params
 (--enable-optional-parameterization --module-parameter secondary_user)

Change-Id: I1829a4297a49cd38b4b8a2558c92941acab8ab9a
2020-01-06 09:49:17 -08:00
Nikita Ioffe
dbbaf15e7a Merge "Fix logic to figure out what /data fstab entry was mounted" am: 23a1dd630b am: 89bc166320
am: 915d38e215

Change-Id: Ie0255ab3641b3076304237638cdece824c940ac6
2019-11-26 04:22:16 -08:00
Nikita Ioffe
5110628a12 Fix logic to figure out what /data fstab entry was mounted
Now the logic is handled by following API:
GetMountedEntryForUserdata(Fstab* fstab).

Behind the scenes it does the following:
1. Reads /proc/mounts and gets block device /data is actually mounted on.
2. In case of it's a dm-device, recursively goes into it's slaves until
finds the underlying block device.
3. Optimistically assumes that corresponding block device is a symlink
and tries to read it.
4. Reads all the entries corresponding to /data from fstab.
5. For each of them, optimistically tries to readlink block_device.
6. If it matches the resolved block devices, we found our fstab entry!

Also added a test to CtsFsMgrTestCases asserting that /data was mounted
from one of entries in default fstab.

Test: on blueline & taimen, with & without checkpointing:
Test: atest CtsFsMgrTestCases
Test: adb reboot userspace

Bug: 135984674
Change-Id: Ic70daeeb18096c7b134004334cc674dacc6e36f3
2019-11-22 13:34:59 +00:00
Nikita Ioffe
4d10d1521e Merge changes I7a3c181a,I72c60ec8 am: 6aa1b01316 am: 03784e1aa5 am: de3e798cc8
am: 4fa5d244f2

Change-Id: Ie10855f857244f65416e860dae05e74500346152
2019-10-29 03:43:03 -07:00
Nikita Ioffe
6aa1b01316 Merge changes I7a3c181a,I72c60ec8
* changes:
  Add a test asserting that default fstab has /data entry
  Add fs_mgr_unit_test to CTS
2019-10-29 09:17:04 +00:00
Minchan Kim
59813afdaf Merge "fs_mgr: remove configurable zram backing file path" 2019-10-29 05:13:50 +00:00
Minchan Kim
12e96152ca fs_mgr: remove configurable zram backing file path
Bug: 142795879
Test: zram_loopback_path never change file location.
Test: Setting zram_backingdev_size on fstab turns on zram writeback.
Change-Id: If244e690405eb925270f767a22e4db95cbd8ba8a
Signed-off-by: Minchan Kim <minchan@google.com>
2019-10-28 19:21:35 -07:00
Paul Crowley
51c41e94d9 Merge "fs_mgr: Don't parse encryption options, just keep string" 2019-10-29 02:00:36 +00:00
Paul Crowley
4fa841350f fs_mgr: Don't parse encryption options, just keep string
We now defer parsing encryption options to the fscrypt library. To avoid
adding a dependency, we simply record the options string in the fstab
and defer parsing until it's needed.

Bug: 143307095
Test: cuttlefish still boots
Change-Id: Ied13ea2f731c63b0524aed11db6983a86dab9fa1
2019-10-28 13:41:00 -07:00
Nikita Ioffe
3f334dcaa4 Add a test asserting that default fstab has /data entry
When aosp/1149619 is merged, userspace reboot will start to depend on
the fact that default fstab has an entry for /data, hence this test
to make sure that this is the case.

Bug: 135984674
Test: atest CtsFsMgrTestCases
Change-Id: I7a3c181a6b27a7b4dfc344ff04be712f3fe3376e
2019-10-28 16:47:47 +00:00
Nikita Ioffe
607cbbf1e8 Add fs_mgr_unit_test to CTS
Test: atest --rebuild-module-info CtsFsMgrTestCases
Bug: 135984674
Change-Id: I72c60ec8acdcb3539da091abb4f84e0bc3c6743b
2019-10-28 16:28:02 +00:00
Nikita Ioffe
e93b12847f Fixed fs_mgr#fs_mgr_read_fstab_file_proc_mounts test
It was failing with:
Expected equality of these values:
mnt_opts
Which is: { "data=ordered", "discard", "noatime", "nodev", "nosuid", "rw", "seclabel", "sync" }
fs_options
Which is: { "data=ordered", "discard", "noatime", "nodev", "nosuid", "rw", "seclabel" }

Test: atest fs_mgr_unit_test
Change-Id: I3bb084d62e81fda8948a100515bdaad62d18bb54
2019-10-28 14:42:01 +00:00
Eric Biggers
736557c510 Merge changes from topic "fscrypt-key-mgmt-improvements"
* changes:
  init/fscrypt_init_extensions: support setting v2 encryption policies
  fs_mgr_fstab: support specifying encryption policy version in fstab
2019-10-07 19:09:43 +00:00
Mark Salyzyn
63f97b6f49 fs_mgr: overlayfs: fsck scratch filesystem
Enable fsck phase for scratch filesystem.  Solved a resulting
problem where the end of the fsck executable would result in a
SIGHUP to the caller.

Add some debugging details from adb-remount-test.sh script

Test: adb-remount-test.sh
Bug: 138577868
Bug: 139283818
Bug: 139226412
Change-Id: I129d86b7cf4e938001ba6db8d03247bc9903988d
2019-10-02 13:30:07 -07:00
Eric Biggers
d964376a92 fs_mgr_fstab: support specifying encryption policy version in fstab
Allow the encryption policy version to be specified as a third field in
the "fileencryption=" fstab option, and expose it through the fstab
record so that vold can use it.

Bug: 140500999
Test: tested as series; see If64028d8580584b2c33c614cabd5d6b93657f608.
      Also updated and ran the fs_mgr unit tests.
Change-Id: If5d56f4c84c4cd51e3f14c0a861c3e3ab6ff903f
2019-09-30 10:27:38 -07:00