Commit Graph

276 Commits

Author SHA1 Message Date
Danil Klimuk 6dd5a1c94c include: hal: common-mock-func: cbmem_check_hfsts1_mock must return 1 if
the platform do not have coreboot

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
2026-03-27 13:38:05 +01:00
Danil Klimuk 47bb77e6ae include: dts-functions: add print for when ME is enabled
Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
2026-03-26 14:23:08 +01:00
Danil Klimuk bff61814c9 include: dts-functions: extend ME operation mode detection
Add parsing HFSTS1 bits 19:16 via coreboot logs. Add checking coreboot
logs for CSE operating mode.

Signed-off-by: Danil Klimuk <daniil.klimuk@3mdeb.com>
2026-03-26 14:23:06 +01:00
WuXie 9335697ef0 fix(network): correct established message grammar 2026-03-24 00:59:57 +08:00
WuXie f8affa3951 fix(network): cache successful checks in wait_for_network_connection 2026-03-13 19:56:27 +08:00
Michał Iwanicki 4b0cc017ef include: Add check for FirmwareUpdateModeRT
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-02-11 17:50:50 +01:00
Michał Iwanicki ef6ba4ccfa dasharo-deploy: add capsule & fum checks
Workaround for https://github.com/Dasharo/dasharo-issues/issues/1759

Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-02-09 14:43:10 +01:00
Mateusz Kusiak 7c7884437b login_to_dpp_server: Add password check
Add a check in login_to_dpp_server() to catch corner case scenarios when
password changes.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 10:18:40 +01:00
Mateusz Kusiak 3779240997 Credentials: Create a backup file
The issue is, when the user wants to change credentials, and the
credentials they use are not valid, the credentials will reset.
Keep a backup of credentials file so it can be restored if new
credentials are invalid.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 10:08:01 +01:00
Mateusz Kusiak b643f402e7 get_dpp_creds: remove empty lines for creds
Credentials are wrapped in empty lines top and bottom. Remove them.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 10:08:01 +01:00
Mateusz Kusiak 1d5d6d174c login_to_dpp_server: fix check if logged in
Check for validating if user email is set for alias was overly
optimistic. Short logins like "a" would false-positively trigger `grep`.
Fix the if statement to instead check if alias exists at all.
Fixes: https://github.com/Dasharo/dasharo-issues/issues/1578

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 10:07:57 +01:00
Mateusz Kusiak 9187e47a7f get_dpp_creds: clean creds file on new creds
If new credentials were specified, and they're not empty, overwrite the
last credentials file.
Fixes: https://github.com/Dasharo/dasharo-issues/issues/1463

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 09:57:27 +01:00
Mateusz Kusiak 075743e3a3 get_dpp_creds: Do not allow empty creds
Do not allow empty credentials nor spaces in the middle.
Fixes:
* https://github.com/Dasharo/dasharo-issues/issues/1326
* https://github.com/Dasharo/dasharo-issues/issues/1589

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-09 09:57:13 +01:00
Mateusz Kusiak b952a103d2 verify_artifacts: drop sig_result
The wrapper for catching sig_result simply does not work. It captures
nothing and just prints redundant empty line. Drop catching this at it
is not used at all.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-02-05 11:10:02 +01:00
Michał Iwanicki 5117404a1d dasharo-deploy & mock: check return value of cap_upd_tool & add mock
Print error and exit if queueing capsule update fails. Mention that most
common case is enabled ME and print link to known issues describing it
in more details along with solution.
Modify cap_upd_tool mocking so we can test failures.

Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-01-29 11:44:57 +01:00
Daniil Klimuk fd25c91d18 include: hal: common-mock-func: add TEST_READ_ROMHOLE_FAIL
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2026-01-21 14:33:40 +01:00
Daniil Klimuk 55600508f0 include: hal: common-mock-func: enable controlling of ROMHOLE migration
source and destination

will be usefull for unit testing of some conditions in romhole_migration
func.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2026-01-21 13:57:40 +01:00
Daniil Klimuk f4cdb258ad add TEST_ROMHOLE_CBFS_MIGRATION
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
2026-01-20 19:45:49 +01:00
Mateusz Kusiak 3b88b776b9 Merge pull request #139 from Dasharo/heads_trans
Add a last resort check for validating flashrom jobs. For regular updates, check if the regions to update are not locked. For heads update, always check if FD, ME, and BIOS regions are flashed and if FE and ME are unlocked.

Fixes: https://github.com/Dasharo/dasharo-issues/issues/1536
2026-01-16 14:20:04 +01:00
Mateusz Kusiak 44bcb2c834 Menu: disable HCL FW restore
Disable the option to restore FW from HCL report as it is currently not
tested and has potential to brick devices.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-01-15 17:01:39 +01:00
Mateusz Kusiak d1e640f610 Dasharo-deploy: add missing commas
Ensure the commas are printed in the error message that prints locked
regions in flashrom_region_check().

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-01-15 16:37:44 +01:00
Mateusz Kusiak 17c368ac11 Dasharo-deploy: refine flashrom_check_for_region
Refine and simplify flashrom_check_for_region() function.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-01-15 16:25:06 +01:00
Mateusz Kusiak 7a5842b544 Dasharo-deploy: rework flashrom_region_check()
Rework and refine flashrom_region_check() function. Split logic into
three blocks: gather info, generic update, heads update. The major
functional change is generic update is no longer possible if region is
specified but locked.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-01-15 12:09:54 +01:00
Mateusz Kusiak b1f4be7879 Dasharo-deploy: heads: force fd, me and bios
This commit adds a check that enforces flashing FD, ME and BIOS regions
for heads update. The reason has been added inline with the changes.

This commit will break compatibility with some existing platforms and
that is intended.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@3mdeb.com>
2026-01-15 10:29:58 +01:00
Michał Iwanicki 26828e4183 common-mock: mock btg_key_validator so we can test failure states
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
2026-01-14 12:23:08 +01:00