qdl: split the flashing front-end from the CLI plumbing - #323
Open
igoropaniuk wants to merge 4 commits into
Open
igoropaniuk wants to merge 4 commits into
igoropaniuk wants to merge 4 commits into
Conversation
igoropaniuk
force-pushed
the
refactor/flash-cli
branch
2 times, most recently
from
September 20, 2026 12:34
d119fce to
f93f3a4
Compare
igoropaniuk
force-pushed
the
refactor/flash-cli
branch
from
September 29, 2026 13:19
f93f3a4 to
268111d
Compare
patch_load_xml() and read_op_load() turn XML into firehose op lists and had no direct coverage. Add a cmocka suite (linking util.c for the real attribute accessors and stubbing the device/ux layers) that checks a valid entry produces the expected op, that an unrecognized child tag is skipped, and - locking in the recently fixed error propagation - that a malformed entry or a missing file makes the loader return an error instead of reporting success. Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
qdl_flash() mixed three concerns in 330 lines: option decoding, the positional-argument walk and the device session. Split them into qdl_parse_args() (filling struct qdl_opts), qdl_build_op_list() and a plain session sequence, so each can be reasoned about - and tested - alone. Options, messages and run order are unchanged; the op-list builder takes the options mutably because the reset verb overrides skip-reset. Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
With qdl_parse_args() self-contained, move it plus print_usage() and the shared long-option ids into cli.c, out of main()'s compilation unit, so unit tests can link the option parser directly. Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
With qdl_parse_args() in cli.c it is now unit testable. Cover the option-to-struct mapping for valid inputs: the defaults, storage and backend selection, --dry-run/--create-digests pinning the SIM backend (and a later --backend being ignored), the skipblock mode, the flag and value options, and that --help/--version report "done" while too-few positional arguments report a usage error. Invalid storage/backend/skipblock values errx() out of the process and so are left to the integration tests. Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
igoropaniuk
force-pushed
the
refactor/flash-cli
branch
from
October 1, 2026 09:32
268111d to
b7fdbae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split the 330-line
qdl_flash()intoqdl_parse_args(),qdl_build_op_list()and a plain session sequence, then move argument parsing intocli.c, out ofmain()'s compilation unit. Unit tests cover the read/patch XML loadersand the new option parser.
No behavior change intended; qdl.c drops from 1109 to 960 lines.