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

Trevor Woerner <[email protected]> Mon, 20 Jul 2026 12:33:01 -0400
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <[email protected]>
On Mon 2026-07-20 @ 09:27:22 AM, Paul Barker via lists.yoctoproject.org wrote:
> 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]>

Thanks Paul!
Applied to wic, master branch.

> Best regards,
> 
> -- 
> Paul Barker
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#4515): https://lists.yoctoproject.org/g/yocto-patches/message/4515
> Mute This Topic: https://lists.yoctoproject.org/mt/120320310/900817
> Group Owner: [email protected]
> Unsubscribe: https://lists.yoctoproject.org/g/yocto-patches/leave/13168745/900817/63955952/xyzzy [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-
> 
>