7.8 KiB
Error paths
Possible error paths in DTS and how to trigger them
UI/User Experience
-
UI refresh loop
- press Enter multiple times (or keep it pressed) in main UI
- relevant code: dts.sh#L44
-
multiple UI refreshes per one key
- press arrow key in main UI
- relevant code: dts.sh#L44
-
strings don't fit in UI border
-
check on platform/firmware with very long
dmidecodestrings -
or enter DTS shell and use these commands:
export DTS_TESTING=true export TEST_SYSTEM_VENDOR="very long system vendor string that won't fit" dts-boot -
relevant code: show_hardsoft_inf
-
-
RAMhardware information has different indentation- start DTS and compare
HARDWARE INFORMATIONentries - relevant code: show_ram_inf
- start DTS and compare
-
wrong answer for user choice
- enter value outside of allowed ones
- enter value with spaces and other special characters
- enter non-numeric value if choice expects number
- press enter without writing anything (if there's no default value used)
- relevant code: Check all
readcommand usages
-
stop workflow
- Answer negatively when asked if everything is ok/you want to continue
- relevant code:
-
CTRL+C- press
CTRL+C. Shouldn't break anything no matter when it's used. - If it's used during workflow then user should see relevant information that workflow was stopped.
- If
CTRL+Cis used during flashing user should be informed that their platform is in unknown state, and they shouldn't reboot. - alternatively -
CTRL+Cshould be trapped and do nothing (at least when flashing to not brick user platform)
- press
Credentials
- empty e-mail
- press Enter without writing anything when prompted for e-mail
- relevant code: get_dpp_creds e-mail
- empty password
- press Enter without writing anything when prompted for password
- relevant code: get_dpp_creds password
- non-existent credentials
- enter random, non-existent e-mail and password when prompted
- no internet access
- disconnect Ethernet cable or set network interface down before trying to load credentials
- no access to MinIO server - e.g. server is down
- modify
DPP_SERVER_ADDRESS - relevant code: dts-environment.sh
- modify
- e-mail or password with space
- use space in e-mail or password
Generic workflow (update, deployment, transition)
- missing remote files - any combination of missing files downloaded by DTS so
firmware binaries, hashes, signatures, additional binaries used by some
platforms
- remove files on remote server
- change path to file to point to non-existent file (in
dts-configsor by modifying scripts)
- no access to remote server
- FTP/minio/GitHub is down or blocked
- modify address of remote server to some non-existent one
- block server/IP via e.g. firewall
- no internet access
- disconnect Ethernet cable or disable network interface before starting workflow
- disable network before starting workflow and during
- all places where we connect to the remote should be tested (all usages of
curl,wget,mc, e.t.c.). All file downloads should possibly be merged into one function to simplify testing
- BIOS region in flash is write-protected
- enable
BIOS boot medium lockorEnable SMM BIOS write protectionin BIOS on Dasharo UEFI firmware - mock on non-Dasharo firmware
- test all workflows that use flashrom to write to flash
- enable
- no firmware available
- try to run workflow on unsupported platform or platform by emulating
unsupported platform (
TEST_SYSTEM_*andTEST_BOARD_MODELvariables). - modify
DTS_CONFIG_REFto usedts-configsbranch with removed support for your platform
- try to run workflow on unsupported platform or platform by emulating
unsupported platform (
- firmware to be deployed doesn't support platform hardware e.g.
- wrong hash
- modify
.sha256file used during workflow - use custom file server with wrong hash files
- modify
- wrong signature
- serve malformed
.sigfile - serve
.sigfile signed with different, untrusted, key
- serve malformed
- flashing fails
- mock flashing failure
- There are multiple possible failure points in
deploy_firmwarefunction, all need to be tested. - inform user what to do in this case (especially if it was partially flashed).
- flashrom (internal) failures
- multiple failure points
- to test: mock
- complete flashrom failure (can't access flash at all)
- flash region read failures
- flashrom (ec) failures
- to test: mock
- complete flashrom failure (can't access flash at all)
- flash region read failures
- flash write failure (initial deployment)
- capsule workflow with Intel ME enabled
- run capsule workflow (e.g. update/fuse) with Intel ME enabled or Soft disabled
- failed capsule loading
- run capsule update on firmware that doesn't support capsule updates
- run capsule update with enabled ME
Variables
Wrong values in DTS variables in dts-scripts or dts-configs
-
Variables related to paths e.g.:
bios_path_commheads_link_dpp- and others. Same results as in
Missing remote filespoint.
-
Unsupported version format in
dasharo_rel_ver*- set version in format unsupported by
compare_version
- set version in format unsupported by
-
Variables related to binary preparation i.e.
*_MIGRATION. Those variables decide whether we need to run workflow related to this migration. If they have wrong value then final workflow result might be different from expected e.g. in case ofNEED_SMMSTORE_MIGRATIONwe might end up without migrated config (so we lose all BIOS configuration after update) -
Variables related to flashing firmware e.g.
HAVE_EC,FLASHROM_ADD_OPT_UPDATE_OVERRIDE,PROGRAMMER_BIOS,PROGRAMMER_EC. Mistakes here might result in:- flashrom command failing
- flashrom flashing wrong/unexpected regions
- EC not being flashed (if platform has EC) or error when trying to flash non-existent EC