tbot testcases

Harald Seiler hws at denx.de
Tue Jun 16 17:36:39 CEST 2020


Hi Michal,

I've put the list on CC because this might be interesting to others as
well.

On Tue, 2020-06-16 at 16:28 +0200, Michal Simek wrote:
> Hi Harald,
> 
[....]
> 
> I expect you and Heiko and maybe Simon are users who are using it the
> most. It means I expect you also have your private tests what you run.
> Is there any reason not to share them?

I think the biggest reason for me is that I didn't yet take the time to
organize my mess and bring it into a form that can be published.  That's
for the most part because my personal collection of 'testcases' is
actually mostly ops stuff like building, flashing, or running different
software.

Sadly they are also very project specific for the most part so not really
useful for others in that form.  Though, where ever possible I am trying
to extract a generic subset and push that upstream (for example
uboot_testpy [1]).  If the stuff I do have does sound interesting to you,
I can take a look what else I can share.

For actual tests, on my side the situation is a bit sparse right now.
I think Heiko (cc) has more in that regard.  Maybe he's willing to share
some stuff / I think he has published it somewhere already?

> Anyway the setup you have mentioned on tbot repo with tbot host PC, then
> lab host PC connected to board. That's one the most used setup.
> But in tbot case at least that configuration I tried based on manual
> that lab host is the guy who is building images which is problematic in
> my case.
> The reason is simply that lab host PC are arm based boards or pretty
> weak x86 PCs and there is no value to offload this kind of work to them.
> They really just manage connected boards.
> 
> I expect that there should be an option to tell to tbot where images
> should be built.

Yes, having a separate build-host is a common use-case.  That was also
documented at some point but unfortunately it looks like that part got
lost ... I'll have to add that again.

In essence, your lab-config also needs to define a build-host.  This
build-host needs to be reachable from the lab-host and needs to be
a `Builder` [2].  As an example:

    from tbot.machine import linux, connector

    # This is the build-host
    #
    # It needs to define what toolchains are available
    class MyBuildHost(connector.SSHConnector, linux.Bash, linux.Builder):
        hostname = "192.0.2.1"
        username = "build-user"
        # Authentication via private key

        @property
        def toolchains(self):
            return {
                "armv7a": linux.build.DistroToolchain("arm", "arm-linux-gnueabi-"),
                "armv8": linux.build.DistroToolchain("aarch64", "aarch64-linux-gnu-"),
                "mipsel": linux.build.DistroToolchain("mips", "mipsel-linux-gnu-"),
            }

    # This is the lab-host
    #
    # The important part is the build() method which tells tbot which
    # host to use for building.
    class MyLabHost(connector.SubprocessConnector, linux.Bash, linux.Lab):
        def build(self):
            return MyBuildHost(self)

    LAB = MyLabHost

[1]: https://tbot.tools/modules/tc.html#u-boot-test-py
[2]: https://tbot.tools/modules/machine_linux.html#builder
-- 
Harald

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-62  Fax: +49-8142-66989-80   Email: hws at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 850 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/tbot/attachments/20200616/cabf5d15/attachment.sig>


More information about the tbot mailing list