From: Trevor Woerner <twoerner@gmail.com>
To: yocto-patches@lists.yoctoproject.org
Subject: [wic][PATCH 0/2] tests/unit/test_ksparser_parse: parse the .wks file, fix a diskid crash
Date: Fri, 17 Jul 2026 14:35:05 -0400 [thread overview]
Message-ID: <20260717183507.3539287-1-twoerner@gmail.com> (raw)
This continues the standalone unit-test work, moving up from ksparser's
argparse types to the KickStart parser that drives a whole .wks file.
It keeps the shape the suite settled on: the source fix is its own
standalone commit, and the green test module lands last, so the suite
passes at every commit.
The fix: a bootloader line with --ptable msdos and a non-integer
--diskid builds its error message with "... % self.ptable". self is the
KickStart instance, which has no ptable attribute, so the interpolation
raises AttributeError before the intended KickStartError. The user gets
an opaque traceback instead of a described error. Interpolate the
offending value instead (matching the gpt branch just below), and fix
the "--ptbale" typo in the same message.
The test module adds end-to-end coverage for KickStart(): happy-path
part/bootloader lines, degenerate files (empty, comment-only, CRLF,
unknown directive), mutually-exclusive and invalid option combinations,
multiple-bootloader rejection, diskid parsing for both ptables, and
include handling. get_bitbake_var() is neutralised so the parser runs
with no BitBake and no host tools. Backing the fix out turns the two
msdos --diskid cases red.
Trevor Woerner (2):
ksparser: fix crash on an invalid msdos --diskid
tests/unit/test_ksparser_parse: cover the .wks KickStart parser
src/wic/ksparser.py | 4 +-
tests/unit/test_ksparser_parse.py | 217 ++++++++++++++++++++++++++++++
2 files changed, 219 insertions(+), 2 deletions(-)
create mode 100644 tests/unit/test_ksparser_parse.py
--
2.50.0.173.g8b6f19ccfc3a
next reply other threads:[~2026-07-17 18:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 18:35 Trevor Woerner [this message]
2026-07-17 18:35 ` [wic][PATCH 1/2] ksparser: fix crash on an invalid msdos --diskid Trevor Woerner
2026-07-17 18:35 ` [wic][PATCH 2/2] tests/unit/test_ksparser_parse: cover the .wks KickStart parser Trevor Woerner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260717183507.3539287-1-twoerner@gmail.com \
--to=twoerner@gmail.com \
--cc=yocto-patches@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.