Devauto

From Yocto Project
Jump to: navigation, search

***Devauto is a library that is yet to be published and it is intended for the Milestone 1 of Yocto Project 2.3 which is somewhere on December 2016***

Contents

Description

Devauto is an installable Python 3 library and command line interface intended to manage the device automation assets that act upon a target's physical state, such as Power, I/O routing, HID emulation and others. The library is intended to provide a standard interface for interacting with automation devices.

Automating the Target Setup Process

As a reference, below are listed the steps to setup an image:

Manual Setup of a Target

This is the typical manual procedure for setting up a target:

  1. With an image built, transfer it over to a bootable media
  2. Manually switch the bootable media to the test target
  3. Manually power/restart the test target so it gives you the option to boot from the new media inserted
  4. Manually enter the keyboard sequence to select the media to either boot or install the image in question
  5. Wait for the device to boot and be ready to use

With Devauto, the manual tasks can be executed without human intervention:

Setup of a Target with Devauto

  1. With an image built, transfer it over to a bootable media
  2. Request Devauto to multiplex the bootable media from the server to the test target
  3. Request Devauto to power/restart the test target so it gives you the option to boot from the new media inserted
  4. Request Devauto to send a keyboard sequence to select the media to either boot or install the image in question
  5. Wait for the device to boot and be ready to use

Refer to the Test Automation Hardware wiki for more information on how to create automated environments for testing.

Interfaces

This module has two points of interaction, one with the user that requests a desired action to be taken and another with the asset that performs the requested action.

Asset Interface

Devauto is a controller of assets and it groups them based on the type of actions these perform. Each group of assets has a template intended to provide a standard minimum set of actions for the different devices of the same group. Information about the devauto asset interface and how to create one can be consulted at the creating a new devauto asset page.

Each group of devices has the following features:

  • It becomes a sub-command of the devauto cli
  • It brings a mock device as the first member of the group
  • It provides an abstract class (a template) for the devices to inherit from

User Interface

Devauto is an installable Python3 library that includes a command line interpreter(CLI). This means that as a library it can be imported at other Python3 scripts, and as a CLI it can be invoked from the terminal.

Usage Samples

The table below shows how an action is taken in either of the 3 possiblities: Manually, Devauto CLI and Devauto Library.

Manual Action Devauto CLI command Devauto Lib command
Insert a USB Stick into target 1 $ devauto usbmux --select 1 >>> devauto.usbmux.select(1)
Power off target 2 $ devauto rps --turn-off 2 >>> devauto.rps.turn_off(2)

Benefits to Existing Processes

Automating BSP Tests and Execution Flows

The Devauto tool brings the image testing in physical targets closer to other automated tests in Yocto Project, such as the build-time testing or the testimage on virtual targets. This enables the following abilties for BSP testing:

  • Including physical targets in the Autobuilder testing
  • Allowing developers and testers to script the target's physical actions

Enable Device Abstraction

An AFT instance was enabled using devauto as the underlying device asset controller and it avoided writing the drivers for the AFT.

It is possible to use devauto commands to control a device automation flow no matter which asset you are using. Devauto is designed to scale from the unitary configuration to the number of devices your assets can drive.

Testing Devauto

Devauto implements testing via the doctest and unittest formats.

Personal tools