Each device type in LAVA defines a template to describe the features of that device type, and how LAVA can use it. A device dictionary customizes that template to include the data for one specific instance of that device. This includes details like the commands to connect specific serial ports for this device, commands to operate remote power control, device serial numbers and elements of the network topology for VLANd support.
Other fields can also be used in the templates. The only field which is compulsory is extends which links this device dictionary to a specific device type template.
sleep
.udev
rule.fastboot
to connect to this
device.fastboot
command.connection_list - the list of hardware ports which are configured for serial connections to the device.
connection_commands - a dictionary of the commands to start each connection.
connection_tags - Each connection can include tags
- extra pieces of
metadata to describe the connection.
There must always be one (and only one) connection with the primary
tag,
denoting the connection that will be used for firmware, bootloader and kernel
interaction.
Other tags may describe the type of connection, as extra information that
LAVA can use to determine how to close the connection cleanly when a job
finishes (e.g telnet
and ssh
).
See also
sysfs
path of
the interface associated with the interface label on that device.The “download” button present in the device dictionary page is used to download a YAML file of the device dictionary, which is the equivalent of contents returned by lavacli devices dict get. This file is not intended for admin support and cannot be used to modify the device dictionary itself.
Some elements of the device configuration can be exposed to the test shell, where it is safe to do so. Each parameter must be explicitly set in each device dictionary. The information will then be populated into the LAVA Test Helpers.
device_ip - A single fixed IPv4 address of this device. The value will be
exported into the test shell using lava-target-ip
.
{% set device_ip = "10.66.16.24" %}
device_mac - similar to device_ip
but for a single MAC address.
{% set device_mac = '00:02:F7:00:58:53' %}
storage_info - a list of dictionaries, where each dictionary value can contain keys describing the storage method (e.g. USB or SATA) and a value stating the device node of the top level block device which is available to the test writer.
{% set storage_info = [{'SATA': '/dev/disk/by-id/ata-ST500DM002-1BD142_W3T79GCW'}] %}
environment - a dictionary containing device-specific shell variables, which will be available in the LAVA test shell. These can be used, for example, to describe physical hardware connections between the DUT and interfaces on the worker or other addressable hardware.
{% set environment = {
'RELAY_ADDRESS': '10.66.16.103',
'REMOTE_SERIAL_PORT': '/dev/ttyUSB2',
} %}
For ease of use, LAVA will directly export the content of the device_info, environment, static_info and storage_info dictionaries into the test shell environment. The dictionaries and lists will be unrolled, for example:
{% set static_info = [{"board_id": "S_NO81730000"}, {"board_id": "S_NO81730001"}] %}
{% set storage_info = [{'SATA': '/dev/disk/by-id/ata-ST500DM002-1BD142_W3T79GCW'}] %}
will become:
export LAVA_STATIC_INFO_0_board_id='S_NO81730000'
export LAVA_STATIC_INFO_1_board_id='S_NO81730001'
export LAVA_STORAGE_INFO_0_SATA='/dev/disk/by-id/ata-ST500DM002-1BD142_W3T79GCW'
The environment can be overridden in the job definition. See Provide environment variables for the device in the job description.