How to create Lava Tests and use them locally

You can run lava tests locally with the tools available here: https://git.linaro.org/qa/lava-local-test.git Instructions are provided in README.rst.

Supported distros are in lava_test_shell/distro, Debian is recommended. When writing your test definitions, put ‘kvm’ in the ‘devices’ field. You must also adapt the ‘os’ field and your steps according to your test distro.

Here is a sample test definition:

metadata:
    format: Lava-Test Test Definition 1.0
    name: smoke-tests-basic
    description: "Basic system test commands for Debian images"
    os:
        - debian
    scope:
        - functional
    devices:
        - kvm

run:
    steps:
        - lava-test-case linux-linaro-debian-pwd --shell pwd
        - lava-test-case linux-linaro-debian-uname --shell uname -a
        - lava-test-case linux-linaro-debian-vmstat --shell vmstat
        - lava-test-case linux-linaro-debian-ifconfig --shell ifconfig -a
        - lava-test-case linux-linaro-debian-lscpu --shell lscpu
        - lava-test-case linux-linaro-debian-lsb_release --shell lsb_release -a

If you need inspiration, a collection of various test definitions is available here: https://git.linaro.org/qa/test-definitions.git/

See also: https://validation.linaro.org/static/docs/v2/writing-tests.html