Automation beyond Testing and Embedded System Validation Embedded - - PowerPoint PPT Presentation

automation beyond testing and embedded system validation
SMART_READER_LITE
LIVE PREVIEW

Automation beyond Testing and Embedded System Validation Embedded - - PowerPoint PPT Presentation

Automation beyond Testing and Embedded System Validation Embedded Linux Conference Europe Jan Lbbe <j.luebbe@pengutronix.de> Slide 1 - http://www.pengutronix.de 2017-10-23 Some Background Embedded Linux integration and


slide-1
SLIDE 1

Slide 1 - http://www.pengutronix.de – 2017-10-23

Automation beyond Testing and Embedded System Validation

Embedded Linux Conference Europe Jan Lübbe <j.luebbe@pengutronix.de>

slide-2
SLIDE 2

Slide 2 - http://www.pengutronix.de – 2017-10-23

Some Background

  • Embedded Linux integration and development for custom hardware
  • Using Linux mainline, mesa, wayland, gstreamer, Qt, chromium, …

Everything changes all the time ⇒ ⇒ Updates break user-visible features Kernel and application level testing “solved” with Jenkins & LAVA

slide-3
SLIDE 3

Slide 3 - http://www.pengutronix.de – 2017-10-23

A Short Survey

  • Who has developed embedded Linux systems?

… rolled out a major base-system update?

… updates the base-system at least once a year?

  • Who has automated tests for:

The application?

… and the kernel (-drivers)?

… and the update installer?

… and the rollback mechanism?

  • What do you use (in-house, Jenkins, LAVA, …)?
slide-4
SLIDE 4

Slide 4 - http://www.pengutronix.de – 2017-10-23

Current State

  • Test automation:

LAVA, Fuego, autotest, avocado, TI VATF, U-Boot test tool, CI-RT R4D, Baylibe Lab in a Box, …

  • Development automation:

scripting via SSH

expect

  • Production automation:

flash images via robot

SoC-vendor-sepecific tools (running on windows)

ad-hoc scripting

slide-5
SLIDE 5

Slide 5 - http://www.pengutronix.de – 2017-10-23

Shortcomings

  • Large overhead for running and writing a single test

painful to use during iterative development ⇒

  • Limited control over the target from the individual test

no reboots

no easy control over IO (buttons, dip switches, USB, …)

  • Hard to reuse for other use-cases and one-off tools

git bisect

slide-6
SLIDE 6

Slide 6 - http://www.pengutronix.de – 2017-10-23

Goals

  • Make automation useful during normal iterative development

Upload bootloader via USB

Control distributed equipment

Easy test loops

  • Support the same tests and tools from a CI environment
  • Make it easy to extend and embed
  • Connect/automate existing tools (LTP, …)
slide-7
SLIDE 7

Slide 7 - http://www.pengutronix.de – 2017-10-23

Reduced Scope and Reusability

  • no integrated build system (unlike Fuego)

use OE/PTXdist/buildroot instead

  • no integrated test runner (unlike LAVA, autotest, many others)

use pytest and/or custom scripts

  • no scheduler (unlike LAVA, Fuego)

use Jenkins instead or use from shell

  • no fixed boot process (all? others)

full control from client code

  • not only for testing
slide-8
SLIDE 8

Slide 9 - http://www.pengutronix.de – 2017-10-23

HW/SW Control as a Library

  • Embedded system testing feels like pure SW testing
  • High-Level: Similar to what I would tell a colleague to do
slide-9
SLIDE 9

Slide 10 - http://www.pengutronix.de – 2017-10-23

Architecture

Serial PDU

Console Driver

Power Driver

Shell Driver Bootloader Driver

Fastboot Fastboot Driver USB-Loader Bootstrap Driver Strategy Target API

slide-10
SLIDE 10

Slide 11 - http://www.pengutronix.de – 2017-10-23

Architecture

Serial PDU

Serial Driver

Power Driver

Shell Driver Bootloader Driver

Fastboot Fastboot Driver USB-Loader Bootstrap Driver Strategy Target API PIO Driver 1W-PIO

slide-11
SLIDE 11

Slide 18 - http://www.pengutronix.de – 2017-10-23

CI for Embedded Systeme - Problems

Entwicklerboard Entwickler Du Server

? ? ?

slide-12
SLIDE 12

Slide 20 - http://www.pengutronix.de – 2017-10-23

Linaro Automated Validation - LAVA

 Distributed  Kernel CI  Boarst deticated to LAVA (except maintainance mode)  Large overhead for interactive use

slide-13
SLIDE 13

Slide 21 - http://www.pengutronix.de – 2017-10-23

Labgrid – Pytest plugin

 Python - Pytest  Fixtures  pytest-entry point  no integrated build system  yaml configuration  examples  prepared test suites config.yaml

slide-14
SLIDE 14

Slide 22 - http://www.pengutronix.de – 2017-10-23

Labgrid – Remote Control

Coordinator

Exporter Exporter Exporter

 Exports  Exports  Exports Direct resource access 

Client Client

Access  Access 

slide-15
SLIDE 15

Slide 31 - http://www.pengutronix.de – 2017-10-23

Demo

slide-16
SLIDE 16

Slide 32 - http://www.pengutronix.de – 2017-10-23

slide-17
SLIDE 17

Slide 33 - http://www.pengutronix.de – 2017-10-23

slide-18
SLIDE 18

Slide 36 - http://www.pengutronix.de – 2017-10-23

Currently Working

  • Remotly control boards in lab from CLI (console, power, BL upload, fastboot)
  • Run pytest against local and remote boards
  • Run tests from Jenkins and collect results via Junit-XML
  • Ad-Hoc automation: git bisect, reproducing sporadic errors
  • Automatic factory installation via USB directly from built BSP
slide-19
SLIDE 19

Slide 37 - http://www.pengutronix.de – 2017-10-23

Next Steps

  • Remote target reservation (for use with Jenkins CI)
  • Improved logging and reports
  • Driver priorities (use ResetProtocol instead of PowerProtocol when available)
  • Driver preemption (handle unexpected state changes)
  • Automatic integration tests for RAUC with QEmu in Jenkins
slide-20
SLIDE 20

Slide 38 - http://www.pengutronix.de – 2017-10-23

Discussion

@shoragan, +JanLübbe-jlu