fs_mgr: overlayfs: test: check for existence of userspace fastboot
If there is no userspace fastboot, then overlayfs has a corner case
bug where overlay content is not wiped when the partition is flashed.
We will report a warning instead.
This is done to reduce the flakiness of the test results as we do not
intend to fix this specific corner case in the short term. We would
require to record a sha representing the flash image, and the risks
were evaluated as too high of an impact on libavb to add interfaces
to expose the signatures, especially at first stage mount time. All
new devices must support Dynamic Android Partitions (DAP), which
means they all have support for userspace fastboot, it will be
considered a misconfiguration and thus the position is we will not
fix this issue and only use this test adjustment to deal with legacy
products. If a legacy non-DAP product wishes to close the issue
today, they must supply a user space fastboot.
Test: adb-remount-test.sh
Bug: 109821005
Bug: 123079041
Change-Id: I420cb87c19e3e184a974dfc373fb17c097d4858f
diff --git a/fs_mgr/tests/adb-remount-test.sh b/fs_mgr/tests/adb-remount-test.sh
index 98e4e29..42f3f29 100755
--- a/fs_mgr/tests/adb-remount-test.sh
+++ b/fs_mgr/tests/adb-remount-test.sh
@@ -603,6 +603,7 @@
echo "${GREEN}[ RUN ]${NORMAL} flash vendor, confirm its content disappears" >&2
H=`adb_sh echo '${HOSTNAME}' </dev/null 2>/dev/null`
+is_userspace_fastboot=false
if [ -z "${ANDROID_PRODUCT_OUT}" ]; then
echo "${ORANGE}[ WARNING ]${NORMAL} build tree not setup, skipping"
elif [ ! -s "${ANDROID_PRODUCT_OUT}/vendor.img" ]; then
@@ -615,6 +616,8 @@
fastboot flash vendor ||
( fastboot reboot && false) ||
die "fastboot flash vendor"
+ fastboot_getvar is-userspace yes &&
+ is_userspace_fastboot=true
if [ -n "${scratch_paritition}" ]; then
fastboot_getvar partition-type:${scratch_partition} raw ||
( fastboot reboot && false) ||
@@ -660,7 +663,12 @@
echo "${D}" | grep "^overlay .* /system\$" >/dev/null ||
die "overlay /system takeover after flash vendor"
echo "${D}" | grep "^overlay .* /vendor\$" >/dev/null &&
- die "overlay supposed to be minus /vendor takeover after flash vendor"
+ if ${is_userspace_fastboot}; then
+ die "overlay supposed to be minus /vendor takeover after flash vendor"
+ else
+ echo "${ORANGE}[ WARNING ]${NORMAL} user fastboot missing, ignoring a failure"
+ ( die "overlay supposed to be minus /vendor takeover after flash vendor" )
+ fi
fi
B="`adb_cat /system/hello`" ||
die "re-read /system/hello after flash vendor"
@@ -668,8 +676,17 @@
adb_root ||
die "adb root"
B="`adb_cat /vendor/hello`" &&
- die "re-read /vendor/hello after flash vendor"
- check_eq "cat: /vendor/hello: No such file or directory" "${B}" vendor after flash vendor
+ if ${is_userspace_fastboot} || ! ${overlayfs_needed}; then
+ die "re-read /vendor/hello after flash vendor"
+ else
+ echo "${ORANGE}[ WARNING ]${NORMAL} user fastboot missing, ignoring a failure"
+ ( die "re-read /vendor/hello after flash vendor" )
+ fi
+ if ${is_userspace_fastboot} || ! ${overlayfs_needed}; then
+ check_eq "cat: /vendor/hello: No such file or directory" "${B}" vendor after flash vendor
+ else
+ ( check_eq "cat: /vendor/hello: No such file or directory" "${B}" vendor after flash vendor )
+ fi
fi
echo "${GREEN}[ RUN ]${NORMAL} remove test content (cleanup)" >&2