LabControl project

LabControl is a system for managing and using equipment in a test lab.

Collaborators [edit section]

The following people are working on this project:

Resources [edit section]

Here is the mailing list address for discussion:

to do [edit section]

Components [edit section]

It consists of 2 main elements:

Envisioned Scenarios [edit section]

Using command line [edit section]

reboot a board [edit section]

Options:

Operation at the server:

Operation at the client: If synchronous operation:

check board status using CLI [edit section]

register new board with server [edit section]

Using web interface [edit section]

reboot a board using interface [edit section]

Present interface for reboot on board page.

When user clicks link (or button?), cause operation on server:

Operation at the server:

check board status using web interface [edit section]

Show board status on board page

Use AJAX to update the status in real time. Status is gathered from lab/board/resources at time of request.

multiplexing [edit section]

lc command can read resource configuration from local files lcserver can call lc command for resource configuration lcserver can call lc command to perform operations lcserver can call arbitrary local processes to perform operations lcserver stores it's own configuration data in json files

farm and tests using LabControl [edit section]

CLI operation [edit section]

Architecture [edit section]

Notes and questions [edit section]

Comparison with Board Farm Cloud implementation [edit section]

BFC rest api [edit section]

See file:BFC-TAS_REST_APIs.pdf

Some examples:
Object  ^ Category  ^ Verb  ^ REST path  ^ HTTP Method  ^ Notes  ^
Device Power Control on /api/v0.2/devices/<device_name>/power/on/ GET .
Device Power Control off /api/v0.2/devices/<device_name>/power/off/ GET .
Device Power Control reboot /api/v0.2/devices/<device_name>/power/reboot/ GET .
Device Power Control status /api/v0.2/devices/<device_name>/power/ GET .
Device Power Control user defined command /api/v0.2/devices/<device_name>/power/<user-defined>/ GET .
Device Access Control Active /api/v0.2/devices/ GET .
Device Access Control My /api/v0.2/devices/mine/ GET .
Device Access Control allocate /api/v0.2/devices/<device_name>/assign GET .
Device Access Control release /api/v0.2/devices/<device_name>/release GET .
Device Access Control release force /api/v0.2/devices/<device_name>/release/force/ GET .
Device Info info /api/v0.2/devices/<device_name>/ GET .
Device Shell Access run /api/v0.2/devices/<device_name>/run/serial/ GET Why is this separate from ssh?
Device Shell Access run /api/v0.2/devices/<device_name>/run/ssh/ GET Why is this separate from serial?
Device File Management upload /api/v0.2/devices/<device_name>/upload/serial/ PUT Why is this separate from ssh?
Device File Management upload /api/v0.2/devices/<device_name>/upload/ssh/ PUT Why is this separate from serial?
Device File Management download /api/v0.2/devices/<device_name>/download/serial/ GET Why is this separate from ssh?
Device File Management download /api/v0.2/devices/<device_name>/download/ssh/ GET Why is this separate from serial?
Device Port Forwarding add /api/v0.2/devices/<device_name>/portfw/ssh/ POST .
Device Port Forwarding remove /api/v0.2/devices/<device_name>/portfw/ssh/ DELETE .
Device Port Forwarding restore /api/v0.2/devices/<device_name>/portfw/ssh/ PUT .
Device Web Cam restartfeed /api/v0.2/devices/<device_name>/webcam/restartfeed/ GET Path doesn't look right in document (missing v0.2 element)
Device Image Capture capture /api/v0.2/devices/<device_name>/image/capture/ GET Path doesn't look right in document (missing v0.2 element)
Zombie & IOCX Hotplugs on /api/v0.2/devices/<device_name>/hotplugs/<hotplug_number(1-4)/on/ PUT .
Zombie & IOCX Hotplugs off /api/v0.2/devices/<device_name>/hotplugs/<hotplug_number(1-4)/off/ PUT .
Zombie & IOCX Hotplugs status /api/v0.2/devices/<device_name>/hotplugs/<hotplug_number(1-4)/ GET .
Zombie & IOCX Hotplugs switch /api/v0.2/devices/<device_name>/hotplugs/<hotplug_number(1-4)/switch/ PUT .
Zombie & IOCX GPIO read /api/v0.2/devices/<device_name>/gpio/read/<gpio_pin_pattern>/<gpio_pin_data>/ GET .
Zombie & IOCX GPIO write /api/v0.2/devices/<device_name>/gpio/write/<gpio_pin_pattern>/<gpio_pin_data>/ PUT .
Console Serial Console start /api/v0.2/devices/<device_name>/console/serial/start/ GET Why is serial hardcoded here?
Console Serial Console stop /api/v0.2/devices/<device_name>/console/serial/stop/ GET Why is serial hardcoded here?
Console Serial Console restart /api/v0.2/devices/<device_name>/console/serial/restart/ GET Why is serial hardcoded here?
Console Serial Console isactive /api/v0.2/devices/<device_name>/console/serial/isactive/ GET Why is serial hardcoded here?
Query

BFC CLI api [edit section]

BFC uses a command line tool called 'ebf' Here are some of the ebf command-line options:

Category  ^ Command line  ^ Description  ^ Notes  ^
Devices ebf list devices List available devices .
Devices ebf <device_name> status Print Device information - available/allocated to someone .
Devices ebf <device_name> allocate Assign Device to user .
Devices ebf <device_name> release Release Device .
Devices ebf <device_name> release force Release Device assigned to another user .
Devices ebf <device_name> mydevices List all Devices assigned to me ttc has no correlary
Devices ebf <device_name> info Show Device information (such as power commands, Zombie info, IOCX connected status, AV streaming availability, etc) .
Devices ebf <device_name> run <command> Run command on Device and return command output .
Devices ebf <device_name> upload <src_path> <device dest path> Upload file to powered-up device .
Devices ebf <device_name> download <device file path> Download file from powered-up device No local destination path?
Console ebf <device_name> console Access Device's serial console .
Console ebf <device_name> logs Download Device's console logs ttc has no correlary
Power ebf <device_name> power on|off|reboot|user-defined-command Power control .
Power ebf <device_name> power status Device's current power status .
Hotplug Control ebf <device_name> hotplug <hotplug_number> on|off|status|switch Control hotplugs (IOCX) Similar to SDB relays
GPIO ebf <device_name> gpio <command> <gpio_pin_pattern> <gpio_pin_data> Control GPIO to/from board .
Query

ttc cli [edit section]

Category  ^ Command line  ^ Description  ^ Notes  ^
Device management ttc list List targets .
Device management ttc <target> status Show target status (power, network, can execute command?, reservation) .
Device management ttc <target> reserve Reserve target .
Device management ttc <target> release Release target reservation .
Device management ttc <target> release -f For release of reservation (held by another user) .
Device management ttc <target> info Show information about a target configuration .
Command execution ttc <target> run <command> Run command and return command output .
File transfer ttc <target> cp <src_path> target:<dest_path> Copy a file to the target .
File transfer ttc <target> cp target:<src_path> <dest_path> Copy a file from the target .
Console ttc <target> console Access target console Usually serial
Interactive login ttc <target> login Access non-console target login shell Usually ssh (but can be adb)
Power ttc <target> on|off|reboot|reset Control power (/reset) for target .
Power ttc <target> pos Get target power status (power-on-status) .
Build ttc <target> get_kernel Get source for kernel for target .
Build ttc <target> get_config Get kernel configuration for target .
Build ttc <target> set_config <config_entry> Set kernel configuration option(s) for target .
Build ttc <target> kbuild Build kernel for target .
Build ttc <target> mbuild Build modules for target .
Build ttc <target> fsbuild Build rootfs for target .
Provisioning ttc <target> kinstall Install kernel where target will boot to it .
Provisioning ttc <target> minstall Install modules where target will use them .
Provisioning ttc <target> fsinstall Install root filesystem where target will boot to it .
Query

Example [edit section]

GPIO test using wget to access rest api [edit section]

Here are some lines from Sample-GPIO-Bit-IO-Test.sh:

This seems to only get data from the IOCX board gpio pins, and not from the DUT. I'm not sure how this test works.

serial rx test using lc [edit section]

This is a draft for brainstorming purposes:

Interface between farm and tests [edit section]

test-config file [edit section]

It is proposed that there be a file called test-config located in: /etc or in /usr/test on the device under test. The file would consist of a series of lines that indicated the values for variables used by tests.

A line would consist of an all-uppercase-name, followed by an equals sign ("="), and a value statement. The value statement could be a literal value with simple static value definition, or it could be a command that could be used to obtain the value.

If a value starts with $(, then any tool using the file would execute it as a command and use the stdout from the command as the value for the variable.

Items may be quoted (e.g. to preserve spaces). Leading and trailing quotes are not part of the value.

See /etc/os-release for an example of a file with similar format (without the command execution part).

NAME="beaglebone_4"
NETPERF_SERVER_IP=10.0.1.1
#NETPERF_SERVER_IP=$(lc resource netperf info ip_addr)
POWER_MONITOR=$(lc board resource_connection power_monitor)

The value of using a file, is that it can be staged to a board in multiple ways, to accommodate a variety of testing configurations, and it is very lightweight. For a particular rootfs, the file could be installed with just the definitions required for a single test. A simple shell script could parse the file and retrieve values. But even in its simple form it has sufficient indirection to allow a test to obtain the values it needs to perform tests.

This essentially is an on-device BOARD file.

Need for a registry [edit section]

There will need to be a registry to hold the names of the items that are used as resource identifiers for the system.

Proposed initial identifiers [edit section]

Right now, this is just a collection of names culled from different places or made up wholesale:

Notes [edit section]

Notes from call on 2020-09-17 [edit section]

thoughts on boards/resources/connections [edit section]

First test - proof of concept [edit section]