Hi folks,

The 2020.02 tag has been pushed to master on git.lavasoftware.org.
.deb packages have been built in GitLab CI and are published at

  https://apt.lavasoftware.org/release

Docker images for amd64 and arm64 have been built in GitLab CI and
are available from

  https://hub.lavasoftware.org/

and

  https://hub.docker.com/u/lavasoftware

Changes in this release
=================

Upgrading
=========

Debian stretch
--------------

The support for Debian Stretch as been dropped. The minimal supported version is now Debian Buster.

Security issues
---------------

Two security issues have been discovered and fixed in LAVA:
* remote code execution on the dispatcher (as root)
* overriding any directory on the dispatcher filesystem
Every version of LAVA (since 2014) are affected. However, only authenticated users can exploit these issues.

We strongly advise to upgrade your instances to LAVA 2020.02.

Device-types
============

New device-types
----------------

New supported devices:
* bcm2711-rpi-4-b
* meson-sm1-khadas-vim3l
* musca-a
* musca-b
* rk3288-miqi
* sun50i-h5-nanopi-neo-plus2

docker
------

ADmins can add any extra argument to the docker DUT by setting `docker_extra_arguments` in the device dictionary:

```jinja
{% set docker_extra_arguments = ["--ip", "10.0.1.3"] %}
```

MPS2
----

Allow to use the `flasher` deploy method.

Musca
-----

Add support for Musca boards.

```yaml
actions:
- deploy:
    to: musca
    images:
      test_binary:
        url: https://community.arm.com/.../MuscaBlinky_5F00_v002.hex

- boot:
    method: musca
```

UUU deploy and boot
--------------------

[UUU](https://github.com/NXPmicro/mfgtools) is NXP's flashing tool for IMX platforms.

UUU allows to intercept IMX ROM code, and download images on target by using SDP (Serial Download Protocol).
IMX platforms are booting in SDP mode based on dip switches, but also falls back in SDP mode when no valid  bootloader is found in the selected boot media (eg: SD card, or eMMC).

```yaml
actions:
- deploy:
    to: uuu
    images:
      boot:
        url: https://example.com/initramfs-genericarmv7a.cpio.gz
        compression: gz
    timeout:
      minutes: 2

- boot:
    method: uuu
    commands:
    - uuu: -b sd {boot}
    timeout:
      minutes: 4
```

vexpress
--------

The u-boot commands are now send one by one. The use of environment variable to store boot commands has also been removed in favor of executing the commands immediately.
This will allow to detect error early in the job.

Docker test action
==================

LAVA dispatcher can now run a test action in a docker container running on the host. This feature can be used to run android tests from a user-defined docker container against the DUT.

```yaml
- test:
    timeout:
      minutes: 10
    docker:
      image: adb-fastboot
    definitions:
    - repository:
        metadata:
          format: Lava-Test Test Definition 1.0
          name: smoke-adb-tests
          description: "Simple adb tests"
        run:
          steps:
          - date
          - hostname
          - adb devices
          - adb shell date
          - adb shell hostname
      from: inline
      path: inline-smoke-test
      name: docker-test
```

Image modification
==================

LAVA dispatcher can now append user-defined overlays to images. For example, users can now ask LAVA to add some modules to the rootfs.

Currently, the image to update should be either a `cpio` (newc) or an `ext4` image. The overlays should be tar archives.

The job definition would look like this:

```yaml
rootfs:
  url: http://example.com/rootfs.ext4.xz
  compression: xz
  format: ext4
  overlays:
    modules:
      url: http://example.com/modules.tar.gz
      compression: gz
      format: tar
      path: /
```

Dispatcher configuration
========================

Allow to set `http`, `nfs` and `tftp` dispatcher ip in the dispatcher configuration.

Edit `/etc/lava-server/dispatcher.d/<hostname>/dispatcher.yaml`:
```yaml
dispatcher_http_ip: <dispatcher-http-ip>:<port>
dispatcher_nfs_ip: <dispatcher-nfs-ip>:<port>
dispatcher_tftp_ip: <dispatcher-tftp-ip>:<port>
```

If the value is not defined, LAVA will fallback to `dispatcher_ip`.

REST API
========

New TestJob endpoints
---------------------

New actions are available for TestJob REST API:

* ```/api/v0.2/jobs/${job_id}/resubmit/```
* ```/api/v0.2/jobs/${job_id}/cancel/```
* ```/api/v0.2/jobs/validate/```

Validate action expects a POST request with job definition data which is to be validated against validation schema as argument.

New permissions endpoints
-------------------------

Additional new endpoints are available in REST API:

* ```/api/v0.2/permissions/devicetypes/```
* ```/api/v0.2/permissions/devices/```

They are used to control the new authorization system. Available only for
system administrators.

Bugs
----

Issue when non authenticated users where trying to list devices or device types
which resulted in an error is now fixed.

Web server
==========

Gunicorn is now responsible for serving static files (css, js, ...). This was handled by Apache2 before. This change is improving performances by improving browser caching and pre-compressing resources.

This will allow to use any reverse proxy like HAProxy, nginx or Traefik.

Development
===========

Dispatcher remote debugging
---------------------------

Starting lava-slave with `--debug` will make it call `lava-run` with `--debug`. And that will make the lava-run stop right before running each job and start a remote pdb debugging session at that point.
   
The debugger is accessed via telnet.


Thanks

--
Rémi Duraffort
LAVA Architect
Linaro