27
https://www.pengutronix.de real-world examples ATS 2019 - Lyon Jan Lübbe – [email protected] Rouven Czerwinski – [email protected]

Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

https://www.pengutronix.de

real-world examplesATS 2019 - Lyon

Jan Lübbe – [email protected] Czerwinski – [email protected]

Page 2: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

2

Page 3: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

3/27

Agenda

Short overview of labgrid: scope, use-cases and architecture Example: OP-TEE on i.MX6

local and remote access automated provisioning (“strategies”) testing of: bootloader, OP-TEE init, TA usage under Linux reservations

controlling diverse hardware

Page 4: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

4/27

Board Access @ Pengutronix

Customer sends one board “We want tests as well!”

→ Allow developer access and scheduled CI test runs Use existing infrastructure to ease dev tasks

Bootstraping device Booting to Linux (do what’s necessary)

→ Reuse test information for board control Bootloader Testing

→ Always bootstrap the whole system

Page 5: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

5/27

Tests and CLI access

Pytest Interface for tests Reuse pytest fixtures infrastructure Reuse pytest hooks for collection, modification,…

CLI interface for remote boards Turn board on/off, open console, switch IO, show webcam video,

Infrastructure to reserve and lock boards Only one board for several devs, requiring coordination

Page 6: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

6/27

Remote Transparent Configuration

Switching from local to remote should be easy Workflow

Bringup at desk Put into lab Replace hand-defined resources with RemotePlace ??? Done!

Page 7: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

7/27

Try Something Else Less

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 test job scheduler (unlike LAVA, Fuego) use Jenkins instead or use from shell

no fixed deployment / boot process (all? others) full control from client code

library interface not only for testing⇒

Page 8: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

8/27

Layers

Page 9: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

9/27

Exporters and Remote Access

Page 10: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

10/27

Target API

Serial PDU

Serial Driver

PowerDriver

ShellDriver

BootloaderDriver

Strategy Target API

Page 11: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

11/27

Addtitional Interfaces

Serial PDU

Serial Driver

PowerDriver

ShellDriver

BootloaderDriver

Fastboot

FastbootDriver

USB-Loader

BootstrapDriver

Strategy Target API

PIODriver

1W-PIO

Page 12: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

12/27

Basic Configuration

YAML

Describes “Targets” with Resources Drivers

HW/SW-Specific parameters The “Environment”

Page 13: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

13/27

Test Cases in pytest

Test execution, selection and reporting is provided by pytest

Fixtures provide access at different levels (command, strategy, target, env)

pytest (and Python libs) make it easy to prepare test data and analyze results

Easy to integrate in Jenkins

Page 14: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

14/27

Remote Access

Page 15: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

15/27

Demo: labgrid-suggest

=== existing device ===

USBSerialPort for /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.2/1-3.2:1.0/ttyUSB1/tty/ttyUSB1

=== device properies ===

device node: /dev/ttyUSB1

udev tags: seat, systemd, uaccess

vendor: FTDI

vendor (DB): Future Technology Devices International, Ltd

model: USB_Serial_Converter

model (DB): FT232 Serial (UART) IC

revision: 0600

=== suggested matches ===

USBSerialPort:

match:

'@ID_PATH': pci-0000:00:14.0-usb-0:3.2

---

USBSerialPort:

match:

'@ID_SERIAL_SHORT': FT8WJPE3

---

Page 16: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

16/27

Demo: Local Board

environment interacting with the board

Page 17: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

17/27

Demo: Remote Board

labgrid-client, places lock/unlock power, console

Page 18: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

18/27

Demo: Automated Provisioning

labgrid-client -s using the strategy for provisioning and for bootloader shell,

linux shell

Page 19: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

19/27

Demo: pytest Test-Cases

pytest run simple and more complex test case code

Page 20: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

20/27

Demo: Reservations

labgrid-client lock, reserve, unlock other, lock

Page 21: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

21

Page 22: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

22

Page 23: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

23

Page 24: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

24/27

Demo: Other HW

remote web-cam, PSU, scope SSH proxy

Page 25: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

https://www.pengutronix.de

Questions? Discussion…

Thanks!

Page 26: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

26/27

Scripting

Page 27: Authenticated and Encypted Storage on Embedded Linux · no fixed deployment / boot process (all? others) ... linux shell. 19/27 Demo: pytest Test-Cases pytest run simple and more

27/27

Autoinstaller

Target BoardUSB

USBHub

UART

USBUART

Target BoardUART USB

USBHub

USBUART

Target BoardUART USB

USBHub

USBUART