LABGRID-DEVICE-CONFIG(5)

πŸ“¦
version 0.4.1 Β· 2 versions
, in debian bookworm, ubuntu jammy

πŸ’– labgrid-device-config β€” the manual page, but make it a group chat πŸ’–

okay so bestie, this is labgrid-device-config(5) from the embedded testing corner of the world (that's the manual section it lives in, section 5, files and formats, iykyk) πŸ¦‹


✨ NAME ✨

labgrid-device-config β€” labgrid test configuration files πŸ’…


✨ SYNOPSIS ✨

*.yaml

that's it. that's the whole synopsis. she's a yaml file. iconic. πŸŽ€


✨ DESCRIPTION ✨

so to integrate a device into a labgrid test, labgrid literally needs a description of the device and how to access it. no description = no access = no test = we're not doing that. πŸ™ˆ

this manual page is divided into sections, and each one describes exactly one top-level yaml key. one key per section, very demure, very mindful. ✨


✨ TARGETS ✨

the targets: top key configures a target β€” like, its drivers and its resources. that's the whole job.

the top level key is the name of the target, and it needs both a resources subkey and a drivers subkey. both. don't skip one.

🚨 and here's the part people trip on: the order of instantiated resources and drivers is important, because they get parsed as an ordered dictionary and a driver may depend on a previous driver. so the order you write = the order they go. no cap.

for the full list of available resources and drivers, go look at https://labgrid.readthedocs.io/en/latest/configuration.html πŸ‘‘


✨ OPTIONS ✨

the options: top key configures various options, such as the crossbar_url. yes that's literally the example the manpage gives. πŸ’œ

OPTIONS KEYS 🫢

  • crossbar_url β€” takes as parameter the URL of the crossbar (coordinator) to connect to. defaults to 'ws://127.0.0.1:20408'.
  • crossbar_realm β€” takes as parameter the realm of the crossbar (coordinator) to connect to. defaults to 'realm1'.

✨ IMAGES ✨

the images: top key provides paths to access preconfigured images to flash onto the board. πŸ“

and the image paths can be either relative to the YAML file or absolute. your choice, bestie.

IMAGE KEYS πŸŽ€

the subkeys consist of image names as keys and their paths as values. so like, name β†’ path. then the corresponding name can be used with the appropriate tool found under TOOLS. 🌸

IMAGE EXAMPLE 🌈

two configured images, one for the root filesystem, one for the bootloader:

images:
  root: "platform-v7a/images/root.img"
  boot: "platform-v7a/images/barebox.img"

look at her. two images. organized. πŸ’…


✨ TOOLS ✨

the tools: top key provides paths to binaries such as fastboot. πŸ”₯

TOOLS KEYS 🧚

  • fastboot β€” path to the fastboot binary
  • mxs-usb-loader β€” path to the mxs-usb-loader binary
  • imx-usb-loader β€” path to the imx-usb-loader binary

TOOLS EXAMPLE ⭐

configure the tool path for imx-usb-loader:

tools:
  imx-usb-loader: "/opt/labgrid-helper/imx-usb-loader"

✨ IMPORTS ✨

the imports key is a list of files or python modules which are imported by the environment after loading the configuration. πŸ“š

paths relative to the configuration file are also supported, so you don't have to write the whole absolute path if you don't want to. 🫢

this is useful to load drivers and strategy which are contained in your testsuite, since the import is done before instantiating the targets. (order matters again, bestie, it always does 😭)

IMPORTS EXAMPLE πŸ’œ

import a local myfunctions.py file:

imports:
  - myfunctions.py

✨ EXAMPLES ✨

example one 🌸

a sample configuration with one main target, accessible via SerialPort /dev/ttyUSB0, allowing usage of the ShellDriver:

targets:
  main:
    resources:
      RawSerialPort:
        port: "/dev/ttyUSB0"
    drivers:
      SerialDriver: {}
      ShellDriver:
        prompt: 'root@\w+:[^ ]+ '
        login_prompt: ' login: '
        username: 'root'

example two πŸ¦‹

a sample configuration with RemotePlace, using the tools configuration and importing the local mystrategy.py file. The MyStrategy strategy is contained in the loaded local python file:

targets:
  main:
    resources:
      RemotePlace:
        name: test-place
    drivers:
      SerialDriver: {}
      ShellDriver:
        prompt: 'root@\w+:[^ ]+ '
        login_prompt: ' login: '
        username: 'root'
      MyStrategy: {}
      IMXUSBLoader: {}
tools:
  imx-usb-loader: "/opt/lg-tools/imx-usb-loader"
imports:
  - mystrategy.py

she has everything. targets, tools, imports. main character energy fr fr πŸ‘‘


✨ SEE ALSO ✨

go read those too, they're the whole friend group 🫢


✨ AUTHOR ✨

Rouven Czerwinski <r.czerwinski@pengutronix.de>

Organization: Labgrid-Project 🌈


Copyright (C) 2016-2017 Pengutronix. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.


πŸ’– and that's the whole page, bestie! version 0.0.1, dated 2017-04-15, shipped under the LABGRID-DEVICE-CONFIG(5) name β€” go forth and yaml responsibly. slay βœ¨πŸ’…πŸŽ€
πŸ“¦ where this page comes from