Commit graph

154 commits

Author SHA1 Message Date
Eric Biggers
c953d6eb5f fs_mgr: remove FDE fields from FstabEntry
Remove the now-unused FDE fields from struct FstabEntry.

Bug: 191796797
Change-Id: Iab11a1fe86ac9d06beef68dc7e3c543f48ce0ac6
2021-11-09 22:44:50 -08:00
Eric Biggers
b662530677 fs_mgr: stop allowing the FDE fstab options
Since Android 10, new devices have been required to use FBE instead of
FDE.  Therefore, the FDE code is no longer needed.

Make fs_mgr reject fstabs where FDE is enabled.

Unfortunately, there is a quirk where the "encryptable" flag (which was
originally meant just for FDE) was overloaded to identify adoptable
storage volumes.  It appears that we have to keep supporting this use
case.  Therefore, don't reject the "encryptable" flag completely.
Instead, just reject "encryptable" when it appears without
"voldmanaged", or without "userdata" as its argument.

Here are some references for how "encryptable=userdata" is being used to
identify adoptable storage volumes:

  * https://source.android.com/devices/storage/config#adoptable_storage
  * f26c7e9b12:system/vold/main.cpp;l=269
  * f26c7e9b12:device/google/cuttlefish/shared/config/fstab.f2fs;l=17
  * f26c7e9b12:device/generic/goldfish/fstab.ranchu;l=7

[ebiggers@: modified from a WIP CL by paulcrowley@]

Bug: 191796797
Change-Id: I3c4bbbe549cc6e24607f230fad27ea0d4d35ce09
2021-11-09 22:44:50 -08:00
Devin Moore
86ec18bca5 Revert "Handle "hardware" bootconfig parameter as "androidboot.hardware""
This reverts commit 0a799bdfd6.
Now that the kernel bootconfig feature has been to updated to handle
mixed subkeys and values, androidboot.hardware parameter is supported.

Test: build and boot Cuttlefish with "androidboot.hardware=cutf_vm"
Bug: 191502832
Change-Id: I0e436a27730d20689bc6974562c3e88d744385db
2021-06-22 09:54:57 -07:00
Devin Moore
34cf9834e4 Merge "Fix androidboot.bootdevice test case for bootconfig" 2021-06-02 15:37:11 +00:00
Yi-Yo Chiang
ad3a57bdba adb-remount-test: Make awk scripts mawk-v1.3.3-compatible
Our CI is failing because the host machine is using mawk instead of gawk.
mawk v1.3.3 cannot parse regex such as '/[/]/', while mawk v1.3.4 and
gawk can.
Change regex of '[/]' to '\/' so that our test script is as backward
compatible as possible.

Bug: 188862155
Test: Run adb-remount-test.sh on CI
Change-Id: Ia4fbce58a61325a5e5280ede0d5b7760832d8ec1
2021-05-31 17:52:07 +08:00
Wang Han
fe5b9cfec0 Fix androidboot.bootdevice test case for bootconfig
* This seems to be a typo.

Change-Id: Ibf1317e35090f4fcacf53dc311124d456384fa27
2021-05-31 09:40:30 +00:00
Yi-Yo Chiang
f931ad9446 adb-remount-test: Strengthen skip_administrative_mounts
Refactor skip_administrative_mounts so that it filters by device name,
mount point and filesystem type. (Was filtering by device name and mount
point.)

We need this because pseudo filesystems such as tmpfs and overlayfs can
have free-formed device name:

  blah /mnt/mnt_point overlay ro,lowerdir=...

However the filesystem type (third field of /proc/mounts) must be
reflecting the actual filesystem, so to robustly filter out
administrative filesystems, we have to check the filesystem type field.

Bug: 188862155
Test: adb-remount-test.sh
Change-Id: I5058cbe8a36920f25b73a5d5833e9fc5a096e90f
2021-05-23 16:42:11 +08:00
Yi-Yo Chiang
e3cbb0a9eb Fix CtsFsMgrTestCases failures
fs_mgr flags "slotselect" and "slotselect_other" are specific to A/B
devices, so remove these options from testcases because
CtsFsMgrTestCases could be ran on a non-A/B device.

Fixes: 187759127
Fixes: 187427233
Test: atest CtsFsMgrTestCases on sdk_phone64_x86_64-userdebug
Change-Id: I31c1429652629bb68e0ca504295c959ac7e013e2
2021-05-11 07:12:22 +00:00
Yi-Yo Chiang
7e122fedd5 Enable disabled CtsFsMgrTestCases test cases
And use the new fs_mgr C++ API.

Bug: 186504948
Test: atest CtsFsMgrTestCases
Test: atest CtsFsMgrTestCases in DSU
Change-Id: I80d68d72fb3aa9f5a0dc7d9400b4d0f80cc7deb3
2021-04-27 18:46:30 +08:00
Yi-Yo Chiang
f61cb30c27 Fix CtsFsMgrTestCases
As ReadFstabFromFile() may append / remove / modify the fstab read from
the file, we cannot make assumptions about the number of fstab entries.
We can however test that the returned fstab contains at least the
entries we expect.

Fixes: 185826755
Test: atest CtsFsMgrTestCases on GSI & DSU
Change-Id: I539e7eed3f7ae14db7e9983bed7f68754c9fff39
2021-04-20 14:56:41 +08:00
Jaegeuk Kim
05ca915431 fs_mgr: add readahead_size_kb in fstab
This patch adds an option, readahead_size_kb in fstab entry option. It supports
to set a proper readahead_size per block/dm devices before using them by mount,
which is useful for low/high-end devices when addressing memory pressure issue.

Bug: 181567573
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I549962e68f8488417d76bcfb283958bc33fd5d7a
2021-04-09 04:54:11 +00:00
Devin Moore
0a799bdfd6 Handle "hardware" bootconfig parameter as "androidboot.hardware"
The parameter "androidboot.hardware" has been removed from bootconfig
and replaced by "hardware" parameter.

Test: launch_cvd with 4.19 and 5.10 kernels
Test: atest CtsFsMgrTestCases
Bug: 173815685
Change-Id: I627426ae1bd0a165b70b8f2584ec184abfb4236f
2021-03-09 14:10:48 -08:00
Devin Moore
20b74257a6 fs_mgr: handle more bootconfig parameters
As parameters are moved from kernel cmdline to bootconfig,
fs_mgr needs to be updated to handle the new location.
/proc/bootconfig should be checked first, if not present, then check
/proc/cmdline.

Test: atest CtsFsMgrTestCases
Test: launch_cvd
Test: launch_cvd with 4.19 kernel artifacts that do not support
bootconfig
Test: Both of the above configurations with --num_instances 0 or 4
Test: Both configurations with androidboot.boot_devices or
androidboot.boot_device set
Bug: 173815685

Change-Id: I23fb07a17c25c9459833cb931ced79d5ccc3e42a
2021-03-05 09:21:19 -08:00
Devin Moore
a4ef15bebb Support bootconfig in first stage init and fs_mgr
Androidboot parameters are being moved from the kernel commandline to
bootconfig.
fs_mgr looks for these parameters in properties and falls back to
reading directly from /proc/cmdline. So both of these sources are
updated for bootconfig.
The androidboot parameters from /proc/bootconfig
are added as ro.boot properties, and fs_mgr will fall back to searching
/proc/bootconfig if it is too early.

Test: boot cuttlefish with androidboot.fstab_suffix and
androidboot.hardware in bootconfig and not in cmdline.
Test: atest CtsFsMgrTestCases
Bug: 173815685

Change-Id: Iea36a0da94c26e1aa37d97c576725e0ad77cd3ad
2021-02-23 07:42:06 -08:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Yi-Yo Chiang
fa405414d7 adb-remount-test.sh: Fix failure due to missing host tool hexdump
As we are just using it to generate gibberish, we might as well just
hardcode the gibberish in the script.

Also fix unhandled `grep` failure.

Bug: 179752308
Test: Forrest
Change-Id: I534c7cacdb12a104f26d380fe3a571332091490e
2021-02-09 16:11:23 +08:00
Yo Chiang
df33cb98ef Merge "fs_mgr: Harden adb-remount-test.sh by ERR trap handler" 2021-02-05 03:41:32 +00:00
Yo Chiang
f0b8ebc9e9 fs_mgr: Harden adb-remount-test.sh by ERR trap handler
Exit immediately if any unexpected error.

Bug: 165925766
Test: adb-remount-test.sh
Change-Id: I5e9e796f61be21d4b130640949432c1f531de5a4
2021-01-30 00:03:03 +08:00
Yo Chiang
41b6171741 fs_mgr: Harden adb-remount-test.sh on read-only filesystem
I'm getting this error:

  [  FAILED  ] /cache/overlay wipe

If /cache is not mounted, in which case it would be RO and empty, then
don't try to do `rm -rf /cache/overlay` as it would fail.
If /cache is RO and /cache/overlay doesn't exist, then `rm -f` would
fail, albeit the "-f" flag, this is a toybox bug.
Check file path existence before `rm`-ing so we don't trigger this error.

Change `ls <type> <path>` to `test <type> <path>` for robust checking.

Bug: 178683776
Bug: 165925766
Bug: 178771232
Test: adb-remount-test.sh on GSI + Pixel
Change-Id: Ie95de690d96146892127ab11a461d80cb6cb56fa
2021-01-29 14:12:43 +00:00
Yo Chiang
ec8f9dd1f1 adb-remount-test.sh: Filter out administrative mount: securityfs
securityfs /sys/kernel/security securityfs rw,relatime 0 0

is causing the noatime check in adb-remount-test.sh to fail.

Bug: 165925766
Test: Create an aosp_cf_x86_phone-userdebug AVD && adb-remount-test.sh
Test: Use DSU to install GSI on the AVD && adb-remount-test.sh
Change-Id: Ibae0d4bbbbc78fb74f4ad82f2313251598c77f72
2021-01-22 03:15:10 +00:00
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