Target#

Introduction#

Our Target is a wrapper around devlib.target.Target. In short, it’s a device communication abstraction library that gives us a simple Python interface for playing around with a device (shell, file transfer…).

If you want to execute some command on a target, it’s as simple as this:

out = target.execute("ls -al .")

Have a look at the devlib documentation for more details. Our wrapper brings additionnal features which are documented below.

As a rule of thumb, if you want to add a feature to Target, chances are this should be contributed to devlib instead.

Connecting to a target#

Connecting to a target means creating a Target instance. This can be as a simple as this:

target = Target(kind="linux", host="192.168.0.1", username="root", password="root")

For more convenience, you can also save the relevant connection information for a given target in a configuration file, which would let you create a Target like so:

target = Target.from_one_conf("path/to/my/conf.yml")

See also

See the documentation of Target and TargetConf more details.

Platform data#

The main source of information for tests come from Trace and PlatformInfo. The latter gives access to information autodetected from the devlib.target.Target or filled in by the user.

This information ranges from the current kernel version to the available platform frequencies.

See also

See the documentation of PlatformInfo for more details.

API#