[tbot] test/py integration has landed!

Harald Seiler hws at denx.de
Thu Mar 26 18:39:50 CET 2020


Hello!

Integration with U-Boot's test/py has just landed in tbot master!  You can
now run test/py against your configured board using

    tbot @args -vv uboot_testpy

All you need for this to work is a UBootBuilder in your board-config, just
like you need for U-Boot building with `uboot_build`.  Additionally,
you can configure a boardenv in there.  As an example, here is one of my
own configs:

    class DHComUBootBuilder(tbot.tc.uboot.UBootBuilder):
        name = "dhcom-pdk2"
        defconfig = "dh_imx6_defconfig"
        toolchain = "imx6q"

        testpy_boardenv = r"""# Config for dhcom pdk2 board

    # A list of sections of Flash memory to be tested.
    env__sf_configs = (
        {
            # Where in SPI Flash should the test operate.
            'offset': 0x140000,
            # This value is optional.
            #   If present, specifies if the test can write to Flash offset
            #   If missing, defaults to False.
            'writeable': True,
        },
    )
    """


    class DHComUBootFromSPI(board.Connector, board.UBootShell):
        name = "dhcom-uboot (spi)"
        prompt = "=> "

        build = DHComUBootBuilder()

Under the hood, getting this to work was a bit tricky.  test/py is running
on the build-host while the board might be connected somewhere completely
different.  To get the two talking, tbot is playing proxy using named
pipes and lots of parallel channels.  But it works now and I hope it is
useful!

For more info, here is a link to the documentation:

    https://tbot.tools/modules/tc.html#u-boot-test-py

And for the curious, here is the implementation:

    https://github.com/Rahix/tbot/blob/master/tbot/tc/uboot/testpy.py

-- 
Harald



More information about the tbot mailing list