Re: [yocto-patches] [wic][PATCH 0/2] tests/unit/test_ksparser_parse: parse the .wks file, fix a diskid crash

Paul Barker <[email protected]> Mon, 20 Jul 2026 09:27:22 +0100
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <[email protected]>
On Fri, 2026-07-17 at 14:35 -0400, Trevor Woerner via
lists.yoctoproject.org wrote:
> 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.

Both patches LGTM.

Reviewed-by: Paul Barker <[email protected]>

Best regards,

-- 
Paul Barker
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----

iIcEABYKAC8WIQSzjPXf5Y1BDWhU2iCrY1Tsnbr0bgUCal3b6hEccGF1bEBwYmFy
a2VyLmRldgAKCRCrY1Tsnbr0bkVkAQDk2oRNqinstSvrc3ioAVx9eGx+Bf1hjdZR
XDUe9QIxtQD9Fn9aQSHeCEyBYgw/t1OfGAQV5nVE95D1nTkyzh4kYQI=
=GtUS
-----END PGP SIGNATURE-----