LAA manager (aka. laam)

The LAA Manager is a python application that allows to interact with the LAA REST API.

LAA v1.4

The REST API used by laam is only available in LAA v1.4 and after.

Installation

laam is available from PyPI:

python3 -m venv venv
source venv/bin/activate
python3 -m pip install laam
laam --help

Configuration

In order to use laam with your LAA, you must create an identity with:

laam identities add --uri http://laa.local --token abcdefghijklmnopqrstuvwxyz0123456789 default

Where:

  • --uri: URL of the LAA

  • --token: api token previously created

  • default: name of the identity

Identity selection

You can have multiple identities, each with a unique name. When running laam you can select the identity to use with laam -i <identity> ....

By default, laam will use the identity called default.

Usage

Linaro Automation Appliance Manager

options:
  -h, --help            show this help message and exit
  --version             show program version number and exit

identity:
  --uri URI             URI of the LAA API
  --token TOKEN         Token for the LAA API
  --identity ID, -i ID  Identity stored in the configuration

Command:
  {identities,dut,files,laacli,network,serials,services,system,usbs,workers}
                        Command
    identities          Manage laam configuration
    dut                 Enable attached DUT
    files               Manage files in /var/lib/lava/dispatcher/tmp
    laacli              Run laacli commands on the LAA
    network             Manage network
    serials             Manage DUT serials
    services            Manage services
    system              Get LAA Info
    usbs                List USB devices
    workers             Manage workers

identities

Every commands, except identities requires the user to provide an identity.

If none are provided, laam will automatically use the default one and fails if it does not exists.

Commands

identities

Manage laam identities stored in ~/.config/laam.yaml.

$ laam identities --help
usage: laam identities [-h] {add,delete,list,show} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {add,delete,list,show}
                        Sub command
    add                 add an identity
    delete              delete an alias
    list                list available identities
    show                show identity details

The format of the file is pretty simple as it’s a list of dictionaries where the key if the identity name. The file would look like:

identity-1:
  token: abcdef
  uri: http://laa-00001.local
identity-2:
  token: 123456
  uri: http://laa-00002.local

The different identities are then usable with:

$ laam -i identity-1

dut

$ laam dut --help
usage: laam dut [-h] {check,new,render,test} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {check,new,render,test}
                        Sub command
    check               Check the configuration
    new                 Create a device configuration file
    render              Render device-type template and device dict
    test                Boot test the DUT

files

Manage files in /var/lib/lava/dispatcher/tmp on the LAA.

$ laam files --help
usage: laam files [-h] {list,pull,push,rm} ...

options:
  -h, --help           show this help message and exit

Sub command:
  {list,pull,push,rm}  Sub command
    list               List files
    pull               Pull a file
    push               Push a file
    rm                 Remove a file

laacli

Execute laacli commands on the LAA.

$ laam laacli --help
usage: laam laacli [-h] {button,led,power,rev,screenshot,temp,usb,usbg-ms,watt} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {button,led,power,rev,screenshot,temp,usb,usbg-ms,watt}
                        Sub command
    button              Virtual buttons
    led                 User LED
    power               Power rails
    rev                 LAA revision
    screenshot          OLED screenshot
    temp                Query temperature (Β°C)
    usb                 USB hub
    usbg-ms             USB Gadget Mass storage
    watt                Power consumption

network

Manage LAA network configuration

$ laam network --help
usage: laam network [-h] {addresses,hostname,interfaces,routes,settings} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {addresses,hostname,interfaces,routes,settings}
                        Sub command
    addresses           List addresses
    hostname            Hostname
    interfaces          List interfaces
    routes              List routes
    settings            Settings

serials

List and interact with the different serial consoles provided by the LAA.

$ laam serials --help
usage: laam serials [-h] {list,connect,show} ...

options:
  -h, --help           show this help message and exit

Sub command:
  {list,connect,show}  Sub command
    list               List serials
    connect            Connect to serial
    show               Serial details

services

Manage systemd services running on the LAA.

$ laam services --help
usage: laam serials [-h] {list,connect,show} ...

options:
  -h, --help           show this help message and exit

Sub command:
  {list,connect,show}  Sub command
    list               List serials
    connect            Connect to serial
    show               Serial details
[:~] % laam services --help
usage: laam services [-h] {list,logs} ...

options:
  -h, --help   show this help message and exit

Sub command:
  {list,logs}  Sub command
    list       List services
    logs       Services logs

system

Display LAA system information.

$ laam system --help
usage: laam system [-h] {logs,fleet,version} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {logs,fleet,version}  Sub command
    logs                Appliance logs
    fleet               Bakfleet Information
    version             Appliance Version

usbs

Display usb devices.

$ laam usbs --help
usage: laam usbs [-h] {list,show} ...

options:
  -h, --help   show this help message and exit

Sub command:
  {list,show}  Sub command
    list       List USB devices
    show       USB details

workers

Manage LAVA workers running on the LAA.

$ laam workers --help
usage: laam workers [-h] {dockerfile,list,logs,show,test} ...

options:
  -h, --help            show this help message and exit

Sub command:
  {dockerfile,list,logs,show,test}
                        Sub command
    dockerfile          LAVA worker Dockerfile
    list                List workers
    logs                Worker logs
    show                Worker details
    test                Test connection to server