summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-08-31 18:56:19 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-10 01:13:21 -0700
commitfe6d3ddf1aed16d0708f9f4d2e0aecf8eac05994 (patch)
tree93b85e14bd8f6c8e92fee380973756fd03dd3032 /tests
parentf5223d920707f24724390019c14c2f759d51f71a (diff)
downloadvboot-fe6d3ddf1aed16d0708f9f4d2e0aecf8eac05994.tar.gz
futility: cmd_update: Add quirk 'min_platform_version'
Many device may have some minor difference in early builds, for example (board id) rev 0 and rev 1 may have GPIO pins connected to different components. Usually the firmware should read board identifier and do the right mapping, but sometimes the firmware may be totally incompatible and no way to workaround (for example even the CPU may be different). The min_platform_version is introduced so we can prevent updating to incompatible systems, by reading $(mosys platform version). BUG=chromium:875551 TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility BRANCH=None Change-Id: I418fee1aad884551b38ac25c340b2797b8503596 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1198815 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/futility/test_update.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/futility/test_update.sh b/tests/futility/test_update.sh
index 6902a0cf..44530abb 100755
--- a/tests/futility/test_update.sh
+++ b/tests/futility/test_update.sh
@@ -137,7 +137,7 @@ test_update() {
fi
}
-# --sys_props: mainfw_act, tpm_fwver, is_vboot2, [wp_hw, wp_sw]
+# --sys_props: mainfw_act, tpm_fwver, is_vboot2, platform_ver, [wp_hw, wp_sw]
# tpm_fwver = <data key version:16><firmware version:16>.
# TO_IMAGE is signed with data key version = 1, firmware version = 4 => 0x10004.
@@ -238,3 +238,13 @@ test_update "Full update (--quirks unlock_me_for_update)" \
"${FROM_IMAGE}" "${TMP}.expected.me_unlocked" \
--quirks unlock_me_for_update \
-i "${TO_IMAGE}" --wp=0 --sys_props 0,0x10001,1
+
+test_update "Full update (failure by --quirks min_platform_version)" \
+ "${FROM_IMAGE}" "!Need platform version >= 3 (current is 2)" \
+ --quirks min_platform_version=3 \
+ -i "${TO_IMAGE}" --wp=0 --sys_props 0,0x10001,1,2
+
+test_update "Full update (--quirks min_platform_version)" \
+ "${FROM_IMAGE}" "${TMP}.expected.full" \
+ --quirks min_platform_version=3 \
+ -i "${TO_IMAGE}" --wp=0 --sys_props 0,0x10001,1,3