Test definitions¶
The test definition is a yaml
file that describe the tests that you want LAVA
to run on the DUT.
Smoke example¶
Let's look at this example:
metadata:
format: Lava-Test Test Definition 1.0
name: smoke-tests-basic
description: "Run basic smoke tests."
run:
steps:
- lava-test-case linux-posix-pwd --shell pwd
- lava-test-case linux-posix-uname --shell uname -a
- lava-test-case linux-posix-vmstat --shell vmstat
- lava-test-case linux-posix-ifconfig --shell ifconfig -a
- lava-test-case linux-posix-lscpu --shell lscpu
- lava-test-case linux-posix-lsb_release --shell lsb_release -a
Metadata¶
The metadata
dictionary describes the test. format
and name
are mandatory
while description
is optional.
Run¶
The dictionary list the actions that LAVA should execute on the DUT. The only
available key is steps
.
steps
is an array that will be transformed into a shell script that LAVA will
run on the DUT.
In this example, run.steps
will be rendered into the following shell script:
###default parameters from test definition###
######
###test parameters from job submission###
######
set -e
set -x
export TESTRUN_ID=0_smoke-tests-basic
cd /lava-4212/0/tests/0_smoke-tests-basic
UUID=`cat uuid`
set +x
echo "<LAVA_SIGNAL_STARTRUN $TESTRUN_ID $UUID>"
set -x
lava-test-case linux-posix-pwd --shell pwd
lava-test-case linux-posix-uname --shell uname -a
lava-test-case linux-posix-vmstat --shell vmstat
lava-test-case linux-posix-ifconfig --shell ifconfig -a
lava-test-case linux-posix-lscpu --shell lscpu
lava-test-case linux-posix-lsb_release --shell lsb_release -a
set +x
echo "<LAVA_SIGNAL_ENDRUN $TESTRUN_ID $UUID>"
Install¶
install
LAVA can also install some packages or sources before running the tests. See the technical documentation for more information.