Re: [PATCH v2 07/10] binman: tests: Add test coverage for a FIT with embedded Linux+initrd and /chosen

Alexey Charkov <[email protected]> Tue, 4 Aug 2026 18:16:35 +0400
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <CAKTNdwF6aHTbsi6WQdHajpKYEn5cznOWHCDrGmyW78gtAYNBcQ@mail.gmail.com>
Hi Simon,

On Tue, Aug 4, 2026 at 5:03=E2=80=AFPM Simon Glass <[email protected]> wrote=
:
>
> Hi Alexey,
>
> On 2026-07-31T17:10:44, Alexey Charkov <[email protected]> wrote:
> > binman: tests: Add test coverage for a FIT with embedded Linux+initrd a=
nd /chosen
> >
> > Add a test for a FIT image with a fake Linux kernel and initrd, and a
> > valid device tree into which a /chosen node is added (containing a
> > bootargs property, as is relevant for Falcon mode boot).
> >
> > Signed-off-by: Alexey Charkov <[email protected]>
> >
> > tools/binman/ftest.py                          | 107 ++++++++++++++++++=
+++++++
> >  tools/binman/test/fit/fit_chosen.dts           |  62 ++++++++++++++
> >  tools/binman/test/fit/fit_chosen_no_initrd.dts |  60 ++++++++++++++
> >  tools/binman/test/fit/fit_chosen_no_load.dts   |  57 +++++++++++++
> >  4 files changed, 286 insertions(+)
>
> > +    def testFitChosen(self):
> > +        """Test patching /chosen (bootargs + initrd) into generated FI=
T FDTs"""
>
> The alternate-DTs (model1/model2) have no /chosen node, so all three
> tests only exercise the add_subnode() branch in _patch_fdt_chosen().
> Please add a case where the input FDT already carries a /chosen (with
> e.g. a pre-existing bootargs) to cover the path_offset() branch and
> confirm the overwrite behaviour that the docs promise.

Indeed, that would be a good addition, thanks!

> > +    def testFitChosenNoInitrd(self):
> > +        """Test a Falcon-mode FIT where the optional initramfs is not =
supplied"""
>
> There is no coverage for a config that sets only fit,bootargs or only
> fit,initrd (both DTS files set both). Since _patch_fdt_chosen() has
> independent None-branches for each, a small case exercising each on
> its own would be worth adding.

Let me turn it into a full matrix - it can't hurt. Thanks for the suggestio=
n!

Best regards,
Alexey